Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //landing.ks
- // This program put your ship save on the ground (Or so we hope)!!
- SAS off.
- RCS on.
- lights on.
- lock throttle to 0.
- list engines in ENGList.
- clearscreen.
- set runmode to 1.
- until runmode = 0 {
- if runmode = 1 {
- lock steering to retrograde.
- set TVAL to 0.
- wait 5.
- set runmode to 2.
- }
- else if runmode = 2 {
- lock steering to retrograde.
- if SHIP:PERIAPSIS > -5000 {
- set TVAL to 1.
- }
- else if SHIP:PERIAPSIS < -5000 {
- set TVAL to 0.
- set runmode to 3.
- }
- }
- else if runmode = 3 {
- lock steering to retrograde.
- set TVAL to 0.
- if (ALT:RADAR > 6000) {
- if WARP = 0 {
- wait 1.
- SET WARP TO 3.
- }
- }
- else if ALT:RADAR < 6000 {
- SET WARP to 0.
- set runmode to 4.
- }
- }
- else if runmode = 4 {
- lock steering to retrograde.
- until ALT:RADAR < 5 {
- if -SHIP:VERTICALSPEED > ALT:RADAR/8 {
- set TVAL to MIN(1, TVAL + 0.01).
- }
- else {
- set TVAL to MAX(0, TVAL - 0.1).
- }
- wait 0.1.
- }
- if ALT:RADAR < 4 {
- set TVAL to 0.
- for eng in ENGList {
- if eng:stage = stage:number {
- eng:shutdown.
- }
- }
- set runmode to 10.
- }
- }
- else if runmode = 10 {
- set TVAL to 0.
- panels on.
- lights on.
- unlock steering.
- print "The eagle has landed!(OH YEAH!)".
- set runmode to 0.
- }
- global stagemaxthrust to ship:maxthrustat(0).
- when (ship:maxthrustat(0) < stagemaxthrust or (ship:maxthrustat(0) < 1)) then {
- if stage:ready {
- stage.
- wait 2.
- set throttle to TVAL.
- set stagemaxthrust to ship:maxthrustat(0).
- }
- if stage: number > 0 {
- preserve.
- }
- }
- set finalTVAL to TVAL.
- lock throttle to finalTVAL.
- print "RUNMODE: " + runmode + " " at (5,4).
- print "ALTITUDE: " + round(ALT:RADAR) + " " at (5,5).
- print "V-SPEED: " + round(SHIP:VERTICALSPEED) + " " at (5,6).
- print "PERIAPSIS: " + round(SHIP:PERIAPSIS) + " " at (5,7).
- }
Advertisement
Add Comment
Please, Sign In to add comment