WoW API: GetContainerItemInfo

From AddOn Studio
Revision as of 14:34, 13 August 2006 by WoWWiki>Mikk (Formatting)
Jump to navigation Jump to search

WoW API < GetContainerItemInfo

texture, itemCount, locked, quality, readable = GetContainerItemInfo(bagID, slot);

Parameters

Arguments

bagID
Number - number of the bag the item is in, e.g. 0 for your backpack
slot
Number - slot number of the bag item you want the info for.

Returns

texture
String - the texture for the item in the specified bag slot
itemCount
Number - the number of items in the specified bag slot
locked
Boolean - 1 if locked; that is, a stack that cannot be split (?)
quality
Number - the numeric quality of the item
readable
[[Boolean - 1 if the item can be "read" (as in a book)

Example

local texture, itemCount, locked, quality, readable = GetContainerItemInfo(1,2);
DEFAULT_CHAT_FRAME:AddMessage(itemCount .. " stacked items in 2nd slot of bag 1.");

Result

The texture variable will contain the item's texture and the itemCount variable will contain the number of that item in the slot.
The quality return value does not appear to directly correspond with the color used to display the item name. In addition, it only appears to be defined for equipment (as opposed to trade items). (?)
The readable return value simply indicates if there is text related to the item. If it's true, the default UI will change the cursor to the "Read" cursor (the magnifying glass) when the mouse is over the item button.
The locked return value appears to be set to true only on an item that is picked up via PickupContainerItem.