Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- -- Script by Jontu
- -- Deorbit script from "GoHome" by olex, essential to this script!
- --
- function HomeDriver()
- print "Lifting off..."
- mechjeb.autoStageActivate()
- mechjeb.launchTo(10000, 0) --orbit
- wait(mechjeb.free)
- print "Moving to deorbit burn point..."
- print "Prepare to abort warp!"
- print "-45 lon for Mun."
- print "+20 lon for Minmus."
- mechjeb.warpToEvent("Soi")
- --wait(vessel.Longitude == -44) value not available yet
- --mechjeb.controlRelease() Need way to kill time warp
- wait(mechjeb.free)
- print "Executing deorbit burn..."
- mechjeb.attitudeTo("forward", "orbit")
- mechjeb.thrustActivate(100)
- --
- -- Only possible with this idea from olex
- --
- while vessel.orbitEccentricity < 1 do
- wait(0.25)
- end
- mechjeb.thrustDeactivate()
- print "Warping to Mun escape..."
- mechjeb.warpToEvent("soi")
- wait(mechjeb.free)
- print "Adjusting Pe..."
- mechjeb.changePe(30000)
- wait(mechjeb.free)
- print "Warping to Kerbin..."
- mechjeb.warpToEvent("Pe")
- --wait(vessel.atmosphericDensity <= 0)
- while vessel.atmosphericDensity <= 0 do
- wait(0.25)
- end
- wait(1)
- print "Entering atmosphere..."
- mechjeb.controlRelease()-- would like a way to close this window
- --wait(vessel.altitudeASL < 20000)
- while vessel.altitudeASL > 20000 do
- wait(0.25)
- end
- print "Landing..."
- mechjeb.autoStageActivate()
- mechjeb.land()
- wait(mechjeb.free)
- print "Home again, home again"
- end
- function Home()
- local co = coroutine.create(HomeDriver)
- coroutine.resume(co)
- end
- print "Usage: Home()"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement