WoW:API GetMacroIndexByName: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
(→‎Notes: Updated with the new increased number of macros)
Line 14: Line 14:


== Notes ==
== Notes ==
:Macros are indexed 1-18 for "general" macros and 19-36 for character specific macros.
:Macros are indexed 1-36 for "global" macros and 37-54 for character-specific macros.
:If there is two or more macros with the same name, it appears to return the highest macroIndex found.
:If there is two or more macros with the same name, it appears to return the highest macroIndex found.


== Example ==
== Example ==

Revision as of 02:59, 14 December 2008

WoW API < GetMacroIndexByName

Return macro index for a given name.

macroIndex = GetMacroIndexByName("name")

Arguments

"name"
String - The name of a macro as obtainable by GetActionText(slot)

Returns

macroIndex
The numeric index of the macro or 0 if there's no macro with the given name.

Notes

Macros are indexed 1-36 for "global" macros and 37-54 for character-specific macros.
If there is two or more macros with the same name, it appears to return the highest macroIndex found.

Example

local macroIndex = GetMacroIndexByName("Fred")
if macroIndex == 0 then
  -- You have no macro named "Fred"
end