This commit is contained in:
2025-06-15 16:57:50 -04:00
parent bea5ce7016
commit 715ea14f46
2 changed files with 10 additions and 5 deletions

View File

@@ -1,6 +1,8 @@
local function getValue()
return environment.getRadiation().radiation
local function getValue(env)
local value = env.getRadiation()
local stringValue = value.radiation .. value.unit
return stringValue
end
local function watch()
@@ -16,11 +18,12 @@ local function shutdown()
end
local function report()
local value = getValue()
local color = colors.black
monitor.setBackgroundColor(color)
setNewLine()
monitor.write("Radiation Level: " .. tostring(value))
monitor.write("Internal Radiation Level: " .. getValue(internalEnvironment))
setNewLine()
monitor.write("External Radiation Level: " .. getValue(externalEnvironment))
end
return { report = report, watch = watch, startUp = startUp, shutdown = shutdown }

View File

@@ -3,7 +3,9 @@ reactor = peripheral.find("fissionReactorLogicAdapter")
turbine = peripheral.find("turbineValve")
turbineVent = peripheral.find("turbineVent")
monitor = peripheral.find("monitor")
environment = peripheral.find("environmentDetector")
internalEnvironment = peripheral.find("environmentDetector_0")
externalEnvironment = peripheral.find("environmentDetector_1")
tempDriver = kernel.addDriver("temperature_driver")
coolantDriver = kernel.addDriver("coolant_driver")
statusDriver = kernel.addDriver("status_driver")