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 slot
    • BackSlot - Back (cloak) slot
    • Bag0Slot - Backpack slot
    • Bag1Slot - First bag slot
    • Bag2Slot - Second bag slot
    • Bag3Slot - Third bag slot
    • ChestSlot - Chest slot
    • FeetSlot - Feet (boots) slot
    • Finger0Slot - First finger (ring) slot
    • Finger1Slot - Second finger (ring) slot
    • HandsSlot - Hand (gloves) slot
    • HeadSlot - Head (helmet) slot
    • LegsSlot - Legs (pants) slot
    • MainHandSlot - Main hand weapon slot
    • NeckSlot - Necklace slot
    • RangedSlot - Ranged weapon or relic slot
    • SecondaryHandSlot - Off-hand (weapon, shield, or held item) slot
    • ShirtSlot - Shirt slot
    • ShoulderSlot - Shoulder slot
    • TabardSlot - Tabard slot
    • Trinket0Slot - First trinket slot
    • Trinket1Slot - Second trinket slot
    • WaistSlot - Waist (belt) slot
    • WristSlot - 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, UnitHasRelicSlot should 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