I've been working on a ranger macro that will change between melee and ranged automatically based on distance. This works decent so far but its buggy in that in between spot, were I am too close for ranged and too far for mq2melee to stick properly.
The main problem I have is calling #Event NUke or #Event Swarm. I believe I am stuck inside my :rangecheck loop and it can't process the other subroutines.
I just picked this mq stuff up last week and would appreciate some help. I don't want to automate everything
|Ranger Bot
#Event Assist "#*#Assist me on >> #1# << (NPC ID = #2#)'" |Setup Hotkey Like This: Assist me on >> %t << (NPC ID = ${Target.ID})
#Event Snare "#*#>snare this<'"
#Event Buff_U "#*#>buff_u<'"
#Event Ranger_Buff_Me "#*#>ranger_buff_me<'"
#Event Nuke "#*#>R-Nuke<'"
#Event Swarm "#*#>Swarm<'"
Sub Main
/echo Launching Ranger Bot!
:mainloop
/doevents
/delay 1
/goto :mainloop
/return
Sub Event_Assist(Line,NPC,NPCid)
/stick off
/target clear
/echo Targeting ${NPC}.
/target id ${NPCid}
/echo Engaged upon ${Target.CleanName}
:rangecheck
/if (${Target.Distance.Int}<20) /goto :melee
/if (${Target.Distance.Int}>=20) /goto :ranged
/return
:ranged
/if (!${Me.Casting.ID} && ${Me.RangedReady}) {
/face fast
/ranged
}
/delay 1
/goto :rangecheck
:melee
/keypress z
/return
Sub Event_Snare(Line,NPC,NPCid)
/echo snaring ${NPC}
/casting "snare" gem2
| /target id ${NPCid}
/3 snaring a ${NPC}
/return
Sub Event_Swarm(Line,NPC,NPCid)
/target id ${NPCid}
/echo swarming a ${NPC}
| /casting "Stinging Swarm" gem2
/3 Swarming a ${NPC}
/return
Sub Event_Nuke(Line,NPC,NPCid)
/echo nuking a ${NPC}
/casting "Flame Arrow" gem1
| /target id ${NPCid}
/3 Nuking a ${NPC}
/return
|--------Non Combat----------|
Sub Event_Buff_U(Line,PCid)
/target ID ${Me.ID}
/echo Buffing ${ME}
/casting "Feet Like Cat" gem4 -maxretries|3
/delay 7s
/casting "Hawk EyE" gem8 -maxretries|3
/delay 6s
/casting "Riftwind's Protection" gem8 -maxretries|3
/return
|---Sub Event_Ranger_Buff_Me--having trouble passing it a target variable---works if I hard code a name---|
/target clear
/target "name"
/delay 1
| /echo Buffing ${Leader.ID}
/casting "Feet Like Cat" gem4 -maxretries|3
/delay 7s
/casting "Strength of Earth" gem5 -maxretries|3
/delay 6s
/casting "Riftwind's Protection" gem8 -maxretries|3
/return

