Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
No edit summary
mNo edit summary
Line 17: Line 17:
 
local texture, itemCount = GetInventorySlotInfo(2);
 
local texture, itemCount = GetInventorySlotInfo(2);
   
: If you only want the itemCount you can use the _ character to ignore the texture or the itemCount.
+
: If you are only interested in one of these values you can use the _ character to ignore the texture or the itemCount.
   
 
local _,itemCount = GetInventorySlotInfo(2);
 
local _,itemCount = GetInventorySlotInfo(2);

Revision as of 16:16, 24 February 2005

GetInventorySlotInfo -Documentation by Arvenis-

Arguments
slot
number - slot number of the Inventory item you want the info for.

Returns
texture, itemCount
texture - the texture for the item in the specified slot
itemCount - the number of items in the specified slot

Examples
You'll need 2 variables in order to use the function.
local texture, itemCount = GetInventorySlotInfo(2);
If you are only interested in one of these values you can use the _ character to ignore the texture or the itemCount.
local _,itemCount = GetInventorySlotInfo(2);
local texture,_ = GetInventorySlotInfo(2);

Result
The texture variable will contain the item's texture and the itemCount variable will contain the number of that item in the slot.

Template:WoW API