Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Set known configuration
- SAS off.
- RCS off.
- Lights off.
- lock throttle to 0.
- gear off.
- clearscreen.
- set targetApoapsis to 150000.
- set targetPeriapsis to 150000.
- set runmode to 2. //Flying mode, just in case.
- if ALT:RADAR < 50 { //pad check
- set runmode to 1.
- }
- until runmode = 0 {
- if runmode = 1 {
- lock stering to up.
- stage.
- set TVAL to 1.
- wait 3.
- stage.
- set runmode to 2.
- }
- else if runmode = 2 {
- lock steering to heading (90,90).
- set TVAL to 1.
- if SHIP:ALTITUDE > 8000 {
- set runmode to 3.
- }
- }
- else if runmode = 3 {
- set targetPitch to max( 5, 90 * (1 - ship:altitude / 50000)).
- lock steering to heading ( 90, targetpitch).
- set TVAL to 1.
- if SHIP:APOAPSIS > targetApoapsis {
- set runmode to 4.
- }
- }
- else if runmode = 4 {
- 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.
- }
- }
- else if ETA:APOAPSIS < 60 {
- set warp to 0.
- set runmode to 5.
- }
- }
- else if runmode = 5 {
- if ETA:APOAPSIS < 5 or VERTICALSPEED < 0 {
- set TVAL to 1.
- }
- if (SHIP:PERIAPSIS > targetPeriapsis) or (SHIP:PERIAPSIS > targetApoapsis * 0.95) {
- set TVAL to 0.
- set runmode to 10.
- }
- }
- else if runmode = 10 {
- set TVAL to 0.
- unlock steering.
- print "SHIP HAS REACHED ORBIT.".
- set runmode to 0.
- }
- if STAGE:LIQUIDFUEL < 1 {
- stage.
- wait 2.
- stage.
- }
- set finalTVAL to TVAL.
- lock throttle to finalTVAL.
- 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).
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement