Wowpedia

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

READ MORE

Wowpedia
No edit summary
(updated page to reflect the added return values)
Line 33: Line 33:
 
;''Returns''
 
;''Returns''
   
:;texture, itemCount : texture - the texture for the item in the specified slot
+
:;texture, itemCount, locked, quality, readable : texture - the texture for the item in the specified bag slot
:;;;: itemCount - the number of items in the specified slot
+
:;;;: itemCount - the number of items in the specified bag slot
  +
:;;;: locked - true if locked; that is, a stack that cannot be split
  +
:;;;: quality - the numeric quality of the item
  +
:;;;: readable - true if the item can be "read" (as in a book)
 
----
 
----
 
;''Examples''
 
;''Examples''
   
local texture, itemCount = GetInventorySlotInfo(2);
+
local texture, itemCount, locked, quality, readable = GetInventorySlotInfo(2);
   
: If you are only interested in one of these values 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 one of them.
  +
 
local _,itemCount,locked,quality,readable = GetInventorySlotInfo(2);
  +
  +
: You can also omit variables if your only interested in the first few values.
 
local texture,itemCount = GetInventorySlotInfo(2)
   
local _,itemCount = GetInventorySlotInfo(2);
 
local texture,_ = GetInventorySlotInfo(2);
 
 
''See also:'' [[API_GetContainerItemInfo|GetContainerItemInfo]] to get the same information from a player's other bags.
 
''See also:'' [[API_GetContainerItemInfo|GetContainerItemInfo]] to get the same information from a player's other bags.
 
----
 
----

Revision as of 05:24, 6 March 2005

GetInventorySlotInfo -Documentation by Arvenis-

Arguments
slot
number - slot number of the Inventory item you want the info for.
A player's inventory includes all the items show in the character equipment screen. The inventory slot numbers start at one and work as follows:
  1. Head
  2. Neck
  3. Shoulders
  4. Shirt
  5. Chest
  6. Waist
  7. Legs
  8. Feet
  9. Wrists
  10. Hands
  11. Finger 1
  12. Finger 2
  13. Trinket 1 ??
  14. Trinket 2 ??
  15. Back
  16. Main Hand
  17. Off Hand
  18. Ranged
  19. Tabard ??
  20. Bag (4th from left)
  21. Bag (3rd from left)
  22. Bag (2nd from left)
  23. Bag (1st)

Returns
texture, itemCount, locked, quality, readable
texture - the texture for the item 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
quality - the numeric quality of the item
readable - true if the item can be "read" (as in a book)

Examples
local texture, itemCount, locked, quality, readable = GetInventorySlotInfo(2);
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 = GetInventorySlotInfo(2);
You can also omit variables if your only interested in the first few values.
local texture,itemCount = GetInventorySlotInfo(2)

See also: GetContainerItemInfo to get the same information from a player's other bags.


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