This commit is contained in:
2025-06-14 13:41:19 -04:00
parent 51cda50b3c
commit 83030e6869
3 changed files with 68 additions and 23 deletions

View File

@@ -1,14 +1,34 @@
local function report(reactor)
local function getValue(reactor)
return reactor.getTemperature() or 0
end
local function watch(reactor, monitor)
print("Temperature: " .. getValue(reactor))
sleep(1)
end
local function color(reactor)
local temperature = getValue(reactor)
return colors.black
end
local function report(reactor, monitor)
if reactor then
return reactor.getTemperature()
local value = getValue(reactor)
local color = color(reactor)
configureReport(monitor)
monitor.setBackgroundColor(color)
monitor.write("Coolant: " .. value .. "%")
else
return "No reactor found"
end
end
local function watch(reactor, monitor)
print("Temperature: " .. report(reactor))
sleep(1)
local function configureReport(monitor)
local x,y = monitor.getCursorPos()
monitor.setCursorPos(x, y + 1)
monitor.clearLine()
end
return { report = report, watch = watch }
return { report = report, watch = watch}