kOS/boot/simustrap.ks

34 lines
611 B
Plaintext

function Antennas {
parameter enable is true.
local eventName is "Activate".
if not enable {
set eventName to "Deactivate".
}
for p in SHIP:PARTS {
if p:MODULES:Find("ModuleRTAntenna") > -1 and p:GetModule("ModuleRTAntenna"):ALLEVENTNAMES:Find(eventName) > -1 {
p:GetModule("ModuleRTAntenna"):DoEvent(eventName).
}
}
}
function SolarPanels {
parameter enable is true.
if enable {
PANELS on.
} else {
PANELS off.
}
}
wait until SHIP:UNPACKED.
wait 2.0.
Antennas().
SolarPanels().
wait until CONTROLCONNECTION:ISCONNECTED.
switch to 0.
RunPath("/reinstall").