Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Setting ship to known state
- set TVAL to 0.
- SAS off.
- RCS on.
- lights on.
- lock throttle to TVAL.
- gear off.
- PRINT "Counting down:".
- FROM {local countdown is 10.} UNTIL countdown = 0 STEP {SET countdown to countdown - 1.} DO {
- PRINT "..." + countdown.
- WAIT 1. // pauses the script here for 1 second.
- }
- clearscreen.
- set targetAp to 150000. //Target AP
- set targetPe to 150000. //target pe
- set runmode to 2.
- if ALT:RADAR < 50 {
- set runmode to 1.
- }
- if runmode = 1 {
- lock steering to UP.
- set TVAL to 1.
- PANELS off.
- wait 2.
- stage.
- set runmode to 2.
- if runmode = 2 {
- lock steering to heading(90,90).
- set TVAL to 1. }
- WAIT UNTIL SHIP:ALTITUDE > 10000. {
- set runmode to 3.
- }
- if runmode = 3 { //Turning time
- set targetPitch to max( 5, 90 * (1 - ALT:RADAR / 50000)).
- lock steering to heading (90, targetPitch).
- set TVAL to 1.
- if SHIP:APOAPSIS > targetAp {
- set runmode to 4.
- }
- }
- if runmode = 4 { // coast
- lock steering to heading ( 90,3).
- set TVAL to 0.
- if (SHIP:ALTITUDE > 70000) and (ETA:APOAPSIS > 60) and (VERTICALSPEED > 0) {
- if WARP = 0 {
- wait 1.
- set WARP to 3.
- }
- }.
- if ETA:APOAPSIS < 60 {
- set WARP to 0.
- set runmode to 5.
- }
- }
- if runmode = 5 { // PE burn start
- if ETA:APOAPSIS < 5 or VERTICALSPEED < 0 {
- set TVAL to 1.
- }
- if (SHIP:PERIAPSIS > targetPe) or (SHIP:PERIAPSIS > targetAp * 0.95) {
- set TVAL to 0.
- set runmode to 10.
- }
- }
- if runmode = 10 {
- set TVAL to 0.
- panels on.
- lights on.
- if RTADDON:AVAILABLE {
- SET p TO SHIP:PARTSNAMED("communotron32")[1].
- SET m to p:GETMODULE("ModuleRTAntenna").
- m:DOEVENT("activate").
- }
- unlock steering.
- print "Welcome to space! i hope!".
- }
- //Housekeeping
- if stage:Liquidfuel < 1 { // Staging if no fuel
- lock throttle to 0.
- wait 2.
- stage.
- wait 3.
- lock throttle to TVAL.
- }
- }
- //Printing!
- print "RUNMODE: " + runmode + " " at (5,4).
- print "ALTITUDE: " + round(SHIP:ALTITUDE) + " " at (5,5).
- print "APOAPSIS: " + round(SHIP:APOAPSIS) + " " at (5,6).
- print "PERIAPSIS: " + round(SHIP:PERIAPSIS) + " " at (5,7).
- print "ETA to AP: " + round(ETA:APOAPSIS) + " " at (5,8).
- print "Fuel Left: " + round(STAGE:LIQUIDFUEL) + " " at (5,9).
Advertisement
Add Comment
Please, Sign In to add comment