WoW:API GetLootSlotLink: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(name,itemid, enchant, subid)
 
m (Move page script moved page API GetLootSlotLink to API GetLootSlotLink without leaving a redirect)
 
(7 intermediate revisions by 7 users not shown)
Line 1: Line 1:
return loot slot items link and tooltip
{{wowapi}}
    for index = 1, GetNumLootItems(), 1 do
Retrieves the [[itemLink]] of one item in the current loot window.
 
"itemLink" = GetLootSlotLink(index)
 
== Argument ==
:(index)
:;index : Number - The index of the item in the list to retrieve info from (1 to GetNumLootItems())
 
== Returns ==
;"itemLink" : [[itemLink]] - The itemLink for the specified item or
:: nil, if index is invalid or if the slot contains money.
 
== Example ==
The example below will display the item links into your chat window.
 
  local linkstext
  for index = 1, GetNumLootItems() do
       if (LootSlotIsItem(index)) then
       if (LootSlotIsItem(index)) then
         local iteminfo = GetLootSlotLink(index);
         local iteminfo = GetLootSlotLink(index);
         akz_AddFishLoot(GetMinimapZoneText(), itemid);
         if linkstext == nil then
          linkstext = iteminfo
        else
          linkstext = linkstext..iteminfo
        end
       end
       end
     end  
     end
iteminfo is info of items include name,itemid, enchant, subid
    DEFAULT_CHAT_FRAME:AddMessage(linkstext)

Latest revision as of 04:46, 15 August 2023

WoW API < GetLootSlotLink

Retrieves the itemLink of one item in the current loot window.

"itemLink" = GetLootSlotLink(index)

Argument[edit]

(index)
index
Number - The index of the item in the list to retrieve info from (1 to GetNumLootItems())

Returns[edit]

"itemLink"
itemLink - The itemLink for the specified item or
nil, if index is invalid or if the slot contains money.

Example[edit]

The example below will display the item links into your chat window.

  local linkstext
  for index = 1, GetNumLootItems() do
     if (LootSlotIsItem(index)) then
       local iteminfo = GetLootSlotLink(index);
       if linkstext == nil then
          linkstext = iteminfo
       else
          linkstext = linkstext..iteminfo
       end
     end
   end
   DEFAULT_CHAT_FRAME:AddMessage(linkstext)