Advertisement
Guest User

FlyMeToTheMun 2.1

a guest
Jun 3rd, 2012
9,563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. function FlyMeToTheMunDriver(lat, lon)
  2.     print "Launching..."
  3.     mechjeb.launchTo(125000, 0)
  4.     wait(mechjeb.free)
  5.     mechjeb.autoStageActivate()
  6.     print "TMI..."
  7.     mechjeb.transfer("Mun", 200000)
  8.     wait(mechjeb.free)
  9.     print "Warping to SoI..."
  10.     mechjeb.warpToEvent("soi")
  11.     wait(mechjeb.free)
  12.     print "Warping to Pe..."
  13.     mechjeb.warpToEvent("pe", 30)
  14.     wait(mechjeb.free)
  15.     print "Circularizing orbit..."
  16.     mechjeb.circularize()
  17.     wait(mechjeb.free)
  18.     print "Landing..."
  19.     if (lat == nil or lon == nil) then
  20.         mechjeb.landAt(0, 0)
  21.     else
  22.         mechjeb.landAt(lat, lon)
  23.     end
  24.     wait(mechjeb.free)
  25.     mechjeb.autoStageDeactivate()
  26.     print "Landed!"
  27. end
  28.  
  29. function FlyMeToTheMun(lat, lon)
  30.     local co = coroutine.create(FlyMeToTheMunDriver)
  31.     coroutine.resume(co, lat, lon)
  32. end
  33.  
  34. print "Usage: FlyMeToTheMun(lat, lon)"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement