Code: Select all
| 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.
|
| ** Added go back to starting loc, this is good for pulling to a set spot.
| Version 1.09 ** Added Strike Discipline in beginning - You must have
| the Discipline in slot 3.
| Usage: /macro rogue.mac <Assist> <AssistHealth> <AssistRange> <Master>
#chat tell
#Event Enraged "has become ENRAGED"
#Event Offrage "is no longer enraged"
#Event Slainby "You have been slain by"
#include advpath.inc
#include routines.mac
#turbo 380
Sub main
/Declare Following global
/Declare Master global
/Declare assisthealth global
/Declare sneakhide global
/Declare engagedistance global
/Declare countdown global
/Declare MyXLoc global
/Declare MyYLoc global
/Declare BaseXLoc global
/Declare BaseYLoc 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
/Declare FollowTarget global
/Varset assisthealth @Param1 | Wait until mob is below this health trigger.
/Varset sneakhide 1 | Sneak Hide between kills; 1 = Yes, 0 = No
/Varset engagedistance @Param2 | How close mob must be to engage
/varset tankname @Param0
/varset tempvar 0
/varset BaseXLoc $char(x)
/varset BaseYLoc $char(y)
/varset Master @Param3
/echo "Gretings @Master I'll Assist @tankname at a range of @engagedistance and health of @assisthealth."
:Wait
/if n @sneakhide==1 {
/if n $char(ability,Sneak)>0 {
/doability "Sneak"
}
/if n $char(ability,Hide)>0 {
/doability "Hide"
}
}
/DoEvents
/assist @tankname
/delay 1s
/attack off
/delay 1s
/if "$target()"=="FALSE" {
/target @tankname
/face
/goto :Wait
}
/if "$target(type)"!="NPC" {
/target @tankname
/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)<=@engagedistance" {
/goto :Attack
}
}
/DoEvents
/goto :Wait
:Attack
/echo Fighting $target(name,clean). It is a level $target(level) $target(race).
/varset attacktarget 1
/varset behindtarget 0
/varset targetenrage 0
/if $char(sneaking)=="TRUE" /doability "Sneak"
:AttackLoop
/if n @attacktarget==0 /Attack off
/if "$target()"=="FALSE" /goto :AttackEnd
/if "$target(id)"!="@targetid" /goto :AttackEnd
/call GetBehind
/if n @attacktarget==1 {
/if n $target(distance)<$target(maxrange) {
/doability backstab
/if n $char(ability,hide)!=-2 {
/attack off
/delay 1
}
/if $char(ability,hide)!=-2 {
/doability hide
}
}
}
/attack on
/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)<10 /sendkey up up |If target is closer then 10 stop moving forward
/if n $target(distance)>9 /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..."
/call GotoLoc2 @BaseXLoc @BaseYLoc
/goto :Wait
/endmacro
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
Sub GotoLoc2
/declare XLoc local
/declare YLoc local
/varset XLoc @Param0
/varset YLoc @Param1
:GotoLocLoop
/face nolook loc @YLoc,@XLoc
/sendkey down up
/if n $distance(@YLoc,@XLoc)>5 {
/goto :GotoLocLoop
}
/sendkey up up
/return
| ----- Events called by /DoEvents -----
Sub Event_Chat
/if "@Param0"!="TELL" {
/return
}
/if @Param1==@Master {
/if "@Param2"=="Buff" {
/cleanup
/press i
/cast item "Stanos' Wicked Gauntlets"
/delay 4s
/finditem "Velium Coldain Insignia Ring"
/delay 1
/mouseto rfinger
/delay 1
/click left
/delay 1
/cast item "Velium Coldain Insignia Ring"
/delay 1s
/click left
/delay 1
/click left auto
/delay 1s
/cleanup
/return
}
/if "@Param2"=="follow" {
/varset Following 1
/varset FollowTarget "@Master"
/call InitAPFVars 1 15 20
:StartFollow
/call FollowFunction "@FollowTarget"
/doevents
/if n @following==0 {
/varset BaseXLoc $char(x)
/varset BaseYLoc $char(y)
/return
}
/goto :StartFollow
/return
}
/if "@Param2"=="stop" {
/varset Following 0
/return
}
/return
}
/return
Sub Event_Enraged
/varset attacktarget 0
/attack off
/return
Sub Event_Offrage
/varset attacktarget 1
/attack on
/return
Sub Event_Slainby
/endmacro
/return


