Jump to content

B25Mitch

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by B25Mitch

  1. Not sure if I should post it here or in general MechJeb, but sometimes when running Autom8 programs, I do something else in another window. For some reason, the auto-warp on "coasting to apoapsis" on the Ascent Autopilot does not activate when you are not focused on the window. Then you click on Kerbal and it ramps up the warp like normal. Every other auto-warp works fine, just not Ascent Autopilot. Does anybody else have/can recreate this problem?
  2. Three thoughts. If we improve a script, how should we deal with that? Just update the PasteBin and tell R4m0n that it's now v2.0 or whatever, or make an entirely new file? Secondly, I'd love to see a mechjeb.warp(int factor) or something similar, so we can automatically induce time warp. Lastly, I'd also like to see a way to modify the ascent path for the Ascent Autopilot.
  3. I absolutely love this Autom8 stuff. Here's a thrown together script to get you to Duna. Not sure if it will work... -- -- To Duna by B25Mitch -- Version 1.0 -- -- for MechJeb 1.9.3 -- -------------------------------------------------------- -- Usage: * save to KSP/PluginData/mumechlib/toduna.lua -- * in game, open autom8 -- * enter: dofile("toduna.lua") -- * and follow the instructions. -------------------------------------------------------- function ToDunaDriver(lat, lon) print "Launching..." mechjeb.launchTo(125000, 0) wait(mechjeb.free) mechjeb.autoStageActivate() print "Changing Apoapsis to outside Kerbin SoI" mechjeb.changeAp(90000000) wait(mechjeb.free) print "Warping to SoI" mechjeb.warpToEvent("SoI", 30) wait(mechjeb.free) print "Circularizing orbit." mechjeb.circularize() wait(mechjeb.free) print "Transferring to Duna" mechjeb.transfer("Duna", 200000) wait(mechjeb.free) print "Circularizing Orbit." mechjeb.circularize() wait(mechjeb.free) print "Landing..." if (lat == nil or lon == nil) then mechjeb.landAt(0, 0) else mechjeb.landAt(lat, lon) end wait(mechjeb.free) mechjeb.autoStageDeactivate() print "Landed!" end function ToDuna(lat, lon) local co = coroutine.create(ToDunaDriver) coroutine.resume(co, lat, lon) end print "Usage: ToDuna(lat, lon)"
  4. I created one with 3 functions called Kerbin to Mun and Back, "kerbintomun.lua". Kerbin to Mun (Credit to R4m0n), Mun to Kerbin (Credit to Olex), and Round Trip, that lands you on the mun, waits 30 seconds, and brings you back to Kerbin. Functions are: GoMun(lat, lon) (leaving them blank lands you at (0, 14)) GoKerbin(lat, lon) (leaving them blank land you at the KSC) RoundTrip(munlat, munlon, kerblat, kerblon) (leaving them blank uses the defaults listed above) I'm currently working on a ship that works perfectly with the Round Trip function. Should I post that here or in the ship exchange? http://pastebin.com/GzrWa82t -- -- Kerbin to Mun and Back by B25Mich -- Version 1.0 -- -- for MechJeb 1.9.1 -- -------------------------------------------------------- -- Usage: * save to KSP/PluginData/mumechlib/kerbintomun.lua -- * in game, open autom8 -- * enter: dofile("kerbintomun.lua") -- * and follow the instructions. -------------------------------------------------------- function GoMunDriver(lat, lon) print "Launching..." mechjeb.launchTo(125000, 0) wait(mechjeb.free) mechjeb.autoStageActivate() print "TMI..." mechjeb.transfer("Mun", 200000) wait(mechjeb.free) print "Warping to SoI..." mechjeb.warpToEvent("soi") wait(mechjeb.free) print "Warping to Pe..." mechjeb.warpToEvent("pe", 30) wait(mechjeb.free) print "Circularizing orbit..." mechjeb.circularize() wait(mechjeb.free) print "Landing..." if (lat == nil or lon == nil) then mechjeb.landAt(0, 14) else mechjeb.landAt(lat, lon) end wait(mechjeb.free) mechjeb.autoStageDeactivate() print "Landed!" end function GoKerbinDriver(lat, lon) print "Lifting off..." mechjeb.attitudeTo("up", "SURFACE_NORTH") -- vertical ascent mechjeb.thrustActivate(100) while vessel.altitudeTrue < 300 do wait(0.25) end print "Escaping the Mun..." -- this needs to be optimized. figure out an escape vector -- that is as close as possible to the opposite of Mun's orbital velocity -- but not lower than 0° to the surface mechjeb.attitudeTo("right", "SURFACE_NORTH") -- heading east while vessel.orbitEccentricity < 1 do wait(0.25) end mechjeb.thrustDeactivate() print "Coasting to Mun escape, hang on." mechjeb.warpToEvent("soi") wait(mechjeb.free) print("Lowering Kerbin periapsis to 100 km...") mechjeb.changePe(100 * 1000) wait(mechjeb.free) print "Warping to Pe..." mechjeb.warpToEvent("pe", 30) wait(mechjeb.free) print "Circularizing orbit..." mechjeb.circularize() wait(mechjeb.free) print "Re-entry... hold onto something." mechjeb.landAt(-0.103, -74.575) wait(mechjeb.free) mechjeb.autoStageDeactivate() print "Landed!" end function WaitForLandingDriver(lat, lon) wait(30) while vessel.altitudeBottom > 5 do wait(5) end print "Prepare for launch." wait(30) local co = coroutine.create(GoKerbinDriver) coroutine.resume(co, lat, lon) end function GoKerbin(lat, lon) local co = coroutine.create(GoKerbinDriver) coroutine.resume(co, lat, lon) end function GoMun(lat, lon) local co = coroutine.create(GoMunDriver) coroutine.resume(co, lat, lon) end function RoundTrip(munlat, munlon, kerblat, kerblon) local co1 = coroutine.create(GoMunDriver) coroutine.resume(co1, munlat, munlon) local co2 = coroutine.create(WaitForLandingDriver) coroutine.resume(co2, kerblat, kerblon) end print "Usage: GoMun(lat, lon)" print "Usage: GoKerbin(lat, lon)" print "Usage: RoundTrip(munlat, munlon, kerbinlat, kerbinlon)"
  5. With Olex's permission, I'd like to post a slightly modified version of his code that takes in a lat and long and will take you from the Mun and land at that point on Kerbin.
×
×
  • Create New...