LootSlotHasItem

From Warcraft Wiki
Jump to navigation Jump to search
Flavors
Links
Info
Added in 5.0.4 / 1.13.2

Returns whether a loot slot contains an item.

isLootItem = LootSlotHasItem(lootSlot)

Arguments

lootSlot
number - index of the loot slot, ascending from 1 to GetNumLootItems()

Returns

isLootItem
boolean - true if the loot slot contains an item rather than coin.

Example

Iterate through the items in the currently opened loot window an display them in the chat frame, side by side.

local itemLinkText
for i = 1, GetNumLootItems() do
    if (LootSlotHasItem(i)) then
         local iteminfo = GetLootSlotLink(i);
         if itemLinkText == nil then
              itemLinkText = iteminfo
         else
              itemLinkText = itemLinkText .. ", " .. iteminfo
         end
    end
end
print(itemLinkText)

Patch changes

Mists of Pandaria Patch 5.0.4 (2012-08-28): Renamed from LootSlotIsItem to LootSlotHasItem.