On a second pass (even much later) it never had a chance to "end" the spell. So you're hitting it again to tell the macro that it's done casting.
For instance:
00:00 - macro hit. sA=nil, sT=current time, eT=3 secs from now, spell cast
00:01 - macro hit. sA=true, skip cast, eT>current time, skip =nil
00:08 - macro hit. sA=true, skip cast, eT<current time, sA=nil
00:09 - macro hit. sa=nil, sT=current time, etc
You can fix this by putting the check to see if the spell finished before the cast. Move the if eT<=time() etc end to the start of the line, and insert the bits in bold.
/script cS, W = "Arcane Missiles(Rank 7)", 3
/script --CastSpellByName("Arcane Missiles(Rank 7)")
/script if eT and eT<=time() then sA=nil eT=nil end if sA==nil then sT=time() eT=time()+W CastSpellByName(cS) sA=true end
(It was hitting 256-character limit so removed ;'s which are optional and removed spaces around ='s)
A simpler macro to do the same thing is:
/script if not CastingBarFrame.channeling then CastSpellByName("Arcane Missiles(Rank 7)") end
The value CastingBarFrame.channeling = 1 while you're channeling, nil otherwise.
|