Ok, try this instead(coding at work, so ymmv)
Code: Select all
| Joust.mac
|
| Program used in melee PvP to constantly face opponent
| and to attack the instant you are within melee range
| and then to immediately face away from opponent to get
| out of range of their attack. This requires you to already
| have your opponent targetted.
|
sub Main
:Loop
/face fast nopredict
/if $target(distance)< 10 /goto :Attack
/delay 5
/goto :Check
:Attack
/attack on
/face fast away
/delay 20 |gives time to get away before facing again
/attack off
:Check
/if "$target()"=="TRUE" /goto :Loop
/echo "PvP Melee done."
/return
Ok, if this is
really what you want, it should do the following:
if you are > 10 away, keep /facing target
if you are < 10 away, /attack on, face away(hopefully you got an attack in there in that microsecond), wait 2 seconds, turn attack off, then end the script(with a "PvP Melee done." message).
A more "elegant" (stylistically speaking) would be:
Code: Select all
sub Main
:Loop
/face fast nopredict
/if $target(distance)< 10 /call Attack
| half second delay
/delay 5
/if "$target()"=="TRUE" /goto :Loop
/echo "PvP Melee done."
/return
Sub Attack
/attack on
/delay 20 |gives time to get away before facing again
/attack off
/face fast away
/return
Personally, i'd use a script which would keep me in range, and just strafe around them. The advantage of doing that would be they still couldn't hit you, but you would still be poking them in the butt(no pun intended). :-)