I wrote this so I could rotate at higher speeds than /face normally allows, but without turning instantaniously, which I think looks suspicious to other players.
It probably needs a bit more polish, but feel free to use or modify it.
Code: Select all
| rotate.mac
| A macro to rotate you to face your current target at variable speeds
| Usage /macro rotate speed
|
| where:
| speed 1 is very slow
| speed 5 is ~equal to /face
| speed 10 is very fast
| speed 20 is ultra fast
| speed >30 is ~ /face fast
#turbo
Sub Rotate
/declare myheading local
/declare targetbearing local
/declare rotation local
/declare mystep local
/declare turn local
/varset mystep @Param0
/varset myheading $char(heading)
/varset targetbearing $heading($target(y),$target(x))
/varset turn $calc(@myheading-@targetbearing)
/if n @turn<-180 /varadd turn 360
/if n @turn>180 /varsub turn 360
/if n @turn<0 {
/if n @myheading>@targetbearing /varsub myheading 360
/for rotation @myheading to @targetbearing step @mystep
/face heading @rotation nolook
| /delay 0.5
/next rotation
} else {
/if n @myheading<@targetbearing /varadd myheading 360
/for rotation @myheading downto @targetbearing step @mystep
/face heading @rotation nlook
| /delay 0.5
/next rotation
}
/face fast nolook
/return
