Advertisement
Guest User

geostat.ks 2.0

a guest
Jan 5th, 2015
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. LIST ENGINES IN engines.
  2.  
  3. set laststage to 0.
  4.  
  5. SET countdown to 10.
  6.  
  7. lock steering to up + R(0,0,180).
  8. lock throttle to 1.
  9.  
  10. until countdown=0 {
  11.     set countdown to countdown-1.
  12.     clearscreen.
  13.     print countdown+" seconds to launch.".
  14.    
  15.     wait 1.
  16. }
  17. print " ".
  18. print " ".
  19. print " ".
  20.  
  21. //autostaging
  22. set stageneeded to true.
  23. when stageneeded and TIME:SECONDS>laststage+2 then {stage. print "Stage separated.". set stageneeded to false. preserve.}.
  24. when maxthrust = 0 and not stageneeded then { stage. print "Staging...". set stageneeded to true. set laststage to TIME:SECONDS. preserve.}.
  25. //end autostaging
  26.  
  27. set orbitalt to 2868.75*1000.
  28.  
  29. set planningnode to false.
  30. set nodeplanned to false.
  31.  
  32. when altitude > 10000 then {lock steering to up + R(0,0,180) + R(0,-30,0).
  33.     when altitude > 20000 then {lock steering to up + R(0,0,180) + R(0,-60,0).
  34.         when altitude > 71000 then {PANELS ON. print "Extending solar panels...".}.
  35.     }.
  36. }.
  37.  
  38. when apoapsis > orbitalt-orbitalt/5 then {lock throttle to 0.3.
  39.     when apoapsis > orbitalt-orbitalt/10 then {lock throttle to 0.1.
  40.         when apoapsis > orbitalt-orbitalt/20 then {lock throttle to 0.01.
  41.             when apoapsis > orbitalt then {lock throttle to 0. print "ENGINE OFF". set planningnode to true.
  42.                 when planningnode then {
  43.                     print "Start orbit adjustament program...".
  44.                     set orbitalvelocity to sqrt((3.5316*10^12)/(orbitalt+600000)).
  45.                     print "Orbital Velocity = " + round(orbitalvelocity,1) + "m/s".
  46.                     SET deltav TO orbitalvelocity-(velocityat(ship, time:seconds+(eta:apoapsis)):orbit:mag).
  47.                     SET node TO NODE(time:seconds+eta:apoapsis, 0, 0, deltav).
  48.                     ADD node.
  49.                     print "Maneuver node planned.".
  50.                     set nodeplanned to true.
  51.                 }.
  52.             }.
  53.         }.
  54.     }.
  55. }.
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62. //GRAPHICS
  63. print "APOAPSIS:" at(0,0).
  64. print "0%|------------------------------------------|100%" at(0,1).
  65. print "ALTITUDE:" at(0,2).
  66. print "0%|------------------------------------------|100%" at(0,3).
  67. until nodeplanned {
  68.     print "=" at((apoapsis*41/orbitalt)+3,1).
  69.     print "=" at((altitude*41/orbitalt)+3,3).
  70.    
  71.     //Autostaging for radial engines
  72.     FOR eng IN engines {
  73.    
  74.         if eng:flameout and eng:thrust = 0 {
  75.             stage.
  76.             LIST ENGINES IN engines.
  77.         }.
  78.     }.
  79.     wait .5.
  80. }.
  81.  
  82. //END GRAPHICS
  83.  
  84. lock throttle to 0.
  85. unlock throttle.
  86. unlock steering.
  87.  
  88. run execnode.
  89.  
  90. lock throttle to 0.
  91. unlock throttle.
  92. unlock steering.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement