Granom
11-05-2006, 05:48 PM
I've figured out that CastSpellByName returns some value that can be used like a boolean to determine whether the spell cast was successful or not, but I have a case where it seems more complicated than that.
In a macro I have something like...
if not CastSpellByName("Shred") then CastSpellByName("Claw") end
The intent here is to shred if I'm behind the target and have enough energy, else cast claw. It seems to work so long as I have less than 60 energy (the amount required for shred), whether I'm in front or behind the target, the macro casts claw. However, if I have 60 or more energy and am in front of the target, I get an failure message--something like "Must be behind the target"--and claw does not get cast.
So it seems that CastSpellByName("Shred") fails if I don't have enough energy, but it succeeds if I have enough even though I'm not behind the target. Any explanations for what's happening here? Alternatively, is there any way to test if I'm behind my target?
In a macro I have something like...
if not CastSpellByName("Shred") then CastSpellByName("Claw") end
The intent here is to shred if I'm behind the target and have enough energy, else cast claw. It seems to work so long as I have less than 60 energy (the amount required for shred), whether I'm in front or behind the target, the macro casts claw. However, if I have 60 or more energy and am in front of the target, I get an failure message--something like "Must be behind the target"--and claw does not get cast.
So it seems that CastSpellByName("Shred") fails if I don't have enough energy, but it succeeds if I have enough even though I'm not behind the target. Any explanations for what's happening here? Alternatively, is there any way to test if I'm behind my target?