public void ButtonAscentGuidance(bool state) { MechJebCore activeJeb = vessel.GetMasterMechJeb(); if (activeJeb == null) { return; } MechJebModuleAscentAutopilot ap = activeJeb.GetComputerModule <MechJebModuleAscentAutopilot>(); if (ap == null) { return; } var agPilot = activeJeb.GetComputerModule <MechJebModuleAscentGuidance>(); if (agPilot != null) { if (ap.enabled) { ap.users.Remove(agPilot); } else { ap.users.Add(agPilot); } } }
private void AscentGuidance(int index, TextMenu.Item tmi) { UpdateJebReferences(); if (activeJeb != null) { MechJebModuleAscentAutopilot ap = activeJeb.GetComputerModule <MechJebModuleAscentAutopilot>(); if (ap == null) { return; } var agPilot = activeJeb.GetComputerModule <MechJebModuleAscentGuidance>(); if (agPilot != null) { if (ap.enabled) { ap.users.Remove(agPilot); } else { ap.users.Add(agPilot); } } } }
StringValue LaunchWithMechJeb(ScalarValue alt) { MechJebCore activejeb = utils.GetJeb(); MechJebModuleAscentAutopilot activeasc = activejeb?.GetComputerModule("MechJebModuleAscentAutopilot") as MechJebModuleAscentAutopilot; if (activeasc != null) { activeasc.desiredOrbitAltitude.val = alt; activeasc.enabled = true; return(""); } return("error: no Mechjeb found in this vessel"); }
public static void AscentIntoPlane() { MechJebCore activejeb = GetJeb(); if (activejeb != null) { MechJebModuleAscentAutopilot activeasc = activejeb.GetComputerModule("MechJebModuleAscentAutopilot") as MechJebModuleAscentAutopilot; if (activeasc != null) { activeasc.StartCountdown(activeasc.vesselState.time + LaunchTiming.TimeToPlane(activeasc.launchLANDifference, activeasc.vessel.mainBody, activeasc.vesselState.latitude, activeasc.vesselState.longitude, activeasc.core.target.TargetOrbit)); activeasc.enabled = true; } } }
public static void AscentRdzv(KRPC.SpaceCenter.Services.Vessel Targ) { MechJebCore activejeb = GetJeb(); if (activejeb != null) { MechJebModuleAscentAutopilot activeasc = activejeb.GetComputerModule("MechJebModuleAscentAutopilot") as MechJebModuleAscentAutopilot; if (activeasc != null) { activeasc.core.target.Set(Targ.InternalVessel); activeasc.core.vessel.targetObject = Targ.InternalVessel; activeasc.StartCountdown(activeasc.vesselState.time + LaunchTiming.TimeToPhaseAngle(activeasc.launchPhaseAngle, activeasc.vessel.mainBody, activeasc.vessel.longitude, activeasc.core.target.TargetOrbit)); activeasc.enabled = true; } } }
public static void AscentNow(double Alt, float Inc) { MechJebCore activejeb = GetJeb(); if (activejeb != null) { MechJebModuleAscentAutopilot activeasc = activejeb.GetComputerModule("MechJebModuleAscentAutopilot") as MechJebModuleAscentAutopilot; MechJebModuleAscentGuidance activegui = activejeb.GetComputerModule("MechJebModuleAscentGuidance") as MechJebModuleAscentGuidance; if (activeasc != null) { activegui.desiredInclination = Inc; activeasc.desiredOrbitAltitude.val = Alt; activeasc.desiredInclination = Inc; activeasc.enabled = true; } } }
public bool ButtonAscentGuidanceState() { MechJebCore activeJeb = vessel.GetMasterMechJeb(); if (activeJeb == null) { return(false); } MechJebModuleAscentAutopilot ap = activeJeb.GetComputerModule <MechJebModuleAscentAutopilot>(); if (ap == null) { return(false); } return(ap.enabled); }