LibQuestItem-1.0

There are various ways to tell if a item is a quest item or not. This library will attempt to combine all different ways.

The library will only be able to tell a addon if a item is a quest item if the user have the item equipped, in a bag, on keyring or in bank when visiting.

Implemented so far:
-Scan for quest items in bags, keyring and equipped. Scanning using GetContainerItemQuestInfo() and looking at item type and subtype using GetItemInfo.
-Scan for quest items using the questlog using GetQuestLogSpecialItemInfo().
-Detects if items starts a quest and/or if the user is already on the quest the item belongs to.

API (so far):
GetQuestItems(forceRescan) -returns a table with itemIds and their properties.
IsQuestItem(itemId) -return true if quest item.
IsUsable(itemId) -return true if usable quest item.
StartsQuestId(itemId) -return the questId if item starts a quest.
IsQuestActive(itemId) -return true if user is on quest.

NOTE:
This is my first library so any constructive feedback is very welcome.

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of Zidomo Zidomo Aug 10, 2010 at 03:43 UTC - 0 likes

    Odd. Well, here is a screenshot of OptionHouse with LibQuestItem-1.0 r13 standalone active with CPU profiling enabled so you can see what's happening here. I cut that section out of the original WoW screenshot with IrfanView.

    r13 is using identical CPU as r11 was. That CPU usage is continual, not occasional spiking. It never drops below 0.275 and never goes above 0.350. If wondering, the OptionHouse frame display has been distorted since WoW 3.3.3 (see comments on its WoWI page).

    QuestItemBar r45 using LibGratuity-3.0 (which you've eliminated in the latest alphas & added LibQuestItem-1.0) uses 0.0 CPU on idle. Still hope you can do something to improve this library. If not, GL with it & the mod.

  • Avatar of Nickenyfiken Nickenyfiken Aug 09, 2010 at 20:36 UTC - 0 likes

    Nope sorry, OptionHouse is telling me 0.000 CPU/Sec for LibQuestItem running standalone.

  • Avatar of Nickenyfiken Nickenyfiken Aug 09, 2010 at 08:38 UTC - 0 likes

    That is really weird. Using AddonProfiler I see no CPU usage at all except after a BAG_UPDATE. I will try OptionHouse tonight.

  • Avatar of Zidomo Zidomo Aug 08, 2010 at 05:10 UTC - 0 likes

    Unfortunately no, its not better. r11 is using much more CPU time than r10 did.

    Right now with just OptionHouse & LibQuestItem-1.0 (loaded via LOD through Option House) active, the library uses between 0.225-0.310 CPU/second on idle (averaging around 0.275).

  • Avatar of Nickenyfiken Nickenyfiken Aug 06, 2010 at 21:14 UTC - 0 likes

    Yeah I thought it could be helpful. Just need to set the APIs so it could be useful to any addon.

    I know what is causing the CPU usage.

    local total_elapsed = 0
    LibQuestItem.frame:SetScript("OnUpdate", function(self, elapsed)
    	total_elapsed = total_elapsed + elapsed
    	if total_elapsed < 1 then return end
    	total_elapsed = 0
    	if itemScanNeeded then
    		LibQuestItem:Scan()
    	end
    end)
    

    I've changed the code to have the frame hidden until a BAG_UPDATE event occurs. Then hide it again after the item scan. Please let me know if it is better now.

  • Avatar of Zidomo Zidomo Aug 05, 2010 at 13:43 UTC - 0 likes

    Nice idea. Various quest mods (other than yours) moving from their own methods to perhaps this library might take some effort, but still, nice idea :).

    One thing noticed so far that could use some improvement, though. Loading this alone (LOD), it uses 0.100-0.110 CPU/second when a character is idle. Not much, but its still the only library/library system I've seen lately besides Ace3 that uses CPU when idle.

Facts

Date created
Jul 30, 2010
Category
Last update
Sep 11, 2013
Development stage
Release
Language
  • enUS
License
MIT License
Curse link
LibQuestItem-1.0
Downloads
2,497
Recent files
  • R: 1.0.2.4 for 5.4.0 Sep 11, 2013
  • A: r34 for 5.4.0 Sep 11, 2013
  • R: 1.0.2.2 for 5.2.0 Mar 09, 2013
  • A: r32 for 5.2.0 Mar 09, 2013
  • R: 1.0.2.1 for 5.1.0 Dec 02, 2012

Authors

Relationships

Embedded library
CallbackHandler-1.0
LibStub