Don't like ads? PRO users don't see any ads ;-)
Guest

KMinO

By: Jontu on Aug 12th, 2012  |  syntax: Lua  |  size: 1.11 KB  |  hits: 134  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. --
  2. -- Script modified from FlyMeToTheMun by Jontu
  3. -- Original script by R4m0n
  4. --
  5. function KMinODriver(alt, malt)
  6.     print "Launching..."
  7.     mechjeb.launchTo(alt*1000, 0)
  8.     wait(mechjeb.free)
  9.     mechjeb.autoStageActivate()
  10.     print "TMI..."
  11.     mechjeb.transfer("Minmus", 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 KMinO(alt, malt)
  34.     local co = coroutine.create(KMinODriver)
  35.     coroutine.resume(co, alt, malt)
  36. end
  37.  
  38. print "Usage: KMinO(alt, malt)"
  39. print "alt is Kerbin Orbit Altitude in km"
  40. print "malt is Minmus Orbit Altitude in km"
  41. print " "      
  42. print "Warning: Insure that you do not transect Mun."