Very basic surfspeed limiter.

No the prettiest code and probably named and placed in the wrong areas. It will hopefully give you an idea how to do it properly. Needed this as driving at 20m/s on minus gets you a bit of air. srfspdlmt(double) returns -0.5 if surfspeed > double and 0.5 if lessthan. Found using 1 was a bit too jumpy. Some ugly sample code follows:

>lights on.
brakes off.
clearscreen.
set geolock to latlng(-0.02,-76.0).
set home to geoposition.
lock wheelsteering to geolock.
set trgspeed to -3.
lock altrdr to alt:radar.
lock elec to <electriccharge>.
lock wheelthrottle to srfspdlmt(trgspeed). // 1 == tracks -1 == wheels.
set orbit to 0.
on ag5 break.
until orbit > 0 {
  print "geolockpos: " + geolock at (0,1).
  print "geolockhead: " +geolock:heading at (0,2).
  print "geolockbear: " +abs(geolock:bearing) at (0,3).
  print "geolockdistance: " +round(geolock:distance) + "m" at (0,4).
  print "elec: " +round(elec) at (0,5).
  print "srfspeed: " +round(surfacespeed) +"m/s" at (0,6).
  print "TravelDist: " +round(home:distance)/1000+"km" at (0,8).
  if abs(geolock:bearing) < 2 
  {
    set trgspeed to 15.
  }.
  if geolock:distance < 150
  {
    set trgspeed to 5.
  }.
  if geolock:distance < 20
  {
    unlock wheelthrottle.
    lights off.
    brakes on.
    break.
  }.
  if elec < 20
  {
    set trgspeed to 5.
  }.
  if elec < 10 
  {
    print "Power low! Parking." at (0,7).
    unlock wheelthrottle.
    lights off.
    brakes on.
  }.
  if elec > 75
  {
    print "Starting back up." at (0,7).
    brakes off.
    lock wheelthrottle to srfspdlmt(trgspeed).
    lights on.
  }.
}