GetMacroSpell
Jump to navigation
Jump to search
Returns information about the spell a given macro is set to cast.
id = GetMacroSpell(slot or macroName)
Arguments
The sole argument has two forms:
- slot
- number - The macro slot to query.
- macroName
- string - The name of the macro to query.
Returns
- id
- number - The ability's spellId.
Details
- Action-bar addons use this function to display dynamic macro icons, tooltips and glow effects. As a macro's cast sequence changes, this function indicates which will be cast next.
Example
local macroName = "MyMacro"
local index = GetMacroIndexByName(macroName)
if index then
local spellId = GetMacroSpell(index)
if spellId then
print(macroName .. " will now cast " .. GetSpellLink(spellId))
end
end
Patch changes
Patch 8.0.1 (2018-07-17): Removed original two return values, name and rank.[1][2]
Patch 4.3.0 (2011-11-29): Added third return value, id.[3]
Patch 2.3.0 (2007-11-13): Added.[4]
References
- ^ Aerythlea 2018-11-14. Battle for Azeroth Addon Changes.
- ^ 2018-07-16, ActionButton.lua, version 8.0.1.27101, near line 643, archived at Townlong-Yak
- ^ 2011-11-15, ActionButton.lua, version 4.3.0.15005, near line 414, archived at Townlong-Yak
- ^ slouken 2007-08-27. Re: Upcoming 2.3 Changes - Concise List. Archived from the original