Advertisement
Guest User

launch.ks

a guest
May 28th, 2015
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. //Set known configuration
  2. SAS off.
  3. RCS off.
  4. Lights off.
  5. lock throttle to 0.
  6. gear off.
  7.  
  8. clearscreen.
  9.  
  10. set targetApoapsis to 150000.
  11. set targetPeriapsis to 150000.
  12.  
  13. set runmode to 2. //Flying mode, just in case.
  14. if ALT:RADAR < 50 { //pad check
  15. set runmode to 1.
  16. }
  17.  
  18. until runmode = 0 {
  19.  
  20. if runmode = 1 {
  21. lock stering to up.
  22. stage.
  23. set TVAL to 1.
  24. wait 3.
  25. stage.
  26. set runmode to 2.
  27. }
  28.  
  29. else if runmode = 2 {
  30. lock steering to heading (90,90).
  31. set TVAL to 1.
  32. if SHIP:ALTITUDE > 8000 {
  33. set runmode to 3.
  34. }
  35. }
  36.  
  37. else if runmode = 3 {
  38. set targetPitch to max( 5, 90 * (1 - ship:altitude / 50000)).
  39. lock steering to heading ( 90, targetpitch).
  40. set TVAL to 1.
  41.  
  42. if SHIP:APOAPSIS > targetApoapsis {
  43. set runmode to 4.
  44. }
  45. }
  46.  
  47. else if runmode = 4 {
  48. lock steering to heading ( 90, 3).
  49. set TVAL to 0.
  50. if (SHIP:ALTITUDE > 70000) and (ETA:APOAPSIS > 60) and (VERTICALSPEED > 0) {
  51. if warp = 0 {
  52. wait 1.
  53. set warp to 3.
  54. }
  55. }
  56. else if ETA:APOAPSIS < 60 {
  57. set warp to 0.
  58. set runmode to 5.
  59. }
  60. }
  61.  
  62. else if runmode = 5 {
  63. if ETA:APOAPSIS < 5 or VERTICALSPEED < 0 {
  64. set TVAL to 1.
  65. }
  66. if (SHIP:PERIAPSIS > targetPeriapsis) or (SHIP:PERIAPSIS > targetApoapsis * 0.95) {
  67. set TVAL to 0.
  68. set runmode to 10.
  69. }
  70. }
  71.  
  72. else if runmode = 10 {
  73. set TVAL to 0.
  74. unlock steering.
  75. print "SHIP HAS REACHED ORBIT.".
  76. set runmode to 0.
  77. }
  78.  
  79. if STAGE:LIQUIDFUEL < 1 {
  80. stage.
  81. wait 2.
  82. stage.
  83. }
  84.  
  85. set finalTVAL to TVAL.
  86. lock throttle to finalTVAL.
  87.  
  88. print "RUNMODE: " + runmode + " " at (5,4).
  89. print "ALTITUDE: " + round(SHIP:ALTITUDE) + " " at (5,5).
  90. print "APOAPSIS: " + round(SHIP:APOAPSIS) + " " at (5,6).
  91. print "PERIAPSIS: " + round(SHIP:PERIAPSIS) + " " at (5,7).
  92. print "ETA to AP: " + round(ETA:APOAPSIS) + " " at (5,8).
  93.  
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement