Release notes:
This script allows a rogue to auto-fight. This is a subscript of a much largest script, the only items being taken out are the "command" controls. If there are any issues, please post them here.
Jay
Code: Select all
| Auto Rogue Script
| Program by Jay
|
| Version 1.04 05/19/2003
|
| Usage: /macro autorogue <Tank Name>
|
| Changes for 1.02
| - Added Sneakhide option
| - Added BehindTarget check during enrage
| - Added enrage var
| - Added documentation
| - Changed, You will not evade when mob is below 20%
| Changes for 1.03
| - Added target engage delay
| - Added target range check before engage
| - Checks to make sure target is not a pet first
| - Added an assist in the attack loop
| Changes for 1.04
| - Added death check
#Event Enraged "has become ENRAGED"
#Event Offrage "is no longer enraged"
#Event Slainby "You have been slain by a"
| ----- Trigger Defines ---------------------
#Define ASSISTHEALTH 97 | Wait until mob is below this health trigger.
#Define EVADEREFRESH 105 | How long it takes till evade refreshes.
#Define TURBOAMOUNT 380 | Turbo Amount, Change at your own risk.
#Define SNEAKHIDE 1 | Sneak Hide between kills; 1 = Yes, 0 = No
#Define ENGAGEDISTANCE 150 | How close mob must be to engage
| ----- Varabales -----
#Define evadeTimer t1
#Define checkTimer t2
#Define targetName v0
#Define targetID v1
#Define tankName v2
#Define AttackTarget v3
#Define tempVar v4 | Simple tempvar
#Define behindTarget v5 | 1 = True, 0 = False
#Define targetEnrage v6 | 1 = True, 0 = False
#include routines.mac
#turbo TRUBOAMOUNT
| ----- Main ---------------------------------
| -- Entry point for script
| --------------------------------------------
Sub main
/echo "Auto Rogue Version 1.03 Starting"
/varset tankName $p0
/echo "$tankName is assist tank."
/varset tempVar 0
/if n SNEAKHIDE==1 {
/doability "Sneak"
/doability "Hide"
}
/goto :Wait
/goto :Attack
/return
:Wait
/assist $tankName
/delay 5
/if "$target()"=="FALSE" {
/target $tankName
/face nopredict
/goto :Wait
}
/if "$target(type)"!="NPC" {
/face nopredict
/goto :Wait
}
/if n $tempVar!="$target(hp,pct)" /echo $target(name) targeted at $target(hp,pct)% at distance $target(distance).
/varset tempVar "$target(hp,pct)"
/face nopredict
/if n "$target(hp,pct)"<=ASSISTHEALTH /if n "$target(distance)<ENGAGEDISTANCE" /if n "$target(pet)==0" /goto :DoubleCheck
/Attack off
/DoEvents
/goto :Wait
:DoubleCheck
/delay 10
/if n "$target(hp,pct)"<=ASSISTHEALTH /if n "$target(distance)<ENGAGEDISTANCE" /if n "$target(pet)==0" /goto :Attack
/goto :Wait
:Attack
/doability "Sneak"
/echo Fighting $target(name). It is level $target(level).
/varset targetName $target(name)
/varset targetID $target(id)
/varset evadeTimer EVADEREFRESH
/varset AttackTarget 1
/varset behindTarget 0
/varset targetEnrage 0
/face nopredict
/sendkey down up
/if n $AttackTarget==1 /attack on
:AttackLoop
/assist $tankName
/if "$target()"=="FALSE" /goto :AttackEnd
/if "$target(id)"!="$targetID" /goto :AttackEnd
/if n $targetEnrage==1 /if n $behindTarget==0 /varset AttackTarget 0
/if n $targetEnrage==1 /if n $behindTarget==1 /varset AttackTarget 1
/if n $AttackTarget==1 /doability Backstab
/if n $AttackTarget==1 /Attack on
/if n $AttackTarget==0 /Attack off
/face fast nopredict
/if n $target(distance)>15 /sendkey down up |If target is farther then 13 move foward
/if n $target(distance)<6 /sendkey down down |If target is closer then 6 move back
/if n $target(distance)<10 /sendkey up up |If target is closer then 10 stop moving foward
/if n $target(distance)>9 /sendkey up down |If target is farther then 9 stop moving back
/face fast nopredict
/doevents
/if n $target(distance)<14 /if n $target(distance)>5 /goto :rotate
/goto :AttackLoop
:rotate
| ----- Clockwise Rotate Check -----
/if n $target(heading)>=180 /if n $calc($target(heading)-180)<=$char(heading) /if n $char(heading)<$calc($target(heading)-22.5) /goto :bsclock
/if n $target(heading)>=180 /if n $char(heading)<=180 /if n $calc($char(heading)-22.5)>$calc($target(heading)-360) /goto :bscounter
/if n $target(heading)<=180 /if n $char(heading)<$calc($target(heading)-22.5) /goto :bsclock
| ----- Counter Clockwise Rotate Check -----
/if n $char(heading)>=180 /if n $calc($char(heading)-180)<=$target(heading) /if $char(heading)>$calc($target(heading)+22.5) /goto :bscounter
/if n $char(heading)>=180 /if n $target(heading)<=180 /if n $calc($char(heading)-157.5)<$calc($target(heading)+180) /goto :bsclock
/if n $char(heading)<=180 /if n $target(heading)<=180 /if n $char(heading)>$calc($target(heading)+25) /goto :bscounter
/varset behindTarget 1
/goto :AttackLoop
:AttackEnd
/echo "$targetName has died"
/sendkey up up
/sendkey up down
/sendkey up ctrl
/varset AttackTarget 0
/varset tempVar 0
/varset evadeTimer 0
/attack off
/echo "Wating for $tankName to select new target..."
/delay 10
/if n SNEAKHIDE==1 {
/doability "Sneak"
/doability "Hide"
}
/goto :Wait
:bsclock
/sendkey down ctrl
/sendkey down right
/sendkey down up
/sendkey up up
/sendkey down down
/sendkey up down
/sendkey up right
/sendkey up ctrl
/press down
/press ctrl
/face
/varset behindTarget 0
/goto :AttackLoop
:bscounter
/sendkey down ctrl
/sendkey down left
/sendkey down up
/sendkey up up
/sendkey down down
/sendkey up down
/sendkey up left
/sendkey up ctrl
/press down
/press ctrl
/face
/varset behindTarget 0
/goto :AttackLoop
| ----- Events called by /DoEvents -----
Sub Event_Enraged
/if n $behindTarget==0 /varset AttackTarget 0
/varset targetEnrage 1
/attack off
/return
Sub Event_Offrage
/varset targetEnrage 0
/varset AttackTarget 1
/attack on
/return
Sub Event_Slainby
/endmacro
/return
Sub Event_Timer
/if n $p0==1 /goto :timerEvade
/return
| *** Event Subs ***
:timerEvade
/if n "$target(hp,pct)">=30 {
/sendkey up up
/sendkey up down
/attack off
/delay 3
/doability Hide
/if n AttackTarget==1 /attack on
}
/varset evadeTimer EVADEREFRESH
/return



