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

View File

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