So as some of you may know, I got a way of using protected LUA functions freely once again, which works exactly like LuaNinja, and decided to try it out on my mage. However, I'm getting a problem concerning with the delay between when scorch leaves your hands and the improved scorch debuff shows up on the enemy. Here's what I got so far.
The priority is basically Living bomb if you're solo or fighting another player or in a dungeon and enemy HP is more than 45k or in a raid and enemy HP is more than 125k since theres no point bombing something if it can't explode, then check for Hot streak for Pyroblast, then Scorch only if Winter's Chill, Shadow Mastery is not present or Scorch is either not present or has 4 seconds of duration left, and finally Fireball spam if it can't do anything else.Code:#showtooltip Pyroblast /startattack /use 13 /use 14 /run i=1 k={GetInstanceInfo()} while(i<=40)do a={UnitDebuff("target",i)} if(a[1]=="Living Bomb" and a[8]=="player")then break elseif(i==40) and ((k[2]=="none" or UnitIsPlayer("target")) or (k[2]=="party" and UnitHealth("target")>=45000) or (k[2]=="raid" and UnitHealth("target")>=125000)) then CastSpellByName("Living Bomb") i=i+1 else i=i+1 end end /run c=CastSpellByName d=UnitDebuff t='target' s={d(t,"Improved Scorch")} if UnitBuff("player","Hot Streak") then c("Pyroblast") elseif not (d(t,"Shadow Mastery") or (d(t,"Improved Scorch") and s[7]-GetTime()>=4) or d(t,"Winter's Chill")) then c("Scorch") else c("Fireball") end
The problem is when spamming this, Scorch will usually get spammed 2-3 times before it progresses further in the code because of the lag between the finish of the cast and the application of the debuff. What can I add to this macro to prevent this? I will +rep for a successful solution to my problem. Something like a 3 second 'lockout' to casting Scorch when it successfully starts casting Scorch would work but I'm unsure how to implement this. Maybe something to do with CVar's but I'm unable to wrap my head around it.
edit: wow, nobody? Even though I've gotten like 15 PMs about what hack I'm using, nobody really knows anything about writing macros using LUA functions itself? /sigh. I got +2 or +3 rep to give, don't remember how much I can give now. It'll bring you that much closer to contrib/elite/whatever.