Files
nova-corp/temperature_driver.lua
2025-06-14 14:04:30 -04:00

22 lines
541 B
Lua

local function getValue(reactor)
return reactor.getTemperature() or 0
end
local function color(reactor)
local temperature = getValue(reactor)
return colors.black
end
local function watch(reactor, monitor)
print("Temperature: " .. getValue(reactor))
sleep(1)
end
local function report(reactor, monitor)
local value = getValue(reactor)
local color = color(reactor)
monitor.setBackgroundColor(color)
monitor.write("Coolant: " .. value .. "%")
end
return { report = report, watch = watch }