I'm trying to come up with a good and solid method for verifying if a spell exists for macro purposes. I can do this method:
Code:
function Spellname()
GetSpellName(1, BOOKTYPE_SPELL);
if GetSpellName(1, BOOKTYPE_SPELL) == "Attack" then
return true;
else
return false;
end
end
I want to use the Spellname function to check each spellname at specific casting steps per character class/level.
For Example, a level 1-9 Hunter would be able to cast level appropriate spells, and if they leveled up without attaining new spells they would then still be able to use the spells that existed, rather than using a spellcheck step that relies solely on the character level alone.
The only problem with this is that depending on the build and talents, some spellbooks may vary in what spells lie in what slots. Is there a more reliable way to check to see if a specific spell exists?
The ultimate purpose is never having to edit your macros when you attain a new spell and level. At the moment I am using purely character class/level based checks, but they are lacking due to the fact when I hit the next Spell Upgrade level, I'm unable to cast the spells I've not yet bought and have to edit the macro to the current spells that are actually in the spellbook. The macros I use are scripted as functions in an addon and only the function name is then used as the cast in the Macro UI button.