DerGhulbus14061@legacy41535029 (talk | contribs) |
Farmbuyer-gpuser (talk | contribs) (This function works for the ammo slot also.) |
||
(13 intermediate revisions by 11 users not shown) | |||
Line 1: | Line 1: | ||
⚫ | |||
− | <center>'''GetInventoryItemLink''' - ''Documentation by [[User:Flickering|Flickering]]''</center> |
||
− | Get |
+ | Get the [[itemLink]] for the specified item. |
⚫ | |||
⚫ | |||
⚫ | |||
− | == Parameters == |
||
⚫ | |||
:("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 |
||
− | :link |
||
+ | :nil, if the slot is empty. |
||
+ | == Example == |
||
− | :;link : String - The link string for the specified item, or nil if the slot is empty. |
||
+ | |||
− | ---- |
||
+ | local mainHandLink = GetInventoryItemLink("player",GetInventorySlotInfo("MainHandSlot")) |
||
⚫ | |||
+ | local _, _, _, _, _, _, itemType = GetItemInfo(mainHandLink) |
||
− | {{Template:WoW API}} |
||
+ | DEFAULT_CHAT_FRAME:AddMessage(itemType) |
||
− | [[Category:API Functions|GetInventoryItemLink]] |
||
+ | |||
− | [[Category:API Inventory Functions|GetInventoryItemLink]] |
||
+ | <big>'''Result'''</big> |
||
− | [[Category:API Item Functions|GetInventoryItemLink]] |
||
+ | :Prints the subtype of the mainhand weapon - for example "Mace" or "Sword". |
Revision as of 20:23, 1 April 2009
Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Get the itemLink for the specified item.
"itemLink" = GetInventoryItemLink("unit", slotId)
Arguments
- ("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
- "itemLink"
- itemLink- The item link for the specified item or
- nil, if the slot is empty.
Example
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".