Guest User

launchatorbit.ks

a guest
Jan 4th, 2015
1,428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DECLARE PARAMETER orbitalt.
  2. LIST ENGINES IN engines.
  3. set orbitalt to orbitalt*1000.
  4.  
  5.  
  6. clearscreen.
  7. print "
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.                      ###
  23.                      # #
  24.                      ###
  25.                        #
  26.                      ### ".
  27. wait 1.
  28. clearscreen.
  29. print "
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.                      ###
  45.                      # #
  46.                      ###
  47.                      # #
  48.                      ### ".
  49. wait 1.
  50. clearscreen.
  51. print "
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.                      ###
  67.                        #
  68.                        #
  69.                        #
  70.                        # ".
  71. wait 1.
  72. clearscreen.
  73. print "
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.                      ###
  89.                      #  
  90.                      ###
  91.                      # #
  92.                      ### ".
  93. wait 1.
  94. clearscreen.
  95. print "
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.                      ###
  111.                      #  
  112.                      ###
  113.                        #
  114.                      ### ".
  115. wait 1.
  116. clearscreen.
  117. print "
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.                      # #
  133.                      # #
  134.                      ###
  135.                        #
  136.                        # ".
  137. wait 1.
  138. clearscreen.
  139. print "
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.                      ###
  155.                        #
  156.                      ###
  157.                        #
  158.                      ### ".
  159. wait 1.
  160. clearscreen.
  161. print "
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.                      ###
  177.                        #
  178.                      ###
  179.                      #  
  180.                      ### ".
  181. wait 1.
  182. lock steering to up + R(0,0,180).
  183. clearscreen.
  184. print "
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.                        #
  200.                        #
  201.                        #
  202.                        #
  203.                        # ".
  204. wait 1.
  205. lock throttle to 1.
  206. clearscreen.
  207. print "
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.                      ###
  223.                      # #
  224.                      # #
  225.                      # #
  226.                      ### ".
  227. wait 1.
  228. clearscreen.
  229. stage.
  230. print "
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.                                                  
  246.             #    #  # # ###  ## # #  #  
  247.             #   # # # # # # #   # #  #  
  248.             #   ### # # # # #   ###  #  
  249.             #   # # # # # # #   # #    
  250.             ### # # ### # #  ## # #  # ".
  251. wait 1.
  252. clearscreen.
  253.  
  254. until altitude > 10000
  255. {
  256. clearscreen.
  257. print "##################CONTROL PANEL##################".
  258. print " First step: reach middle atmosphere.".
  259. print " ".
  260. print "      ALTITUDE: " + round(ALTITUDE, 2).
  261. print "     TO GROUND: " + round(ALT:RADAR,2).
  262. print "-------------------------------------------------".
  263. print "VERTICAL SPEED: " + round(VERTICALSPEED,2).
  264. print "      APOAPSIS: " + round(APOAPSIS,2).
  265. wait .5.
  266. if maxthrust = 0 { stage. print "Staging...". wait 2. stage.}
  267.  
  268. SET stageneeded TO false.
  269. FOR eng IN engines {
  270.    
  271.     if eng:flameout and eng:thrust = 0
  272.     {
  273.         set stageneeded to true.
  274.     }
  275. }.
  276. if stageneeded {stage. print "Stage separeted.". wait 2. list engines in engines.}.
  277. }
  278. lock steering to up + R(0,0,180) + R(0,-30,0).
  279.  
  280. until altitude > 20000
  281. {
  282. clearscreen.
  283. print "##################CONTROL PANEL##################".
  284. print " Second step: begin gravity turn.".
  285. print " ".
  286. print "      ALTITUDE: " + round(ALTITUDE, 2).
  287. print "     TO GROUND: " + round(ALT:RADAR,2).
  288. print "-------------------------------------------------".
  289. print "VERTICAL SPEED: " + round(VERTICALSPEED,2).
  290. print "      APOAPSIS: " + round(APOAPSIS,2).
  291. wait .5.
  292. if maxthrust = 0 { stage. print "Staging...". wait 2. stage.}
  293.  
  294. SET stageneeded TO false.
  295. FOR eng IN engines {
  296.    
  297.     if eng:flameout and eng:thrust = 0
  298.     {
  299.         set stageneeded to true.
  300.     }
  301. }.
  302. if stageneeded {stage. print "Stage separeted.". wait 2. list engines in engines.}.
  303. }
  304. lock steering to up + R(0,0,180) + R(0,-60,0).
  305.  
  306. until apoapsis > orbitalt-orbitalt/10
  307. {
  308. clearscreen.
  309. print "##################CONTROL PANEL##################".
  310. print " Third step: target apoapsis = "+ round(orbitalt/1000,0) + "km".
  311. print " ".
  312. print "      ALTITUDE: " + round(ALTITUDE, 2).
  313. print "     TO GROUND: " + round(ALT:RADAR,2).
  314. print "-------------------------------------------------".
  315. print "VERTICAL SPEED: " + round(VERTICALSPEED,2).
  316. print "      APOAPSIS: " + round(APOAPSIS,2).
  317. wait .5.
  318. if maxthrust = 0 { stage. print "Staging...". wait 2. stage.}
  319.  
  320. SET stageneeded TO false.
  321. FOR eng IN engines {
  322.    
  323.     if eng:flameout and eng:thrust = 0
  324.     {
  325.         set stageneeded to true.
  326.     }
  327. }.
  328. if stageneeded {stage. print "Stage separeted.". wait 2. list engines in engines.}.
  329. }
  330. clearscreen.
  331. print "Wait please...".
  332.  
  333. lock throttle to 0.5.
  334. wait until apoapsis > orbitalt-orbitalt/50.
  335. lock throttle to 0.1.
  336. wait until apoapsis >= orbitalt+200.
  337.  
  338. print "ENGINE OFF".
  339. lock throttle to 0.
  340. print "STANDBY UNTIL APOAPSIS.".
  341. wait until altitude > 76000.
  342.  
  343. print "Extending solar panels...".
  344. PANELS ON.
  345.  
  346. print "Start orbit adjustament program...".
  347.  
  348. set orbitalvelocity to sqrt(((3.5316*10^12)/(orbitalt+600000)^2)*(600000+orbitalt)).
  349.  
  350. print "Orbital Velocity = " + round(orbitalvelocity,1) + "m/s".
  351.  
  352. SET deltav TO orbitalvelocity-(velocityat(ship, time:seconds+(eta:apoapsis)):orbit:mag).
  353.  
  354. SET node TO NODE(time:seconds+eta:apoapsis, 0, 0, deltav).
  355. ADD node.
  356.  
  357. print "Maneuver node planned.".
  358.  
  359. lock throttle to 0.
  360. unlock throttle.
  361. unlock steering.
  362.  
  363. run execnode.
  364.  
  365. lock throttle to 0.
  366. unlock throttle.
  367. unlock steering.
Advertisement
Add Comment
Please, Sign In to add comment