Code: Select all
Rogue Script
| Program by Jay
| Updated by AP50
|
| Version 1.07 5/MAR/2004
|
| 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
| Changes for 1.05
| - Updated for use with new variable system
| Changes for 1.06
| - Just fixing the nopredict change
| Changes for 1.07
| - Changed distance check to use $target(maxrange)
| - - changed back, work in progress.
| - Fixed Counter Clockwise /if "n" statement
#Event Enraged "has become ENRAGED"
#Event Offrage "is no longer enraged"
#Event Slainby "You have been slain by"
#include routines.mac
#turbo @turboamount
Sub main
| ----- Trigger Declares ---------------------
/Declare assisthealth global
/Declare evaderefresh global
/Declare turboamount global
/Declare sneakhide global
/Declare engagedistance global
| ----- Trigger Values -----------------------
/Varset assisthealth 96 | Wait until mob is below this health trigger.
/Varset evaderefresh 105 | How long it takes till evade refreshes.
/Varset turboamount 380 | Turbo Amount, Change at your own risk.
/Varset sneakhide 1 | Sneak Hide between kills; 1 = Yes, 0 = No
/Varset engagedistance 150 | How close mob must be to engage
| ----- Variables ----------------------------
/Declare evadetimer timer
/Declare checktimer timer
/declare targetname global
/Declare targetid global
/Declare tankname global
/Declare attacktarget global
/Declare tempvar global | Simple tempvar
/Declare behindtarget global | 1 = True, 0 = False
/Declare targetenrage global | 1 = True, 0 = False
/Declare prekillxp global | Exp prior to kill
/Declare postkillxp global | Exp after kill
/Declare xpdiff global | Difference in Exp pre/post kill
/Declare xptillding global | Exp till next level
/Declare prekillaaxp global | AA Exp prior to kill
/Declare postkillaaxp global | AA Exp after kill
/Declare aaxpdiff global | Difference in AA Exp pre/post kill
/Declare mobstillding global | Approx number of kills of this mob type till next level
/Declare mobtypekilled global | Number of this mob type killed
/Declare mobdetail array2 | Mob details array
/echo "Auto Rogue Version 1.07 Starting"
/varset tankname @Param0
/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
/goto :Wait
}
/if "$target(type)"!="NPC" {
/face
/goto :Wait
}
/if n @tempvar!="$target(hp,pct)" /echo $target(name,clean) targeted at $target(hp,pct)% at distance $target(distance).
/varset tempvar "$target(hp,pct)"
/face
/if n "$target(hp,pct)"<=@assisthealth /if n "$target(distance,noprodict)<@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,clean). It is a level $target(level) $target(race).
/varset prekillxp $char(exp)
/varset prekillaaxp $char(aa,exp)
/varset mobdetail(8,0) "$target(name,clean)"
/varset mobdetail(1,1) $target(level)
/varset mobdetail(1,2) $target(name)
/varset mobdetail(1,3) $target(id)
/varset targetname $target(name)
/varset targetid $target(id)
/varset evadetimer @evaderefresh
/varset attacktarget 1
/varset behindtarget 0
/varset targetenrage 0
/face
/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 /varset attacktarget @behindtarget
/if n @attacktarget==1 /if n $target(distance)<$target(maxrange) /doability backstab
/if n @attacktarget==1 /Attack on
/if n @attacktarget==0 /Attack off
/face fast
/if n $target(distance)>18 /sendkey down up |If target is farther then 18 move forward
/if n $target(distance)<8 /sendkey down down |If target is closer then 8 move back
/if n $target(distance)<13 /sendkey up up |If target is closer then 10 stop moving forward
/if n $target(distance)>10 /sendkey up down |If target is farther then 9 stop moving back
/face fast
/doevents
/if n $target(distance)<$target(maxrange) /if n $target(distance)>$target(maxrange) /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 n $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"
/call event_exp
/sendkey up up
/sendkey up down
/sendkey up ctrl
/varset attacktarget 0
/varset tempvar 0
/varset evadetimer 0
/attack off
/echo "Waiting for @tankname to select a 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 @Param0==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
|#Exp Comparison Event
sub event_exp
/delay 1s
/varset postkillxp $char(exp)
/varset postkillaaxp $char(aa,exp)
/varcalc xpdiff @postkillxp-@prekillxp
/varcalc aaxpdiff @postkillaaxp-@prekillaaxp
/varcalc xptillding 100-$char(exp)
/varcalc mobstillding @xptillding/@xpdiff
/if n @xpdiff>0 {
/echo and you've gained @xpdiff% exp and @aaxpdiff% AA exp, bringing your total exp to $char(exp)% and your AA exp to $char(aa,exp)%!!
|#Read npc.ini for any entries of last target. (comment from here to next !! area to stop INI saving)
/if n $ini(npc.ini,"$zone","@mobdetail(8,0)")=="notfound" {
/varset mobtypekilled 0
} else {
/varset mobtypekilled $ini(npc.ini,"$zone","@mobdetail(8,0)")
}
/varcalc mobtypekilled @mobtypekilled+1
|#Save the data in npc.ini
/ini npc.ini "$zone" "@mobdetail(8,0)" @mobtypekilled
|!!
/echo Don't forget, @xptillding% left till level, with only @mobstillding of these mobs to kill.
|#display npc.ini data. (comment from here to next !! area to stop INI saving)
/if n @mobtypekilled==1.00 {
/echo This is your first kill of @mobdetail(8,0) in $zone.
} else {
/echo You've have killed @mobdetail(8,0) a total of $int(@mobtypekilled) times in $zone.
}
|!!
/varset mobtypekilled 0
} else {
|# Below handles when you don't get exp or just dinged
/echo Exp remains at $char(exp)% and AA exp remains at $char(aa,exp)% after kill.
}
/return


