Wikia

WoWWiki

Changes: API GetLootSlotLink

Edit

Back to page

(upgraded deprecated template)
 
Line 1: Line 1:
 
{{wowapi}}
 
{{wowapi}}
Returns loot slot items link for input into chat frames or any textual display.
+
Retrieves the [[itemLink]] of one item in the current loot window.
The example below will insert the items link into your chat text box while you're typing. Note, this obviously doesn't work with Macro's as they clear your chat buffer.
 
   
for index = 1, GetNumLootItems(), 1 do
+
"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.
  +
  +
== 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);
ChatFrameEditBox:Insert(iteminfo);
+
if linkstext == nil then
  +
linkstext = iteminfo
  +
else
  +
linkstext = linkstext..iteminfo
  +
end
 
end
 
end
 
end
 
end
  +
DEFAULT_CHAT_FRAME:AddMessage(linkstext)

Latest revision as of 07:28, June 21, 2008

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.

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)

Around Wikia's network

Random Wiki