BagID
Backpack, equipped bags, bank and its equipped bags, reagent bank and, most likely, any future containers all internally is just a "bag" that have a bagID and can be used with any function operating with bags (like GetContainerItemLink(bagID, slotID), PickupContainerItem(bagID, slotID)). They can be accessed directly with their numeric values, but it is better to always use named constants defined in FrameXML\Constants.lua to make future WoW updates less likely to break your code.
Current possibilities for bagID are:
Constant | Numeric | Description / Notes | Example/refernce file in FrameXML |
---|---|---|---|
BACKPACK_CONTAINER | 0 | The backpack - your intial 16 slots container that you can't change or delete. | ContainerFrame.lua |
BACKPACK_CONTAINER + 1 to NUM_BAG_SLOTS |
1 to 4 | The bags on the character (numbered right to left). | ContainerFrame.lua |
BANK_CONTAINER | -1 | Bank container. Your intial 28 slots container in the bank that you can't change or delete. | BankFrame.lua |
NUM_BAG_SLOTS + 1 to NUM_BAG_SLOTS + NUM_BANKBAGSLOTS |
5 to 11 | Bank bags. | BankFrame.lua |
REAGENTBANK_CONTAINER | -3 | Reagent Bank. A reagent-only bank introduced in WoD. | BankFrame.lua |
KEYRING_CONTAINER | -2 | Keyring. Removed and obsolete since 4.2.0, but remains in code and constants. Trying to use it seems to return equipped items instead. |
ContainerFrame.lua |
-4 | A 7 slots "container" that holds your bank bags themselves. | BankFrame.lua |