Thread Tools Display Modes
12/19/16, 04:01 PM   #1
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
Bag ID

How do the bag IDs work?

I understood these:
BAG_BACKPACK - shows items in that toon's bag.
BAG_BANK - shows items in the bank.
BAG_WORN - shows items that toon is wearing.

But didn't know what to do with these:
BAG_BUYBACK - I assumed this would show items that can be bought back but I don't know how to make it work.
BAG_GUILDBANK - I assumd this would show items in the guild bank, but I don't know how you'd choose which guild or how to make it work. I tried opening the guild bank while using it but that didn't work.
BAG_VIRTUAL - Not sure what this does.

Bonus question: what is the craft bag considered and how is its data accessed?
  Reply With Quote
12/19/16, 06:19 PM   #2
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 408
BAG_VIRTUAL is the craft bag. You can use the following to find items in it. Note that data is a table for the item. data.name will be the name of it, data.slotIndex is where to find it. If you need something else, do some output in chat.
if SHARED_INVENTORY.bagCache[BAG_VIRTUAL] then
for index, data in pairs(SHARED_INVENTORY.bagCache[BAG_VIRTUAL])do
if isItemYouWant(data) then
return BAG_VIRTUAL, data.slotIndex
end
end
end


The guildbank and buyback ones I'm not sure about. You may want to try going to a merchant for the buyback one, and possibly opening the buyback tab.
  Reply With Quote
12/19/16, 06:47 PM   #3
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
I had wondered (but I don't have the craft bag so I couldn't test it), so thanks!
  Reply With Quote
12/23/16, 07:23 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,962
BAG_GUILDBANK is the bag for the stuff stored in your guildbank.
To access the different guildbanks you need to select one.
If I remember right BAG_GUILDBANK will only be there if you are talking to a bank NPC and the guild bank is opened.

BAG_BUYBACK si teh "buy back" bag at the vendor.
If I remember right it's accessible only if you talk to a vendor. It'll update with the last sold items until you logout.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Bag ID

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off