Advertisement
Jontu

KMunO

Aug 12th, 2012
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. --
  2. -- Script modified from FlyMeToTheMun by Jontu
  3. -- Original script by R4m0n
  4. --
  5. function KMunODriver(alt, malt)
  6.     print "Launching..."
  7.     mechjeb.launchTo(alt*1000, 0)
  8.     wait(mechjeb.free)
  9.     mechjeb.autoStageActivate()
  10.     print "TMI..."
  11.     mechjeb.transfer("Mun", 200000)
  12.     wait(mechjeb.free)
  13.     print "Warping to SoI..."
  14.     mechjeb.warpToEvent("soi")
  15.     wait(mechjeb.free)
  16.     mechjeb.autoStageActivate()
  17.     print "Adjusting Pe"
  18.     mechjeb.changePe(malt*1000)
  19.     wait(mechjeb.free)
  20.     print "Warping to Pe..."
  21.     mechjeb.warpToEvent("pe", 30)
  22.     wait(mechjeb.free)
  23.     print "Circularizing orbit..."
  24.     mechjeb.circularize()
  25.     wait(mechjeb.free)
  26.     mechjeb.autoStageDeactivate()
  27.     print "Orbit Achieved"
  28.     m = mechjeb.getModule("OrbitOper")
  29.     m.enabled = false
  30.  
  31. end
  32.  
  33. function KMunO(alt, malt)
  34.     local co = coroutine.create(KMunODriver)
  35.     coroutine.resume(co, alt, malt)
  36. end
  37.  
  38. print "Usage: KMunO(alt, malt)"
  39. print "alt is Kerbin Orbit Altitude in km"
  40. print "malt is Mun Orbit Altitude in km"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement