WoW API: GetInventoryItemLink

Revision as of 04:46, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page API GetInventoryItemLink to API GetInventoryItemLink without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

WoW API < GetInventoryItemLink

Get the itemLink for the specified item.

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

ArgumentsEdit

("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().

ReturnsEdit

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

ExampleEdit

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".