Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. run gravity_calculator.
  2. run suicide_burn_calculator.
  3.  
  4. clearscreen.
  5.  
  6. wait 1.
  7. sas on.
  8.  
  9. set vLand to -4.
  10. set runmode to 7.
  11. set thrust to ship:maxthrust.
  12. set counter to 0.
  13.  
  14. lock h to alt:radar.
  15. lock vd to ship:verticalspeed.
  16. lock vDiff to (vLand - vd).
  17.  
  18. lock TimeToBurn to ((suicide_burn_calculator(1.05)-h)/vd).
  19. lock ZeroAccelThrust to ((Ship:mass*g)/thrust).
  20.  
  21. until runmode = 6 {
  22.     set g to -gravity_calculator().
  23.    
  24.     if runmode = 7 {
  25.         set TVAL to 0.
  26.         if h > 5000 {
  27.             lock steering to retrograde.
  28.             }
  29.         if h < 50000 {
  30.             ag3 on.
  31.             lock steering to srfretrograde.
  32.             set runmode to 8.
  33.             }
  34.     }
  35.    
  36.     if runmode = 8 {
  37.         if h < (suicide_burn_calculator(1.05) - vd) {
  38.             set TVAL to 1.
  39.             RCS on.
  40.             }
  41.         else {
  42.             set TVAL to 0.
  43.             }
  44.         if h/-vd < 2 {
  45.             brakes off.
  46.             }
  47.         if alt:radar < 400 {
  48.             gear on.
  49.             }
  50.         if vd > -6 {
  51.             lock steering to up.
  52.             set runmode to 9.
  53.             }
  54.         }
  55.    
  56.     if runmode = 9 {
  57.         if vDiff > 0 {
  58.             set TVAL to (ZeroAccelThrust + 0.1).
  59.             }
  60.         if vDiff < 0 {
  61.             set TVAL to (ZeroAccelThrust - 0.1).
  62.             }
  63.         if vd > -0.1 and h < 100 {
  64.             set counter to counter + 1.
  65.             wait 0.1.
  66.             }
  67.         if counter > 20 {
  68.             set runmode to 6.
  69.             }
  70.         }
  71.    
  72.     lock throttle to TVAL.
  73.    
  74.     print "Vertical Velocity:               " + round(vd, 2) + "                " at (5,4).
  75.     print "Required Burn Height:            " + round(suicide_burn_calculator(1.1), 2) + "                  " at (5,5).
  76.     print "Time to Required Burn            " + round(TimeToBurn, 2) + "        " at (5,6).
  77.     print "Runmode:                         " + runmode + "                     " at (5,7).
  78.     print "Gravitational Acceleration:      " + round(g, 2) + "                 " at (5,8).
  79.    
  80.     }
  81.  
  82. if runmode = 6 {
  83.     set TVAL to 0.
  84.     unlock throttle.
  85.     clearscreen.
  86.     print "Landing Complete" at (5,4).
  87.     wait 1.
  88.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement