Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CLEARSCREEN.
- LOCAL termWidth IS TERMINAL:WIDTH.
- set mode to 2.
- if ALT:RADAR < 100 {
- set mode to 1.
- }
- until mode = 0 { //mode 0 ends launch program
- if mode = 1 {
- print "Welcome Commander,".
- wait 5.
- print "Press ENTER to proceed with launch.".
- wait 1.
- print "Press BACKSPACE to abort.".
- set launchDecision to terminal:input:getchar().
- if launchDecision = terminal:input:enter {
- print "Proceeding with Launch Initialization...".
- wait 5.
- clearscreen.
- print "Loading Guidance and Launch initialization...".
- wait 5.
- set mode to 2.
- }
- if launchDecision = terminal:input:backspace {
- clearscreen.
- print "Aborting Launch Initialization...".
- wait 5.
- clearscreen.
- wait 5.
- set mode to 0.
- }
- }
- if mode = 2 { //mode 2 is launch initialization
- print "Counting down:".
- from {local countdown is 15.} until countdown = -1 step {set countdown to countdown -1.} do {
- if maxThrust < 1490 and countdown < 3 {
- clearscreen.
- print "ABORT MODE INITIATED.".
- set mode to 0.
- break.
- }
- print "..." + countdown.
- wait 1.
- WHEN COUNTDOWN = 10 THEN {
- STAGE. //hydrogen burn off
- }
- WHEN COUNTDOWN = 7 THEN {
- LOCK THROTTLE TO 0.3.
- }
- WHEN COUNTDOWN = 6 THEN {
- STAGE. //MES
- }
- WHEN COUNTDOWN = 5 THEN {
- LOCK THROTTLE TO 0.7.
- }
- WHEN COUNTDOWN = 3 THEN {
- LOCK THROTTLE TO 1.0.
- }
- WHEN COUNTDOWN = 4 THEN {
- LOCK STEERING TO HEADING (0,90).
- }
- WHEN COUNTDOWN = 0 THEN {
- STAGE.
- clearscreen.
- set mode to 3.
- }
- }
- }
- else if mode = 3 { //mode 3 is initial ascent and roll program.
- print ship:apoapsis.
- LOCK STEERING TO HEADING (0,90).
- WAIT 4.
- LOCK STEERING TO HEADING (35,90,180).
- WAIT 6.
- LOCK STEERING TO HEADING (35,85,180).
- wait 1.
- LOCK STEERING TO HEADING (35,80,180).
- WAIT 10.
- set mode to 4.
- }
- else if mode = 4 {
- UNTIL SHIP:ALTITUDE > 50000 {
- set targetPitch to max ( 15, 80 * (1 - ship:altitude / 50000)).
- LOCK STEERING TO HEADING (35, targetPitch, 180).
- }.
- UNTIL SHIP:ALTITUDE > 70000 {
- set targetPitch to max ( 5, 15 * (1 - ship:altitude / 70000)).
- LOCK STEERING TO HEADING (45, targetPitch, 180).
- }.
- set mode to 5.
- }
- else if mode = 5 {
- SET targetRoll to 180.
- UNTIL targetroll = 0 {
- lock steering to heading (45,24, targetRoll).
- wait 0.1.
- set targetRoll to targetRoll - 1.
- lock steering to heading (45,24, targetRoll).
- }
- UNTIL SHIP:APOAPSIS > 150000 {
- LOCK STEERING TO HEADING (45, 24, 0).
- }.
- UNTIL SHIP:PERIAPSIS > 25000 {
- lock throttle to 0.3.
- LOCK STEERING TO HEADING (45, 0, 0).
- }.
- set mode to 6.
- }
- else if mode = 6 {
- UNLOCK THROTTLE.
- LOCK THROTTLE TO 0.0.
- wait 30.
- sas on.
- rcs on.
- lock steering to ship:facing.
- wait 5.
- stage.
- wait 1.
- set ship:control:top to 1.
- wait 5.
- set ship:control:top to 0.
- WAIT 1.
- unlock steering.
- clearscreen.
- print "Launch Program Concluded".
- set mode to 0.
- }
- wait 0.
- print ("MODE: " + mode):padright(termWidth) at (5,4).
- PRINT ("Vertical speed: " + SHIP:VERTICALSPEED):PADRIGHT(termWidth) AT(5,5).
- PRINT ("Horizontal speed: " + VXCL(UP:VECTOR,SHIP:VELOCITY:SURFACE):MAG):PADRIGHT(termWidth) AT(5,6).
- PRINT ("Impact distance: " + ALT:RADAR):PADRIGHT(termWidth) AT(5,7).
- wait 0.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement