WoW:ActionSlot: Difference between revisions

30 bytes added ,  22 September 2006
m
Fixed reportActionButtons() example
(moved code for enumerating from the UnitName page)
m (Fixed reportActionButtons() example)
Line 29: Line 29:
This function will display the contents of each of the 120 action slots (skipping empty ones) in the default chat frame.  To use, type "/script reportActionButtions()".
This function will display the contents of each of the 120 action slots (skipping empty ones) in the default chat frame.  To use, type "/script reportActionButtions()".


function reportActionButtons()
<pre>
  for local lActionSlot = 1, 120 do
function reportActionButtons()
  local lActionText = GetActionText(lActionSlot)
local lActionSlot = 0;
  local lActionTexture = GetActionTexture(lActionSlot)
for lActionSlot = 1, 120 do
local lActionText = GetActionText(lActionSlot);
  if lActionTexture then
local lActionTexture = GetActionTexture(lActionSlot);
    local lMessage = "Slot " .. lActionSlot .. ": [" .. lActionTexture .. "]"
if lActionTexture then
local lMessage = "Slot " .. lActionSlot .. ": [" .. lActionTexture .. "]";
    if lActionText then lMessage = lMessage .. " \"" .. lActionText .. "\""
if lActionText then
lMessage = lMessage .. " \"" .. lActionText .. "\"";
    DEFAULT_CHAT_FRAME:AddMessage(lMessage)
end
  end
DEFAULT_CHAT_FRAME:AddMessage(lMessage);
  end
end
end
end
end
</pre>
Anonymous user