I'll just copy and paste what I have in my engage routine (for my almost finished autopull macro, I took out the add handling and other extra stuff that relies on external routines). Has some slightly more advanced stuff, but it should serve as a semi good example =). You could probably add extras like sitting until your full HP or what not from here.
Code: Select all
Sub Main
:MainLoop
/call Engage
/echo Currently have ${Me.CurrentHPs} hitpoints (${Me.PctHPs}%)
/goto :MainLoop
/return
Sub Engage
/declare TargetToPull int local
/stand
/varset TargetToPull ${NearestSpawn[npc range 3 5].ID}
/target id ${TargetToPull}
/attack on
/face id ${TargetToPull}
/echo Attacking ${Target.Name}
/mqlog Engage: Attacking ${Target.Name}
:AutoAttackLoop
/face fast
/call CheckDeath
/if (${Target.Distance}>12) {
/keypress forward hold
:GetCloseLoop
/face fast
/if (!${Target.ID}) {
/keypress forward
/return
}
/if (${Target.Distance}>12) /goto :GetCloseLoop
/keypress forward
}
/if (${Target.Distance}<8) {
/face fast
/keypress back hold
:GetBackLoop
/face fast
/if (!${Target.ID}) {
/keypress back
/return
}
/if (${Target.Distance}<8) /goto :GetBackLoop
/keypress back
}
/if (!${Me.Stunned}) {
/if (${Me.AbilityReady["Taunt"]}==1) {
/doability "Taunt"
}
/if (${Me.AbilityReady["Kick"]}==1) {
/doability "Kick"
}
/if (${Me.AbilityReady["Disarm"]}==1) {
/doability "Disarm"
}
}
/if (${Target.Type.Equal["NPC"]}) /goto :AutoAttackLoop
/return
Oh, and to answer your question, you don't have a /doevents call in your macro. In other words, your macro never checks to see if the text "you have slain" was ever sent to the client. The macro I gave doesn't rely on any events. Your macro is somewhat difficult to follow because the gotos jump all over the place and don't really have good names (and the indenting is bad). Therefore, I'm not even quite sure where you would put /doevents. It's your first macro, so I'm not knocking you for it - just giving suggestions to make it 10x easier on yourself when writing them. Overall, you made a damn good first macro.
Edit: One more thing - This wont work.
It needs to be.
For one, you needed the ${} around your stuff. Also, I don't think .Equal will evaluate numbers but rather strings. I could be mistaken though