API LootSlotHasItem

From Wowpedia
Jump to: navigation, search

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 history

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