From 715ea14f46236d2dd2ca8251ee01035c9f9cc733 Mon Sep 17 00:00:00 2001 From: itzmarkoni Date: Sun, 15 Jun 2025 16:57:50 -0400 Subject: [PATCH] updated --- environment_driver.lua | 11 +++++++---- main.lua | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/environment_driver.lua b/environment_driver.lua index 904dc99..214c5fc 100644 --- a/environment_driver.lua +++ b/environment_driver.lua @@ -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 } \ No newline at end of file diff --git a/main.lua b/main.lua index 72d03e6..0e0c1c7 100644 --- a/main.lua +++ b/main.lua @@ -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")