MechJeb#

Provides functionality to interact with the MechJeb mod. Tested with MechJeb 2.15.4.0. Originally written by Genhis. The service acts on the MechJeb of the active vessel, which needs a part with MechJeb. Its classes follow MechJeb’s windows: a setting is found under the window that shows it.

Example#

The following example launches the active vessel into a 100 km orbit, inclined at 6 degrees, with Ascent Guidance, and waits for the ascent to finish:

local krpc = require 'krpc'
local socket = require 'socket'

local conn = krpc.connect('MechJeb Example')
local vessel = conn.space_center.active_vessel
local ascent = conn.mech_jeb.ascent_guidance

ascent.desired_orbit_altitude = 100000
ascent.desired_inclination = 6
ascent.settings.autostage = true
ascent.enabled = true

vessel.control:activate_next_stage()

while ascent.enabled do
  socket.sleep(1)
end

print('Launch complete')