Originally Posted by
Viral Fly-by
Code:
/run if UnitAffectingCombat("player") then RunMacroText("/in 0.1 /run RunMacro(\"NAME_OF_YOUR_MACRO_HERE\")) end
Note that this isn't working for a lot of people...it works fine for me...but I personally find it very annoying and downright silly... You're using these macros because you can't be bothered to push multiple buttons in the right order at the right times....now you can't be bothered just to push 1 button over and over? LOL. But anyway it doesn't work for some because of problems with the /in command in their game. /shrug
You don't spend much time looking at the API do you? If you want to start moving forward, you call "MoveForwardStart()"... Well...amazing enough...to stop moving forward, you call "MoveForwardStop()". AMAZING!
Really, I'm not that big of a dumbass Viral.
I have tried the MoveForwardStop(), and it does in fact stop me... Although the /in command is not working for me, and neither does the MoveForwardStop(GetTime()*1000 + 3000). So I was wondering if maybe I typed my code incorrectly or if LuaNinja did not fully unlock the commands.
Any clue as to why my /in command isn't working correctly?
ALSO: Here is my current Survival Spec Hunter...
Code:
#Aggro Management
/run if IsUsableSpell("Disengage")==1 and GetSpellCooldown("Disengage")==0 and IsSpellInRange("Wing Clip", "target")==1 then CastSpellByName("Disengage") end
/run if IsSpellInRange("Wing Clip", "target")==1 and GetSpellCooldown("Feign Death")==0 then CastSpellByName("Feign Death") end
#Aspects
#Tracking
/stopmacro [noexists]
/run for i=1,GetNumTrackingTypes() do local n, t, a, c = GetTrackingInfo(i); if string.find(n, UnitCreatureType("target")) then if t~=GetTrackingTexture(i) then SetTracking(i); end end end
#MAIN Combat
/startattack
/run if not UnitDebuff("target", "Hunter's Mark") then CastSpellByName("Hunter's Mark") end
/run local _,d,_ = GetSpellCooldown("Black Arrow") if (d == 0) then CastSpellByName("Black Arrow") end
/run local _,d,_ = GetSpellCooldown("Explosive Shot") if not UnitDebuff("target", "Explosive Shot") and (d == 0) and UnitBuff("player", "Lock and Load") then CastSpellByName("Explosive Shot") end
#/run local _,d,_ = GetSpellCooldown("Aimed Shot") if (d == 0) then CastSpellByName("Aimed Shot") end
#/run local _,d,_ = GetSpellCooldown("Steady Shot") if (d == 0) then CastSpellByName("Steady Shot") end
#Meelee Combat
/run local _,d,_ = GetSpellCooldown("Mongoose Bite") if (d == 0) and IsSpellInRange("Mongoose Bite", "target")==1 then CastSpellByName("Mongoose Bite") end
/run local _,d,_ = GetSpellCooldown("Raptor Strike") if (d == 0) and IsSpellInRange("Raptor Strike", "target")==1 then CastSpellByName("Raptor Strike") end
#Interrupt
/run if UnitCastingInfo("target") then CastSpellByName("Scatter Shot") end
#Cooldowns
/run local _,d,_ = GetSpellCooldown("Kill Command") if (d == 0) then CastSpellByName("Kill Command") end
/run local _,d,_ = GetSpellCooldown("Rapid Fire") if (d == 0) then CastSpellByName("Rapid Fire") end
#Error Message
/run StaticPopup_Hide("MACRO_ACTION_FORBIDDEN");
What it does:
- If target is in melee distance, then you will Disengage and Feign Death (Sometimes you also get a Mongoose Bite in).
- Will automatically switch what Tracking spell you have enabled to the one that corresponds to your target.
- Will cast Black Arrow if target does not have debuff.
- Will cast Explosive Shot if player has "Lock and Load" proc, but will wait until each Explosive Shot debuff is off the target.
- If FD and DE are on cooldown, player will use Raptor Strike and Mongoose Bite.
- If target is casting, player will use Scatter Shot to interrupt cast.
- Will use Rapid Fire and Kill Command when they are done on cooldown.
Currently Working on:
- Aspect of the Viper when out of combat, Aspect of the Hawk when in combat.
- Utilization of traps
- Movement
- Better threat management using the UnitDetailedThreatSituation (if possible).
All of this code has been based off what I found here on the forums. And I'm just beginning to learn all of the API functions etc, so PLEASE give me help / suggestions!