This commit is contained in:
2025-06-14 13:44:15 -04:00
parent 83030e6869
commit 5a6bd7431c
3 changed files with 8 additions and 8 deletions

View File

@@ -18,15 +18,11 @@ local function watch(reactor, monitor)
end end
local function report(reactor, monitor) local function report(reactor, monitor)
if reactor then
local value = getValue(reactor) local value = getValue(reactor)
local color = color(reactor) local color = color(reactor)
configureReport(monitor) configureReport(monitor)
monitor.setBackgroundColor(color) monitor.setBackgroundColor(color)
monitor.write("Coolant: " .. value .. "%") monitor.write("Coolant: " .. value .. "%")
else
return "No reactor found"
end
end end
local function configureReport(monitor) local function configureReport(monitor)

View File

@@ -27,6 +27,14 @@ local function runDisplay()
end end
local function run() local function run()
while not reactor do
print("Waiting for reactor signal...")
end
while not monitor do
print("Waiting for monitor signal...")
end
parallel.waitForAll(runMonitors, runDisplay) parallel.waitForAll(runMonitors, runDisplay)
end end

View File

@@ -14,15 +14,11 @@ local function color(reactor)
end end
local function report(reactor, monitor) local function report(reactor, monitor)
if reactor then
local value = getValue(reactor) local value = getValue(reactor)
local color = color(reactor) local color = color(reactor)
configureReport(monitor) configureReport(monitor)
monitor.setBackgroundColor(color) monitor.setBackgroundColor(color)
monitor.write("Coolant: " .. value .. "%") monitor.write("Coolant: " .. value .. "%")
else
return "No reactor found"
end
end end
local function configureReport(monitor) local function configureReport(monitor)