You may be looping because you didn't include a /return in your code.
Just as an FYI, you could make this a bit more general using /face with a direction. I think that the verbage is 'heading'. Ah hell, let's get complicated:
Code: Select all
sub Main
/sendkey down up | Move forward
/varset v1 0 | Angle that you will face
:Swim | Start Loop
/press Page_Up | Look up
/face heading $v1 | Face the direction
/delay 1s | Pause
/varadd v1 90 | Direction = Old Direction + 90
/if $v1>270 /varset v1 0 | 360 is a circle, so back to 0
/goto :Swim | Loop
/return
I over commented so that you can see what things mean. Hope this helps out. This should work if you station yourself in the middle of a pool somewhere. Adding heading to /face faces you at that angle. 0=N, 90=W, 180=S, and 270=E. Couldn't tell you if 360 would do N again, so I just dropped it back to 0.
There's a difference in /press and /sendkey. /press is as if you just tapped the key. So /press Page_Up just taps your view up. It's in the loop above though, so you'll be looking straight up soon enough. /sendkey is always followed by the word UP or DOWN. Then the key name. This leaves that key in the up or down position. So if you wanted to sit (using hotkeys) you could do this:
Code: Select all
/sendkey down Ctrl
/press s
/sendkey up Ctrl
That holds down CTRL, presses S, and then releases CTRL.
Hope this helps out a bit.