r4m0n

MechJeb Autom8 Scripts Megathread

Recommended Posts

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)"

i think i may have fixed it

i'm testing it right now

--
-- To Duna by B25Mitch
-- Remastered by Kickguy223
-- Version 1.0 Remastered
--
-- 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 "Warping to SoI (again)"
mechjeb.warpToEvent("SoI", 30)
wait(mechjeb.free)

print "Changing Ap and Pe To 234 "
mechjeb.changeApAndPe(234, 234)
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)"

i left your things in there because all i'm doing is fixing it (i have no experience with Lua, so this is a feat for me)

Share this post


Link to post
Share on other sites
i think i may have fixed it

i'm testing it right now

i left your things in there because all i'm doing is fixing it (i have no experience with Lua, so this is a feat for me)

It bounces back in to kerbin Soi for a little which messes up the whole sequence

currently end result an attempted solar landing

a check statment as to what body jeb is orbiting should be possible right?

nope maybe not

does anyone know how the new version of the protracter mod gets its closest approach calculation?

that would make a brute force lowering pe course to eve possible

Share this post


Link to post
Share on other sites

Hey Ramon, still on 2.0.6?

I ask because the forum was down, and the last updates goes fast...

:D

Share this post


Link to post
Share on other sites
Using Scripts

4. In the Autom8 console, type: dofile("something")

It doesn't list in the OP or in the linked wiki page how to access the Autom8 console.

Had a bit of a look around and a google, but not immediately apparent.

Also, the link to the main mechjeb thread is broken.

Share this post


Link to post
Share on other sites

I dont think this thread should be the only sticky one (besides rules). Please make more useful threads sticky, As MechJeb itself, and others, most downloaded ones.

Share this post


Link to post
Share on other sites
But... why would you need to do that in any sane case? Mechjeb can fly almost any ship perfectly already.

But mechjeb won't fire a set of engines separately if needed, mechjeb only fires what is in the current stage.

Share this post


Link to post
Share on other sites
Is autom8 dead in v2+ ?

Currently yes, but it's coming back.

Share this post


Link to post
Share on other sites

General question:

Does this only work for the currently active, controlled craft? If so:

I always wondered why there are no popular addons that allow to create automated drones etc that could continue functioning while not player controlled.

I know about the fact that non-controlled vehicles stop working in some aspects as soon as the player switches to another craft. Does this prevent what i suggested, without any possible way to circumvent?

Share this post


Link to post
Share on other sites

I have a minor request for a mechjeb coding addition: Would it be possible for the "Orbit Info" or "Landing Autopilot" or perhaps "Surface Info" to include a Re-entry angle computation? This would make it much easier to plan realistic re-entry manuevers and use add-ons such as Deadly Re-entry. If this is already in the code, my apologies, I haven't seen it.

If you really wanted to take it to the next level, a Re-entry Autopilot would be handy.

Thanks for what you do, Mechjeb definitely helps me automate a lot of things. Having played Orbiter for years on end, I can tell you hat this sort of computational assistance is very useful.

Share this post


Link to post
Share on other sites
Currently yes, but it's coming back.

Could you do it scriptless? Just record/replay options selected in the node planner, with the possible option of setting a fixed target or target via dialog. I'm a programmer but I never got into autom8 because I couldn't be bothered to learn the commands.

Share this post


Link to post
Share on other sites
How do I use the Spaceplane lander with the current v2 version??

You wait in orbit until the code for Autom8 2.0 is finished? :cool:

I'm another one who really needs Autom8 for my project. But with the way MJ2 has improved I can only guess that the new Autom8 is going to be awesome.

Share this post


Link to post
Share on other sites
Could you do it scriptless? Just record/replay options selected in the node planner, with the possible option of setting a fixed target or target via dialog. I'm a programmer but I never got into autom8 because I couldn't be bothered to learn the commands.

That would prevent the script from making any decisions based on what's happening during the flight, much less flexible

Share this post


Link to post
Share on other sites

KSP 1.0 is near release and Autom8 is still dead... ;.;

KOS works, but it's not an appropriate substitute...

Master of necromancy, anyone? :wink:

  • Like 1

Share this post


Link to post
Share on other sites

Is there a current alternative to Autom8?

I'm making a system and I don't want to EVER have to use a mouse during flight.

Currently trying to find a way to talk to MechJeb, but I'm having a ton of trouble. If I can see a working example I can get something that will work.

Hopefully this isn't dead. It looks really cool.

Share this post


Link to post
Share on other sites

Considering this mod died over two years ago, I wouldn't get my hopes up. :rolleyes:

Share this post


Link to post
Share on other sites

I would like to find a mod that can use and allow interplanetary transfers with continuous burns instead of Hohmann transfers... Any idea?

Share this post


Link to post
Share on other sites

There is a burn-under-timewarp mod, but I can't remember the name... it's in the master mod list in the main mod forum though.

Would be nice if someone exposed the api to a lua engine again, much as I admire the work on kOS I detest writing kOS code :P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now