Returns information about an inventory slot
See also Inventory functions.
Signature:
id, texture, checkRelic = GetInventorySlotInfo("slotName")
Arguments:
slotName- Name of an inventory slot to query (string)AmmoSlot- Ranged ammunition slotBackSlot- Back (cloak) slotBag0Slot- Backpack slotBag1Slot- First bag slotBag2Slot- Second bag slotBag3Slot- Third bag slotChestSlot- Chest slotFeetSlot- Feet (boots) slotFinger0Slot- First finger (ring) slotFinger1Slot- Second finger (ring) slotHandsSlot- Hand (gloves) slotHeadSlot- Head (helmet) slotLegsSlot- Legs (pants) slotMainHandSlot- Main hand weapon slotNeckSlot- Necklace slotRangedSlot- Ranged weapon or relic slotSecondaryHandSlot- Off-hand (weapon, shield, or held item) slotShirtSlot- Shirt slotShoulderSlot- Shoulder slotTabardSlot- Tabard slotTrinket0Slot- First trinket slotTrinket1Slot- Second trinket slotWaistSlot- Waist (belt) slotWristSlot- Wrist (bracers) slot
Returns:
id- The numeric slotId usable in other Inventory functions (number, inventoryID)texture- The path to the texture to be displayed when this slot is empty (string)checkRelic- 1 if the slot might be the relic slot; otherwise nil. The ranged slot token is re-used for the relic slot; if this return is 1,UnitHasRelicSlotshould be used to determine how the slot should be displayed. (1nil)
Examples:
-- Get the inventory slot information for the Main Hand weapon slot
local slotId, texture, checkRelic = GetInventorySlotInfo("MainHandSlot")
-- These returns are used to draw and initialize the 'paper doll' system
-- but can also be used in the other inventory functions, as shown below
-- id = 16
-- texture = "interface\\paperdoll\\UI-PaperDoll-Slot-MainHand.blp"
-- checkRelic = nil
-- Get the numeric item id of the item in the MainHand slot. This id
-- will match the numeric id in the item's hyperlink, and should match
-- the ids used on wowhead and wowarmoury.
local itemId = GetInventoryItemID("player", slotId)
print("My head slot's item id is: ", itemId)
-- The item I had equipped was [Sun Strike], so the value of itemId is the
-- number 56101. You can see this on http://www.wowhead.com/item=56101/sun-strike
-- Now fetch the hyperlink for the item, so we can print it to our chat frame
local itemLink = GetInventoryItemLink("player", slotId)
print("The item link is: ", itemLink)
-- Your results will be slightly different, but the hyperlink for [Sun Strike]
-- was printed to my chat frame. If you'd like to see the actual string instead
-- of the hyperlink, you can 'escape' the `|` characters, using the following code.
-- This prevents WoW from seeing that the string is a 'hyperlink'.
print("The escaped link is: ", itemLink:gsub("|", "||"))
-- My result: |cff0070dd|Hitem:56101:0:0:0:0:0:0:0:0|h[Sun Strike]|h|r