Page 1 of 1

Slay Target

Posted: Sun Feb 27, 2011 1:45 pm
by Dregs
This is an incredibly simple macro I made for my low level toon on the progression server. It doesn't do any special attacks, just turns on attack, and chases the mob. I got lazy running my toon, and threw this together. It even bugs a little when selling to merchants or something. I'll leave it as is for now. Feel free to make any changes or build off of it.

Instructions are in the comments at the top.

And thanks to jacensolo, as I borrowed from his farm macro.

Code: Select all

|Written by Dregs
|------------------------------------------------------------------------------------------------------
|Usage:
|Run the macro and then make a hotkey that says /echo Slay Target
|Target what you want to kill, and hit the "Slay Target" hotkey.
|To cancel an attack, for healing, or running, or whatever,
|simply type (or make a hotkey and press it that says) /echo Cancel
|You can download my countexp.inc file for exp calculations,
|or just delete the parts       #include Countexp.inc  and  /call CreateCountExpVariables
|The macro will rune fine without it.
|-------------------------------------------------------------------------------------------------------
#include Countexp.inc

#event CallAttack "[MQ2] Slay Target"
#event CallCancelAttack "[MQ2] Cancel"
#event CallCancelAttack "You have been slain#*#"
#event CallCancelAttack "You have been knocked unconscious!"
#event CallCancelAttack "You are bleeding to death!"
#event CallCancelAttack "Returning to Bind Location#*#"
#event CallCancelAttack "LOADING,#*#"

Sub Main
   /declare AttackSwitch int outer 0
   /call CreateCountExpVariables
   /echo SlayTarget macro begun
   :MainLoop
   /doevents
   /call AttackOff
   /goto :MainLoop
/return

Sub Attack
   /echo Attacking a level ${Target.Level} ${Target}.
   /if (${Me.State.Equal[sit]}) {
      /sit off
      /delay 5
   }
   /if (${Target.ID} && ${AttackSwitch}==1) /face nolook
   /delay 5
   :combatloop
   /doevents
   /if (${Target.ID} && ${AttackSwitch}==1) /face fast nolook
   /if (${Target.Distance}>10 && ${AttackSwitch}==1) {
      /face fast nolook
      /keypress forward hold
      :moveloop
      /doevents
      /if (${Target.ID} && ${AttackSwitch}==1) /face fast nolook
      /delay 1
      /if (${Target.Distance}<6) /nomodkey /keypress forward
      /if (${Target.Distance}>10 && ${AttackSwitch}==1) /goto :moveloop
      /keypress forward
   }
   /doevents
   /if (${Target.Distance}<15 && !${Me.Combat} && ${AttackSwitch}==1) /keypress q
   /if (${Target.ID} && ${AttackSwitch}==1) /goto :combatloop
/return

Sub Event_CallAttack
   /if (${Target.ID} && ${Target.Type.Equal[NPC]} && ${Target.Type.NotEqual[corpse]}) {
      /varset AttackSwitch 1
      /call Attack
   }
/return

Sub AttackOff
   /if (${Me.Combat}) /varset AttackSwitch 1
   /if (!${AttackSwitch}==0 && ${Me.State.Equal[Stand]}) {
      /if (!${Target.ID} || ${Target.Type.Equal[corpse]}) {
         /attack off
         /varset AttackSwitch 1
      }
   }
/return

Sub Event_CallCancelAttack
   /call CancelAttack
/return

Sub CancelAttack
   /if (${AttackSwitch}==1) {
      /echo Canceling the attack
      /attack off
      /varset AttackSwitch 0
      /if (!${Me.Speed}==0) /nomodkey /keypress forward
   }
/return

Re: Slay Target

Posted: Tue Mar 01, 2011 5:11 pm
by caj
just an fyi, attack automaticly turns off when you die, zone, fd fall, ect..

theres even a much simplier one then your macro, donate to devs to get VIP then get MQ2MoveUtils and MQ2Melee. those 2 plugins do exactly what your describing. Its almost as easy as point and shoot. just a suggestion.