m
Move page script moved page API GetInventoryItemLink to WoW:API GetInventoryItemLink without leaving a redirect
m (Robot: Removing selflinks) |
m (Move page script moved page API GetInventoryItemLink to WoW:API GetInventoryItemLink without leaving a redirect) |
||
| (7 intermediate revisions by 7 users not shown) | |||
| Line 1: | Line 1: | ||
{{wowapi}} | {{wowapi}} __NOTOC__ | ||
Get | Get the [[itemLink]] for the specified item. | ||
"itemLink" = GetInventoryItemLink("unit", slotId) | |||
== Arguments == | |||
:("unit", slotId) | :("unit", slotId) | ||
:;unit : | :;"unit" : [[UnitId]] - A string representing the unit whose inventory is to be queried. | ||
:;slotId : | :;slotId : [[InventorySlotId]] - The inventory slot to be queried, obtained via [[API GetInventorySlotInfo|GetInventorySlotInfo()]]. | ||
== Returns == | |||
;"itemLink" : [[itemLink]]- The item link for the specified item or | |||
:nil, if the slot is empty. | |||
== Example == | == Example == | ||
local mainHandLink = GetInventoryItemLink("player",GetInventorySlotInfo("MainHandSlot")) | local mainHandLink = GetInventoryItemLink("player",GetInventorySlotInfo("MainHandSlot")) | ||
local _, | local _, _, _, _, _, _, itemType = GetItemInfo(mainHandLink) | ||
DEFAULT_CHAT_FRAME:AddMessage(itemType) | DEFAULT_CHAT_FRAME:AddMessage(itemType) | ||
<big>'''Result'''</big> | |||
:Prints the subtype of the mainhand weapon - for example "Mace" or "Sword". | |||
Prints the subtype of the mainhand weapon - for example "Mace" or "Sword". | |||