Advertisement
frytko

launch and circo

Apr 11th, 2023 (edited)
642
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function startup {
  2.      SET g TO KERBIN:MU / KERBIN:RADIUS^2.
  3.      LOCK accvec TO SHIP:SENSORS:ACC - SHIP:SENSORS:GRAV.
  4.      LOCK gforce TO accvec:MAG / g.
  5.      SET gforce_setpoint TO 1.2.
  6.      SET Kp TO 0.05.
  7.      LOCK dthrott TO Kp * (gforce_setpoint - gforce).}
  8.  
  9.  
  10. startup().
  11.  
  12. SET thrott TO 1.
  13. LOCK THROTTLE to thrott.
  14. set x to 7.32602*10^(-9)*ship:altitude^2 - 0.00168158*ship:altitude + 94.6117.
  15. LOCK STEERING TO HEADING(90,87).
  16.  
  17. rcs on.wait 1.STAGE.
  18.  
  19. when ship:altitude > 4000 then{
  20.     set x to 7.32602*10^(-9)*ship:altitude^2 - 0.00168158*ship:altitude + 94.6117.
  21.     LOCK STEERING TO HEADING(90,x).
  22.     when ship:maxthrustat(0) < 1 then {STAGE. wait .5.}
  23.     when SHIP:APOAPSIS >90000 then {LOCK THROTTLE TO 0.}
  24.     }
  25. when ship:altitude > 50000 and ship:apoapsis < 90000 then{ lock throttle to .5. wait until ship:apoapsis > 90000. lock throttle to 0.}
  26.  
  27. when ship:maxthrustat(0) < 1 then {STAGE.wait.5.}
  28.  
  29. When Eta:apoapsis < 25 then {
  30.   lock throttle to 75000 - ship:periapsis.
  31.   when ship:maxthrustat(0) < 1 then {STAGE.wait.5.}
  32.   when ship:apoapsis>95000 then {lock throttle to 0.
  33.     when Eta:apoapsis < 25 then {
  34.       set throttle to 75000 - ship:periapsis.}
  35.     }
  36.   }
  37.  
Tags: Script KOS Kerbal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement