Set up code for quickly handling antennas and solar panels.
This commit is contained in:
parent
27ad3c11d7
commit
081fcb3618
5 changed files with 108 additions and 36 deletions
25
lib/systems.ks
Normal file
25
lib/systems.ks
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
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.
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue