added status driver

This commit is contained in:
2025-06-14 14:16:32 -04:00
parent 660a5ae85a
commit 28203cac8b
2 changed files with 26 additions and 0 deletions

23
status_driver.lua Normal file
View File

@@ -0,0 +1,23 @@
local function getValue(reactor)
return reactor.Status() or false
end
local function color(reactor)
local value = getValue(reactor)
return colors.black
end
local function watch(reactor, monitor)
print("Status: " .. getValue(reactor))
sleep(1)
end
local function report(reactor, monitor)
local value = getValue(reactor)
local color = color(reactor)
monitor.setBackgroundColor(color)
monitor.clearLine()
monitor.write("Reactor Status: " .. tostring(value))
end
return { report = report, watch = watch }