WoW:API GetMacroIndexByName: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
{{wowapi}}
{{wowapi}}


Return Macro Index For Given Name
Return macro index for a given name.


  Returns macroid = GetMacroIndexByName("name")
  macroIndex = GetMacroIndexByName("name")


== Arguments ==
== Arguments ==
:("name")


:;"name": String - The name of macro As Obtainable By GetActionText(slot)
:;"name" : String - The name of a macro as obtainable by GetActionText(slot)


== Returns ==
== Returns ==


:;MacroID
:;macroIndex : The numeric index of the macro or 0 if there's no macro with the given name.
 
:The Numeric Index of the macro


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




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





Revision as of 20:01, 20 March 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-18 for "general" macros and 19-36 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