WoW:API GetInventoryItemLink: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(→‎Example: Removed link cleaning for GetItemInfo, not needed anymore)
m (Kill "documentation by".)
Line 1: Line 1:
{{wowapi}}
{{wowapi}}
<center>'''GetInventoryItemLink''' - ''Documentation by [[User:Flickering|Flickering]]''</center>


Get a link string for the specified item.
Get a link string for the specified item.

Revision as of 12:19, 18 February 2007

WoW API < GetInventoryItemLink

Get a link string for the specified item.

link = GetInventoryItemLink("unit", slotId)

Parameters

Arguments

("unit", slotId)
unit
String - The UnitId of the unit whose inventory is to be queried.
slotId
Numeric - The inventory slot to be queried, obtained via GetInventorySlotInfo.

Returns

link
String - The link string for the specified item, or nil if the slot is empty.

Example

Code

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

Results

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