kOS/execnode.ks

20 lines
471 B
Plaintext

runpathonce("lib/navigation").
runpathonce("lib/throttle").
SAS off.
local n is SHIP:NEXTNODE.
local t is BurnTime(n:MAG)/2.
lock STEERING to n:DELTAV.
wait until VectorAngle(SHIP:VELOCITY, STEERINGMANAGER:TARGET) <= 0.1.
print "Warping to node".
KUNIVERSE:WARP:WarpTo(n:TIME - t - 5).
wait until n:ETA <= t.
lock THROTTLE to 1.0.
wait until n:DELTAV:MAG <= 0.1. // todo: pid loop here or no?
unlock THROTTLE.
unlock STEERING.
print "Node Executed. Have a nice day."