WoW:API GetInventoryItemLink: Difference between revisions

m
Move page script moved page API GetInventoryItemLink to WoW:API GetInventoryItemLink without leaving a redirect
m (Move page script moved page API GetInventoryItemLink to WoW:API GetInventoryItemLink without leaving a redirect)
 
(12 intermediate revisions by 12 users not shown)
Line 1: Line 1:
<center>'''GetInventoryItemLink''' - ''Documentation by [[User:Flickering|Flickering]]''</center>
{{wowapi}} __NOTOC__


Get a link string for the specified item.
Get the [[itemLink]] for the specified item.
"itemLink" = GetInventoryItemLink("unit", slotId)


link = GetInventoryItemLink("unit", slotId)
== Arguments ==
== Parameters ==
=== Arguments ===
:("unit", slotId)
:("unit", slotId)


:;unit : String - The [[API TYPE UnitId|UnitId]] of the unit whose inventory is to be queried.
:;"unit" : [[UnitId]] - A string representing the unit whose inventory is to be queried.
:;slotId : Numeric - The [[API TYPE InventorySlotID|inventory slot]] to be queried, obtained via [[API GetInventorySlotInfo|GetInventorySlotInfo]].
:;slotId : [[InventorySlotId]] - The inventory slot to be queried, obtained via [[API GetInventorySlotInfo|GetInventorySlotInfo()]].


=== Returns ===
== Returns ==
:link
;"itemLink" : [[itemLink]]- The item link for the specified item or
:nil, if the slot is empty.


:;link : String - The link string for the specified item, or nil if the slot is empty.
== Example ==
----
 
__NOTOC__
local mainHandLink = GetInventoryItemLink("player",GetInventorySlotInfo("MainHandSlot"))
{{Template:WoW API}}
local _, _, _, _, _, _, itemType = GetItemInfo(mainHandLink)
[[Category:API Functions|GetInventoryItemLink]]
DEFAULT_CHAT_FRAME:AddMessage(itemType)
[[Category:API Inventory Functions|GetInventoryItemLink]]
 
[[Category:API Item Functions|GetInventoryItemLink]]
<big>'''Result'''</big>
:Prints the subtype of the mainhand weapon - for example "Mace" or "Sword".
Anonymous user