WoW:API GetMacroIndexByName: Difference between revisions
Jump to navigation
Jump to search
(upgraded deprecated template) |
m (Move page script moved page API GetMacroIndexByName to API GetMacroIndexByName without leaving a redirect) |
||
| (3 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{wowapi}} | {{wowapi}} | ||
Return | Return macro index for a given name. | ||
macroIndex = GetMacroIndexByName("name") | |||
== Arguments == | == Arguments == | ||
:;"name": String - The name of macro | :;"name" : String - The name of a macro as obtainable by GetActionText(slot) | ||
== Returns == | == Returns == | ||
:; | :;macroIndex : The numeric index of the macro or 0 if there's no macro with the given name. | ||
:The | |||
== Notes == | == Notes == | ||
:If there | :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 == | == Example == | ||
local | local macroIndex = GetMacroIndexByName("Fred") | ||
if macroIndex == 0 then | |||
-- You have no macro named "Fred" | |||
end | |||
Latest revision as of 04:46, 15 August 2023
← 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