[Head] Type=Script Version=2.0 [Settings] Origin=0.000n 0.000w 0.00a 0.0° [Script] # bot circles around its present position # and returs after one whole circle. # define your variables # (@a and %d may not be defined, they are default) var @centre, %radius, %angle # set the value of m / sec for movement step 1.5 # keep in @centre the position of the bot GetPosition @centre # assign values: # %radius in m, %angle and %d in degrees %radius = 5 %angle = 0 %d = 30 # the circle itself: a loop Label Loop # calculate position @a Gosub Circle # go to each position gradually, using step To @a # loop back until whole circle is done ifInt %angle <= 360 Goto Loop # return to the centre To @centre End Sub Circle # copy @centre to @a @a = @centre # set the rotation of @a to %angle GetRotation @a %angle # move @a from centre to end of %radius # in the direction it is facing LocMove3D @a %radius 0 0 # add a fixed amount %d to %angle for next iteration IntAdd %angle %angle %d Return