WoW:API GetInventorySlotInfo: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Correct documentation.)
Line 1: Line 1:
<center>'''GetInventorySlotInfo''' ''-Documentation by [[user:Arvenis|Arvenis]]-''</center>
<center>'''GetInventorySlotInfo''' - ''Documentation by [[User:Flickering|Flickering]]''</center>
----
;''Arguments''
 
'''This is incorrect!!''' Please see line 90 of the PaperDollFrame.lua file within the default interface code.
eg id, textureName = GetInventorySlotInfo("HEADSLOT");
 
:;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:
Return information about a specific inventory slot
# Head
# Neck
# Shoulders
# Shirt
# Chest
# Waist
# Legs
# Feet
# Wrists
# Hands
# Finger 1
# Finger 2
# Trinket 1 ??
# Trinket 2 ??
# Back
# Main Hand
# Off Hand
# Ranged
# Tabard ??
# Bag (4th from left)
# Bag (3rd from left)
# Bag (2nd from left)
# 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:'' [[API_GetContainerItemInfo|GetContainerItemInfo]] to get the same information from any of the player's 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.
slotId, textureName = GetInventorySlotInfo("slotName")
== Parameters ==
=== Arguments ===
:("slotName")


: 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).
:;slotName : String - The [[API TYPE InventorySlotName|InventorySlotName]] to query ("HEADSLOT", etc).
=== Returns ===
:slotId, textureName


: 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.
:;slotId : Numeric - The slot ID to use to refer to that slot in the other GetInventory functions.
:;textureName : String - The texture to use for the empty slot on the paper doll display.


== Details ==
: Thanks to [[User:Sij|Sij]] for pointing out the original Wiki page was incorrect.


----
----
__NOTOC__
{{Template:WoW API}}
{{Template:WoW API}}
[[Category:API Inventory Functions|GetInventorySlotInfo]]
[[Category:API Inventory Functions|GetInventorySlotInfo]]

Revision as of 20:53, 10 April 2005

GetInventorySlotInfo - Documentation by Flickering

Return information about a specific inventory slot

slotId, textureName = GetInventorySlotInfo("slotName")

Parameters

Arguments

("slotName")
slotName
String - The InventorySlotName to query ("HEADSLOT", etc).

Returns

slotId, textureName
slotId
Numeric - The slot ID to use to refer to that slot in the other GetInventory functions.
textureName
String - The texture to use for the empty slot on the paper doll display.

Details

Thanks to Sij for pointing out the original Wiki page was incorrect.

Template:WoW API