Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Launch script to land on the Moon and return to Kerbin
- // Stage setup
- LOCK THROTTLE TO 1.
- LOCK STEERING TO HEADING(90, 90). // Launch eastward
- // Liftoff
- WAIT UNTIL ALTITUDE > 1000. // Wait for launch
- WAIT UNTIL SHIP:ALTITUDE > 25000. // Wait for gravity turn
- LOCK THROTTLE TO 0.8. // Reduce throttle for efficiency
- // Gravity turn
- WAIT UNTIL SHIP:ALTITUDE > 45000. // Continue gravity turn
- LOCK STEERING TO HEADING(90, 85). // Gradually turn eastward
- // Circularization
- WAIT UNTIL SHIP:PERIAPSIS > 70000. // Wait for desired apoapsis
- LOCK THROTTLE TO 0. // Cut engines
- // Translunar injection (TLI)
- WAIT 5. // Wait for coast
- LOCK THROTTLE TO 1. // Ignite engines
- WAIT UNTIL SHIP:PERIAPSIS > 70000. // Wait for desired apoapsis
- LOCK THROTTLE TO 0. // Cut engines
- // Moon approach
- LOCK STEERING TO PROGRADE. // Point towards prograde
- WAIT UNTIL SHIP:PERIAPSIS > 30000. // Start circularization burn
- LOCK THROTTLE TO 0.5. // Reduce throttle for precision
- // Lunar landing
- WAIT UNTIL SHIP:PERIAPSIS < 10000. // Start landing burn
- LOCK THROTTLE TO 0.2. // Reduce throttle for descent
- WAIT UNTIL SHIP:ALTITUDE < 1000. // Cut engines at low altitude
- LOCK THROTTLE TO 0. // Cut engines
- // Return to Kerbin
- LOCK STEERING TO UP. // Point towards Kerbin
- LOCK THROTTLE TO 1. // Ignite engines
- WAIT UNTIL SHIP:PERIAPSIS > 70000. // Wait for desired apoapsis
- LOCK THROTTLE TO 0. // Cut engines
- // Reentry and landing
- WAIT UNTIL SHIP:PERIAPSIS < 35000. // Start reentry burn
- LOCK STEERING TO HEADING(90, 90). // Point towards landing site
- LOCK THROTTLE TO 1. // Ignite engines for landing
- WAIT UNTIL ALTITUDE < 1000. // Cut engines at low altitude
- LOCK THROTTLE TO 0. // Cut engines
- // Mission complete
- PRINT "Mission complete! Welcome back to Kerbin!".
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement