Heres what im wondering ... basically ever time the mob moves the rogue adjusts to get directly behind the mob. Its well known that rogues can make a backstab from *almost* the entire 180 degrees behind the mob.| Modified rogue.mac
| Credits to Jay (rogue.mac) and Lasher et. al. (genbot.mac)
|
| Cleaned up some of the code, tossed the xp stuff and fixed events,
| evade and getbehind.
|
| Usage: /macro rogue.mac <Assist> <AssistHealth>
#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
/Declare assisthealth global
/Declare turboamount global
/Declare sneakhide global
/Declare engagedistance global
/Declare countdown global
/Declare MyXLoc global
/Declare MyYLoc global
/Declare targetname global
/Declare targetid global
/Declare tankname global
/Declare attacktarget global
/Declare tempvar global
/Declare behindtarget global | 1 = True, 0 = False
/Declare targetenrage global | 1 = True, 0 = False
/Declare mobdetail array2 | Mob details array
/Varset assisthealth @Param1 | Wait until mob is below this health trigger.
/Varset turboamount 380 | Turbo Amount, Change at your own risk, was 380.
/Varset sneakhide 1 | Sneak Hide between kills; 1 = Yes, 0 = No
/Varset engagedistance 400 | How close mob must be to engage
/varset tankname @Param0
/varset tempvar 0
/echo "Auto Rogue Version 1.07 Starting"
/echo "@tankname is assist tank."
/if n @sneakhide==1 {
/doability "Sneak"
/delay 5
/doability "Hide"
}
:Wait
/assist @tankname
/delay 10
/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 :Attack
}
}
/Attack off
/DoEvents
/goto :Wait
:Attack
/doability "Sneak"
/echo Fighting $target(name,clean). It is a level $target(level) $target(race).
/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 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
/doevents
/call GetBehind
/if n @attacktarget==1 {
/attack on
/if n $target(distance)<$target(maxrange) {
/doability backstab
/attack off
/doability hide
/attack on
}
}
/if n @attacktarget==0 /Attack off
/face fast
/if n $target(distance)>25 /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)<20 /sendkey up up |If target is closer then 10 stop moving forward
/if n $target(distance)>18 /sendkey up down |If target is farther then 9 stop moving back
/face fast
/doevents
/goto :AttackLoop
:AttackEnd
/echo "@targetname has died"
/sendkey up up
/sendkey up down
/sendkey up ctrl
/varset attacktarget 0
/varset tempvar 0
/attack off
/echo "Waiting for @tankname to select a new target..."
/if n @sneakhide==1 {
/doability "Sneak"
/delay 5
/doability "Hide"
}
/goto :Wait
/return
Sub GetBehind
/varset countdown 0
/varset MyXLoc $char(x)
/varset MyYLoc $char(y)
/if n $distance($calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10))<3 {
/goto :noneed
}
/if $target()==FALSE /return
/sendkey down up
:gobehindloop
/if $target()==FALSE {
/sendkey up up
/return
}
/if n @countdown>=20 {
/if n @MyXLoc==$char(x) {
/if @MyYLoc==$char(y) {
/sendkey up up
/return
}
}
/varset MyXLoc $char(x)
/varset MyYLoc $char(y)
/varset countdown 0
}
/varadd countdown 1
/doevents
/if "$char(state)"=="SIT" /stand
/face nolook fast loc $calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10)
/if n $distance($calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10))>1 /goto :gobehindloop
/sendkey up up
/if "$char(state)"=="SIT" /stand
/face fast
:noneed
/return
| ----- Events called by /DoEvents -----
Sub Event_Enraged
/varset attacktarget 0
/attack off
/return
Sub Event_Offrage
/varset attacktarget 1
/attack on
/return
Sub Event_Slainby
/endmacro
/return
Is there anyway to program any forgiveness into the code making it more reliable and more realistic. For example... Your start the macro and it postions you directly behind the mob. THe mob is rotated a few degrees clockwise or counter clockwise... because hte back of the mob is still available the macro does not make any adjustments.
The other example is when the tank pushes the back of the mob into a wall ... your rogue will start running into the wall... is there anyway to make a collision check that halts the rogue faces the mob and settles for the best available position... combined with the forgiveness above you would probably be making the backstabs still...
Well thats my request... Im still new so I have very little knowledge on this subject would appreciate comments in any code that is added because i have been sitting here trying to make sense of the move behind part of the code and im lost... Well I hope someone can help here I like the script I just want it to make it betta!


