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.

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 EduardCurse EduardCurse May 21, 2016 at 13:10 UTC - 1 like

    Another patch for Legion as I discover now item link is compressed (zeros between : are omited) now. I did make dirty hack, because actual links are in Legion more complicated with far more fields.

    local PATTERN_itemid = "item:(%-?%d+).+"

    at line 42. Actually this works on 6.2.4 as well, because this library needs only itemID parsed and rest arguments can be safely dropped off.

    Last edited May 21, 2016 by EduardCurse
  • Avatar of EduardCurse EduardCurse May 15, 2016 at 09:52 UTC - 1 like

    Patch for Legion. Function GetAuctionItemClasses() was removed, new function is introduced.

    local LOCALE_QUEST = ((_G.GetItemClassInfo == nil) and select(10, GetAuctionItemClasses())) or _G.GetItemClassInfo(LE_ITEM_CLASS_QUESTITEM) or "Quest"

    above patch works in curent live 6.2.x version as well in 7.0.x version. BTW in actual release is error, because category in GetAuctionItemClasses() should not be 12, but 10 for "Quest". This library actually in 6.2.x works only on US and GB clients. After this fix it works on any client as well.

    Last edited May 15, 2016 by EduardCurse
  • Avatar of EduardCurse EduardCurse Apr 13, 2015 at 06:21 UTC - 0 likes

    I would like to see extend this library to handle event QUEST_ACCEPTED. Reason behind it. Item starting quest after accepting it change his state, and this isn't reflected by events updating bags.

  • Avatar of Amaedeus Amaedeus Aug 29, 2012 at 03:12 UTC - 0 likes
  • Avatar of Endar0 Endar0 Feb 21, 2011 at 19:04 UTC - 0 likes

    I was looking at using this library for AutoPicker to identify quest items in the loot window. Would it be able to do that?

  • Avatar of Zidomo Zidomo Dec 13, 2010 at 00:21 UTC - 0 likes

    That's the same error from the same library version I posted about 3 months prior below. It was fixed in r18.

  • Avatar of Skylinee Skylinee Nov 28, 2010 at 19:59 UTC - 0 likes

    You maintaining this post cataclysm? If so:

    1x LibQuestItem-1.0-17:139: table index is nil LibQuestItem-1.0-17:194: in function `Scan' LibQuestItem-1.0-17:263: in function <...mKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:258>

    Locals: self = <table> { activeQuestItems = <table> {} callbacks = <table> {} PLAYER_ENTERING_WORLD = <function> @ QuestItemKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:276: StartsQuestId = <function> @ QuestItemKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:225: PLAYER_REGEN_ENABLED = <function> @ QuestItemKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:285: IsQuestActive = <function> @ QuestItemKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:229: UnregisterAllCallbacks = <function> @ Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:202: PLAYER_LEAVING_WORLD = <function> @ QuestItemKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:281: PLAYER_REGEN_DISABLED = <function> @ QuestItemKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:289: ITEMS_UPDATED = <function> @ QuestItemKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:271: startsQuestItems = <table> {} GetItemString = <function> @ QuestItemKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:213: Scan = <function> @ QuestItemKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:180: IsUsable = <function> @ QuestItemKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:221: questItems = <table> {} UnregisterCallback = <function> @ Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:181: RegisterCallback = <function> @ Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:118: usableQuestItems = <table> {} frame = LibQuestItem10Frame {} IsQuestItem = <function> @ QuestItemKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:217: questItemSpells = <table> {} } questItems = <table> { 57755 = true 1357 = true } usableQuestItems = <table> { 1357 = true } startsQuestItems = <table> { } activeQuestItems = <table> { } questItemSpells = <table> { } ScanInventory = <function> @ QuestItemKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:149: ScanBags = <function> @ QuestItemKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:125: ScanQuestLog = <function> @ QuestItemKeybound\Libs\LibQuestItem-1.0\LibQuestItem-1.0.lua:159: callbacks = <table> { recurse = 0 events = <table> {} Fire = <function> @ Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:87: }


  • Avatar of Zidomo Zidomo Aug 18, 2010 at 06:03 UTC - 0 likes

    Solid...but just experienced the first bug/error with r17.

    LibQuestItem-1.0 r17 (upgraded from r14), QuestItemBar v0.6, USEnglish client/server, WoW 3.3.5a live, Ace3 disembedded, all other libraries (including LibQuestItem) embedded. Sometime when doing quests in Colderra, the following error occurred:

    ["message"] = {
    				"LibQuestItem-1.0-17:139: table index is nil\nLibQuestItem-1.0-17:194: in function `Scan'\nLibQuestItem-1.0-17:263: in function <...stItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0.lua:258>\n\nLocals:|r\nself = <table> {\n activeQuestItems = <table> {\n }\n callbacks = <table> {\n }\n PLAYER_ENTERING_WORLD = <function> defined @Interface\\AddOns\\QuestItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0.lua:276\n StartsQuestId = <function> defined @Interface\\AddOns\\QuestItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0.lua:225\n PLAYER_REGEN_ENABLED = <function> defined @Interface\\AddOns\\QuestItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0.lua:285\n IsQuestActive = <function> defined @Interface\\AddOns\\QuestItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0.lua:229\n UnregisterAllCallbacks = <function> defined @Interface\\AddOns\\AddonLoader\\CallbackHandler-1.0\\CallbackHandler-1.0.lua:202\n PLAYER_LEAVING_WORLD = <function> defined @Interface\\AddOns\\QuestItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0", -- [1]
    				".lua:281\n PLAYER_REGEN_DISABLED = <function> defined @Interface\\AddOns\\QuestItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0.lua:289\n ITEMS_UPDATED = <function> defined @Interface\\AddOns\\QuestItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0.lua:271\n startsQuestItems = <table> {\n }\n GetItemString = <function> defined @Interface\\AddOns\\QuestItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0.lua:213\n Scan = <function> defined @Interface\\AddOns\\QuestItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0.lua:180\n IsUsable = <function> defined @Interface\\AddOns\\QuestItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0.lua:221\n questItems = <table> {\n }\n UnregisterCallback = <function> defined @Interface\\AddOns\\AddonLoader\\CallbackHandler-1.0\\CallbackHandler-1.0.lua:181\n RegisterCallback = <function> defined @Interface\\AddOns\\AddonLoader\\CallbackHandler-1.0\\CallbackHandler-1.0.lua:118\n usableQuestItems = <table> {\n }\n frame = LibQuestItem10Frame {\n }\n IsQuestItem = <function> defined @Interface", -- [2]
    				"\\AddOns\\QuestItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0.lua:217\n questItemSpells = <table> {\n }\n}\nquestItems = <table> {\n 35648 = true\n}\nusableQuestItems = <table> {\n 35648 = true\n}\nstartsQuestItems = <table> {\n}\nactiveQuestItems = <table> {\n}\nquestItemSpells = <table> {\n}\nScanInventory = <function> defined @Interface\\AddOns\\QuestItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0.lua:149\nScanBags = <function> defined @Interface\\AddOns\\QuestItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0.lua:125\nScanQuestLog = <function> defined @Interface\\AddOns\\QuestItemBar\\Libs\\LibQuestItem-1.0\\LibQuestItem-1.0.lua:159\ncallbacks = <table> {\n recurse = 0\n events = <table> {\n }\n Fire = <function> defined @Interface\\AddOns\\AddonLoader\\CallbackHandler-1.0\\CallbackHandler-1.0.lua:87\n}\n\n  ---", -- [3]
    			["type"] = "error",
    			["session"] = 908,
    			["counter"] = 7,
    		}, -- [254]

    There was a span of about 10 minutes between when the error happened (and repeated 7 times) and when I noticed the BugSack LDB display, so can't be certain what triggered the error.

    May have occurred when picking up quest item drops off mobs for a certain get up to 5 copies of the same item (shows them stacked in QuestItemBar) to be "used on" other items. Or it came from a quest item that could "summon" a friendly NPC when used (its only usage). Will link the quests later if it will help debug.

    As to CPU usage, in addition to r45 of QuestItemBar using 0 CPU/second when idle, the following similar mod also uses 0 on idle: QuestClicks.

    Thanks very much for replies and hope you get this working perfectly soon :D.

    Last edited Aug 18, 2010 by Zidomo
  • Avatar of Nickenyfiken Nickenyfiken Aug 16, 2010 at 23:27 UTC - 0 likes

    The lib should be pretty solid now. It spikes a bit when scanning for items but it's not that bad i think. It should never ever make a scan during combat. It is listening to the BAG_UPDATE event which fires if you loot during combat, but it will only set a var to true to indicate a update is needed. Then on PLAYER_REGEN_ENABLED the OnUpdate frame is shown and will initiate a update if needed, then it will be hidden again.

    Parties should not be a problem, BAG_UPDATE is only firing for the player itself as far as i know.

    Revision number is fixed.

    Mmm yeah I have to dissect QuestItemBar as it seems to be using CPU for me unknown reasons. Though it should not do anything except when the lib fires its its item update callback and some cooldown updates on the buttons when a ACTIONBAR_UPDATE_COOLDOWN fires.

  • Avatar of Zidomo Zidomo Aug 12, 2010 at 21:09 UTC - 0 likes

    (Removes all bridges from surrounding area) :D

    Finally, with r14 this library uses 0 CPU when idle. Nice work. Had to switch to testing with the following mods to see what CPU was used on looting, as OptionHouse closes when you loot: AddonProfiler & AddonManager (both more inconvenient to see ongoing CPU, though).

    It does spike a bit when you loot, but nomoreso than other mods that update on bag content changes. And appears to spike to substantially lower heights than QuestItemBar r45 does itself + through Ace3 when you loot something.

    The big thing will be to see if it actually causes lag when looting in parties. Which is a potential hazard when doing OnUpdates non-optimally (and I've seen testing another mod called Broker Garbage before it was recoded).

    Looking better so far, though.

    EDIT: one small thing, the library revision number (14 currently) isn't seen in its LUA file as it should be, even though you have a revision line at the top.

    EDIT#2: one bigger thing: tested QuestItemBar v0.6-beta1 with this library embedded (Ace3 still disembedded). For some reason, the mod appears to use a small amount of CPU in combat (0.01 in AddonProfiler when not looting) with a larger than expected spike immediately after the end of combat for 2 ticks/seconds (0.15-0.25 in AddonProfiler and again, not looting). No quest items were on the bar or being used.

    The mod should shut totally off (in effect) during combat, other than letting you click quest items that may be on the bar. That increased use immediately after combat is over for 2 seconds seems odd if nothing in your packs or the bar has changed.

    Last edited Aug 12, 2010 by Zidomo


Date created
Jul 30, 2010
Last update
Oct 18, 2014
Development stage
  • enUS
MIT License
Curse link
Reverse relationships
Recent files
  • R: for 6.0.2 Oct 18, 2014
  • A: r37 for 6.0.2 Oct 18, 2014
  • R: for 5.4.0 Sep 11, 2013
  • A: r34 for 5.4.0 Sep 11, 2013
  • R: for 5.2.0 Mar 09, 2013



Embedded library