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 Wrath-Logo-Small.png Dragonflight WoW Icon update.png Wrath-Logo-Small.png Dragonflight
Backpack 0
nil
Bag 1 1
31
20
31
Bag 2 2
32
21
32
Bag 3 3
33
22
33
Bag 4 4
34
23
34
Reagent bag N/A 5
N/A
35
Bank bag 1 5 6
88
76
92
Bank bag 2 6 7
89
77
93
Bank bag 3 7 8
90
78
94
Bank bag 4 8 9
91
79
95
Bank bag 5 9 10
92
80
96
Bank bag 6 10 11
93
81
97
Bank bag 7 N/A 11 12
N/A
82
98
Bank -1
nil
Keyring -2
nil
Reagent bank -3
nil
Bank bags -4
nil