disasteroid
New member
- Joined
- May 18, 2015
- RedCents
- 575¢
I am trying to create a macro to delevel toons automatically by suiciding into guards to take advantage of the insane merc AA gain at low levels. It first tries to find a guard standing nearby on the same Z plane to prevent pathing issues, and if the guard is nearby it uses the MQ2Melee command /killthis to run up and punch him or her. Since it's not an instantkill, the macro loops every 3 seconds to check if the character is still alive. Once dead, it triggers an event ("you've been slain", etc) that sets IAmDead to TRUE.
My question is then in several parts:
1) How does event queueing work? In the snippet below I have the command /doevents before it checks if the character is still alive. Is this necessary?
2) Is there a better way to handle restarting this subroutine after death?
My question is then in several parts:
1) How does event queueing work? In the snippet below I have the command /doevents before it checks if the character is still alive. Is this necessary?
2) Is there a better way to handle restarting this subroutine after death?
Rich (BB code):
Sub MercAA
:CakeIsGreat
/if (${Me.Level}>LowLevel) {
/declare guard2d bool local 0
/declare guardzd bool local 0
/varset IAmDead 0
/squelch /target clear
/squelch /target guard radius 30
/if (${Target.ID}) /varset guard2d 1
/squelch /target clear
/squelch /target guard zradius 3
/if (${Target.ID}) /varset guardzd 1
/if (guard2d && guardzd) {
/if (!${Me.Combat}) {
/if (${Me.Sitting}) /stand
/killthis
:StillAlive
/doevents
/if (!${IAmDead}) {
/delay 3s
/goto :StillAlive
} else {
/goto :CakeIsGreat
}
}
} else {
/echo Guard out of range, waiting...
/delay 5s
/goto :CakeIsGreat
}
}
/return