Ability numbers?

UI and Macro
In an old macro guide, I saw a reference to /castspellbyname, which it said had been replaced by /cast. But that got me wondering whether it was possilbe to use abilities by number (just like you can use items by numbers). If so, how would I find out which ability has which number?

Any ideas whether this can be done? If possible, this would make it a lot easier to fit more options into a macro.
It's not possible with the default UI, but it is through a small AddOn that takes a list of spellIDs and creates an invisible secure button for each one, allowing you to use /click spell116 to cast the spell with ID 116 (Frostbolt).

To find the spellID of a spell, just look it up on Wowhead. The spellID is the number at the end of the URL.

To make the AddOn, copy/paste the code blocks below into their own empty text documents and save them with the specified name/extension (capitalisation is important). Make sure you don't save them as .txt files. Once you have both files, move them to a new folder called SpellIDButtons in your Interface\AddOns\ folder.

SpellIDButtons.toc## Interface: 50001
## Title: SpellID Buttons
## Version: 1.01
## Author: Choonster
## Notes: Allows you to cast spells by their spellID using /click spellXXX (where XXX is the spellID). Add spells at the top of core.lua

core.lua


core.lualocal SPELL_IDS = {
-- Put your spellIDs below this line

116, -- Frostbolt
133, -- Fireball
30451, -- Arcane Blast
35395, -- Crusader Strike

-- All spellIDs must go above this line
}

-------------------
-- END OF CONFIG --
-------------------
-- Do not change anything below here!

for i = 1, #SPELL_IDS do
local spellID = SPELL_IDS[i]
local button = CreateFrame("Button", "spell" .. spellID, nil, "SecureActionButtonTemplate")
button:SetAttribute("type", "spell")
button:SetAttribute("spell", spellID)
end
Does that still allow all the conditionals? For example:
/click [mod:ctrl, @focus, harm] spell116; [mod:shift] spell133; spell30451

Thanks. That seems like a very workable solution to a macro I want to create.
Does that still allow all the conditionals? For example:
/click [mod:ctrl, @focus, harm] spell116; [mod:shift] spell133; spell30451

Thanks. That seems like a very workable solution to a macro I want to create.

Yes, almost every secure command (e.g. /cast, /click, /target) accepts conditionals.
This still works for regular spells as of this post,
but
does NOT work for mounts.
IS there any way to cast a mount by mount ID?
Mounts names are so damn long.

/click spell586
casts priest fade spell just fine, but
/click spell113199
fails to cast jade cloud serpent.

FYI, you can add new spells to the list without actually
having to quit the game, just save and /reload the UI.
This still works for regular spells as of this post,
but
does NOT work for mounts.
IS there any way to cast a mount by mount ID?
Mounts names are so damn long.

/click spell586
casts priest fade spell just fine, but
/click spell113199
fails to cast jade cloud serpent.

FYI, you can add new spells to the list without actually
having to quit the game, just save and /reload the UI.


/run CallCompanion("MOUNT", index)

where index is the order it appears in your mount journal - 1 up to GetNumCompanions("MOUNT")
Does this work?/run CastSpellByID(113199)

Join the Conversation

Return to Forum