Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clearscreen.
- sas off.
- set xBurn to 0.
- set sRetro to 0.
- set touchDown to 0.
- set loopTime to 0.
- set iFlag to 0.
- set tImpact to 99.
- set brakeTime to 0.
- set final to 0.
- set Fd to 0.
- set sBurn to 0.
- set vsx to 0.
- set vsy to 0.
- set vsz to 0.
- set TWR to maxthrust / (mass*9.81).
- set tTWR to 0.
- set hTerrain to 0.
- set inputFlag to 0.
- set bitMask to " ".
- print "Landing Sequence activated.".
- wait 1.
- toggle gear.
- lock throttle to (tTWR * 9.81 * mass / maxthrust).
- lock steering to retrograde + R(0,0,-90).
- print "Use Action Group 7 to begin Retro Burn.".
- print "Use Action Group 9 to Cancel.".
- until inputFlag = 1
- {
- if ag7 = "True" { set inputFlag to 1. toggle ag7. }.
- if ag9 = "True" { toggle ag9. print garbage. }.
- }.
- clearscreen.
- print "Begin retro burn.".
- set tTWR to 2.
- when periapsis < 20000 then
- {
- set tTWR to 0.
- set xBurn to 1.
- if altitude > 70000 { wait 1. set warp to 3. }.
- wait 1.
- }.
- wait until xBurn = 1.
- when altitude < 36000 then lock steering to R(0,0,0) + V(vsx,vsy,vsz).
- when (altitude-hTerrain) < 1000 then set iFlag to 1.
- when brakeTime > tImpact AND verticalspeed < 0 then
- {
- set sBurn to 1.
- when surfacespeed < 3 then set tTWR to 2.
- when surfacespeed < .001 then lock steering to up.
- when verticalspeed > -10 then
- {
- set sBurn to 0.
- set tTWR to 0.
- toggle gear.
- set final to 1.
- }.
- }.
- until touchDown = 1
- {
- set t1 to missiontime.
- set vs to velocity:surface.
- set vsx to 0 - vs:x.
- set vsy to 0 - vs:y.
- set vsz to 0 - vs:z.
- set TWR to maxthrust / (mass*9.81).
- set cTWR to (TWR * throttle).
- set negAltC to ((0-altitude)/5000).
- set atmP to (2.718^negAltC).
- set atmD to atmP * 1.2230948554874.
- set Fd to 0.5 * atmD * abs(verticalspeed)^2 * 0.2 * (mass*.008).
- set aTWR to TWR - (Fd/1000).
- if alt:radar < 0 { set hTerrain to 0. }.
- if alt:radar > 0 { set hTerrain to (altitude - alt:radar). }.
- if iFlag = 1
- {
- print "Terrain height is " + hTerrain at (0,17).
- set tImpact to (altitude-hTerrain) / abs(verticalspeed).
- set brakeTime to abs(verticalspeed) / (TWR*9.81).
- }.
- if sBurn = 1 { set tTWR to aTWR. }.
- if final = 1
- {
- if status = "LANDED" OR status = "SPLASHED" { set touchDown to 1. }.
- if (altitude-hTerrain) > 30 { set deThrottle to -10. }.
- if (altitude-hTerrain) < 30 { set deThrottle to -2. }.
- if verticalspeed < deThrottle { set tTWR to 1.2. }.
- if verticalspeed > deThrottle { set tTWR to .95. }.
- }.
- print "Impact in T-" + tImpact + bitMask at (0,5).
- print "Time to 0m/s " + brakeTime + bitMask at (0,7).
- print "Radar Alt " + (altitude-hTerrain) + bitMask at (0,9).
- print "Status " + status + bitMask at (0,11).
- print "Looptime " + loopTime + bitMask at (0,13).
- print "Force of Drag " + Fd + bitMask at (0,15).
- set t2 to missiontime.
- set loopTime to t2 - t1.
- }.
- sas on.
- print status.
- lock throttle to 0.
- wait 2.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement