-
-
Save anonymous/2e5a906eeb5a407598cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sas off. | |
print "[STATUS] Executing maneuver node.". | |
set n to nextnode. | |
set maxtwr to ship:maxthrust / ship:mass. | |
set dob to n:deltav:mag / maxtwr. | |
print "[DEBUG] Burn duration: " + dob. | |
lock steering to n:deltav. | |
wait until n:eta < dob / 2. | |
set remaining_time to n:deltav:mag / (throttle * ship:maxthrust / ship:mass). | |
print "foo " + remaining_time. | |
lock throttle to 1. | |
until remaining_time < 3 { | |
set remaining_time to n:deltav:mag / (throttle * ship:maxthrust / ship:mass). | |
print "foo " + remaining_time. | |
}. | |
lock throttle to (remaining_time / 3). | |
until remaining_time < 1 { | |
set remaining_time to n:deltav:mag / (throttle * ship:maxthrust / ship:mass). | |
print "foo " + remaining_time. | |
}. | |
lock throttle to 0.3. | |
until remaining_time < 0.1 { | |
set remaining_time to n:deltav:mag / (throttle * ship:maxthrust / ship:mass). | |
print remaining_time. | |
print "foo " + remaining_time. | |
}. | |
lock throttle to 0. | |
unlock throttle. | |
unlock steering. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment