WoW:API GetContainerItemInfo: Difference between revisions

Formatting. Original examples were relevant to LUA, not the function.
No edit summary
(Formatting. Original examples were relevant to LUA, not the function.)
Line 1: Line 1:
<center>'''GetContainerItemInfo''' ''-Documentation by [[user:Arvenis|Arvenis]]-''</center>
<center>'''GetContainerItemInfo''' ''-Documentation by [[user:Arvenis|Arvenis]]-''</center>
texture, itemCount, locked, quality, readable = GetContainerItemInfo(bagID, slot);
----
----
;''Arguments''
;''Arguments''
:;:(bagID,slot)
 
:::;[[API TYPE bagID|bagID]] : number - number of the bag the item is in, 0 is your backpack, 1-4 are the four additional bags
:;[[API TYPE bagID|bagID]] : number - number of the bag the item is in, 0 is your backpack, 1-4 are the four additional bags
:::;slot : number - slot number of the bag item you want the info for.
:;slot : number - slot number of the bag item you want the info for.


----
----
;''Returns''
;''Returns''


:;texture, itemCount, locked, quality, readable : texture - the texture for the item in the specified bag slot
:;texture : the texture for the item in the specified bag slot
:;;;: itemCount - the number of items in the specified bag slot
:;itemCount : the number of items in the specified bag slot
:;;;: locked - true if locked; that is, a stack that cannot be split
:;locked : true if locked; that is, a stack that cannot be split
:;;;: quality - the numeric quality of the item
:;quality : the numeric quality of the item
:;;;: readable - true if the item can be "read" (as in a book)
:;readable : true if the item can be "read" (as in a book)
----
----
;''Examples''
;''Examples''


  local texture, itemCount, locked, quality, readable = GetContainerItemInfo(1,2);
  local texture, itemCount, locked, quality, readable = GetContainerItemInfo(1,2);
 
DEFAULT_CHAT_FRAME:AddMessage(itemCount .. " stacked items in 2nd slot of bag 1.");
: If you are only interested in one of these values you can use the _ character to ignore one of them.
 
local _,itemCount,locked,quality,readable = GetContainerItemInfo(1,2);
 
: You can also omit variables if your only interested in the first few values.
local texture,itemCount = GetContainerItemInfo(1,2)
 
''See also:'' [[API_GetInventorySlotInfo|GetInventorySlotInfo]] to get the same information from a player's inventory (or equipped items).


----
----