Wikia

WoWWiki

Changes: API GetInventoryItemLink

Edit

Back to page

(Returns)
(This function works for the ammo slot also.)
 
Line 12: Line 12:
 
== Returns ==
 
== Returns ==
 
;"itemLink" : [[itemLink]]- The item link for the specified item or
 
;"itemLink" : [[itemLink]]- The item link for the specified item or
:nil, if the slot is empty. Note that this function will always return nil for the ammo slot.
+
:nil, if the slot is empty.
   
 
== Example ==
 
== Example ==

Latest revision as of 20:23, April 1, 2009

WoW API < GetInventoryItemLink

Get the itemLink for the specified item.

"itemLink" = GetInventoryItemLink("unit", slotId)

Arguments Edit

("unit", slotId)
"unit" 
UnitId - A string representing the unit whose inventory is to be queried.
slotId 
InventorySlotId - The inventory slot to be queried, obtained via GetInventorySlotInfo().

Returns Edit

"itemLink" 
itemLink- The item link for the specified item or
nil, if the slot is empty.

Example Edit

local mainHandLink = GetInventoryItemLink("player",GetInventorySlotInfo("MainHandSlot"))
local _, _, _, _, _, _, itemType = GetItemInfo(mainHandLink)
DEFAULT_CHAT_FRAME:AddMessage(itemType)

Result

Prints the subtype of the mainhand weapon - for example "Mace" or "Sword".

Around Wikia's network

Random Wiki