Code: Select all
| goto.mac
|
| Usage: /macro goto X, Y
|
| By Nerfy who copy and pasted code from
| Fippy's Hunter.mac
#define Xpos $p1
#define Ypos $p2
#define Xcur v51
#define Ycur v52
#define ThereYet v53
Sub Main
/press esc
/press esc
/press esc
/press esc
/press alt
/press shift
/press ctrl
:GoToPoint
/varset ThereYet 0
/face loc $Ypos,$Xpos
| If we are not within melee range then make sure we are on autorun
/if n $distance($Ypos,$Xpos)>15 /call Autorun 1
| Current Loc
/varset Xcur $char(x)
/varset Ycur $char(y)
| Obstacle routine if stuck
/delay 1
/if n $MyXLoc==$char(x) /if $MyYLoc==$char(y) /call Obstacle
| End movement when near to point.
/if n $distance($Ypos,$Xpos)<5 {
/call Autorun 0
/varset ThereYet 1
}
/delay 0
/if n $ThereYet!=1 /goto :GoToPoint
/echo Here we are.
/return
sub Obstacle
| We appear to be stuck so try and backup and strafe sideways
/sendkey up up
/sendkey down down
/delay 2
/sendkey up down
/sendkey down ctrl
/if n $rand(99)>50 {
/sendkey down right
} else {
/sendkey down left
}
/delay 3
/sendkey up right
/sendkey up left
/sendkey up ctrl
/sendkey down up
/return
Sub AutoRun
/if $p0==1 /sendkey down up
/if $p0==0 /sendkey up up
/return

