I would think of something like
CastSpellbyName ("Skillname")
wait x x= cooldown from the skill / global cooldown
CastSpellbyName ("Skillname")
wait x
....
Problem is - this is limited to a few iterations.
Therefor if the mob is dead - it will stop since there´s no target anymore
If the mob isn´t dead - it stops because of the limited iterations.
If you really want to do a skill "until the mob is dead"
You´ll need something like
- /run for i=1,999 do local d=UnitHealth("target") if d==0 then TargetUnit("") temp=1 break end CastSpellByName("Skillname") wait 1 end
Not sure if this works... just gave it 5min of thinking about it
This will do the same thing like above but 999 times with 1s wait (global cooldown? )
if you really want to do this forever (e.g. target has 100.000.000 HP and you make 1 dmg each) you would need
"i=1,0" (where i´m not sure if this isn´t deactivated) or just a really high number
can´t test this one right now since i´m not at home