ContainerIDToInventoryID

From Warcraft Wiki
Jump to navigation Jump to search
inventoryID = ContainerIDToInventoryID(containerID)

Arguments

containerID
number - BagID between 1 and NUM_BAG_SLOTS + NUM_BANKBAGSLOTS

Returns

inventoryID
number - InventorySlotId used in functions like PutItemInBag() and GetInventoryItemLink()

Example

Prints all bag container IDs and their respective inventory IDs
(You need to be at the bank for bank inventory IDs to return valid results)

for i = 1, NUM_BAG_SLOTS + NUM_BANKBAGSLOTS do
    local invID = ContainerIDToInventoryID(i)
    print(i, invID, GetInventoryItemLink("player", invID))
end

Values

Description containerID inventoryID
WoW Icon update.png Cata-Logo-Small.png TheWarWithin-Petopia-Logo.png WoW Icon update.png Cata-Logo-Small.png TheWarWithin-Petopia-Logo.png
Backpack 0
nil
Bag 1 1
31
31
Bag 2 2
32
32
Bag 3 3
33
33
Bag 4 4
34
34
Reagent bag N/A 5
N/A
35
Bank bag 1 5 6
88
92
Bank bag 2 6 7
89
93
Bank bag 3 7 8
90
94
Bank bag 4 8 9
91
95
Bank bag 5 9 10
92
96
Bank bag 6 10 11
93
97
Bank bag 7 N/A 11 12
N/A
94
98
Warband bank tab 1 N/A 13
N/A
228
Warband bank tab 2 N/A 14
N/A
229
Warband bank tab 3 N/A 15
N/A
230
Warband bank tab 4 N/A 16
N/A
231
Warband bank tab 5 N/A 17
N/A
232
Bank -1
nil
Keyring -2
nil
Reagent bank -3
nil
Bank bags -4
nil
Warband bank tabs -5
nil