WoW:API ContainerIDToInventoryID: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 4: Line 4:
;''Arguments''
;''Arguments''
:;:(bagID)
:;:(bagID)
:::;bagID : [[API TYPE bagID|bagID]] - number of the bag (1-11) to get the inventoryID for.
:::;bagID : [[API TYPE bagID|bagID]] - number of the bag (0-11) to get the inventoryID for.


Note: After TBC Closed Beta patch v2.0.3.6299 (8th Jan 2007), inputs outside the range of 1-11 (1-4 for bags, and 5-11 for bank) now throw "invalid container ID" errors.
Note: After TBC Closed Beta patch v2.0.3.6299 (8th Jan 2007), inputs outside the range of 0-11 (0-4 for bags, and 5-11 for bank) now throw "invalid container ID" errors.


----
----

Revision as of 04:04, 1 May 2007

WoW API < ContainerIDToInventoryID

ContainerIDToInventoryID -Documentation by Luke1410-

Arguments
(bagID)
bagID
bagID - number of the bag (0-11) to get the inventoryID for.

Note: After TBC Closed Beta patch v2.0.3.6299 (8th Jan 2007), inputs outside the range of 0-11 (0-4 for bags, and 5-11 for bank) now throw "invalid container ID" errors.


Returns
inventoryID
inventoryID - the bag's inventory ID used in functions like PutItemInBag(inventoryId) and GetInventoryItemLink("player",inventoryId)

Examples
local invID = ContainerIDToInventoryID(1)  
DEFAULT_CHAT_FRAME:AddMessage("Bag slot 1 is inventory slot "..invID)

Result
Bag slot 1 is inventory slot 20

Notes
The return of container IDs -2 (key ring), -1 (bank) and 0 (backpack) aren't actual Inventory slots usable by most Inventory functions.
The player bags begin at container 1 and inventory 20.
The bank bags begin at container 5 and inventory 68.