Problem I'm having is that if I use this to autohunt I get stuck on trees, rocks, etc. I have a subroutine that will back up and strafe... but can't figure out a working way to call that subroutine. Can anyone help me out with this?
Code: Select all
sub Attack
/varset a(8,0) "$target(name,clean)"
/varset a(8,1) $target(level)
/varset a(8,2) $target(name)
/varset a(8,3) $target(id)
/echo Fighting a level $a(8,1) $a(8,0)
/face
/sendkey down up
:CloserAF
/if "$target(id)"!="$a(8,3)" /goto :EndAF
/if n $target(distance)>10 /sendkey down up
/if n $target(distance)<6 /sendkey down down
/if n $target(distance)<11 /sendkey up up
/if n $target(distance)>5 /sendkey up down
/if n $target(distance)<12 /attack on
/if n $target(distance)>19 /attack off
/face fast nopredict
/if n $char(ability,"Bash")>0 /doability "Bash"
/if n $char(ability,"Kick")>0 /doability "Kick"
/if n $char(ability,"Disarm")>0 /doability "Disarm"
/goto :CloserAF
:EndAF
/echo The level $a(8,1) $a(8,0) is dead...
/sendkey up up
/sendkey up down
/attack off
/varset a(8,3) 0
/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



