This commit is contained in:
2025-06-14 13:53:07 -04:00
parent 9e709dfe60
commit 3029fe8a49
2 changed files with 21 additions and 20 deletions

View File

@@ -11,6 +11,18 @@ local function getValue(reactor)
return (reactor.getCoolantFilledPercentage() or 0) * 100 return (reactor.getCoolantFilledPercentage() or 0) * 100
end end
local function configureReport(monitor)
local x,y = monitor.getCursorPos()
monitor.setCursorPos(x, y + 1)
monitor.clearLine()
end
local function color(reactor)
local coolantLevel = getValue(reactor)
return colors.black
end
local function watch(reactor, monitor) local function watch(reactor, monitor)
local coolantLevel = getValue(reactor) local coolantLevel = getValue(reactor)
print("Coolant: " .. coolantLevel) print("Coolant: " .. coolantLevel)
@@ -25,15 +37,5 @@ local function report(reactor, monitor)
monitor.write("Coolant: " .. value .. "%") monitor.write("Coolant: " .. value .. "%")
end end
local function configureReport(monitor)
local x,y = monitor.getCursorPos()
monitor.setCursorPos(x, y + 1)
monitor.clearLine()
end
local function color(reactor)
local coolantLevel = getValue(reactor)
return colors.black
end
return { report = report, watch = watch} return { report = report, watch = watch}

View File

@@ -3,9 +3,10 @@ local function getValue(reactor)
return reactor.getTemperature() or 0 return reactor.getTemperature() or 0
end end
local function watch(reactor, monitor) local function configureReport(monitor)
print("Temperature: " .. getValue(reactor)) local x,y = monitor.getCursorPos()
sleep(1) monitor.setCursorPos(x, y + 1)
monitor.clearLine()
end end
local function color(reactor) local function color(reactor)
@@ -13,6 +14,11 @@ local function color(reactor)
return colors.black return colors.black
end end
local function watch(reactor, monitor)
print("Temperature: " .. getValue(reactor))
sleep(1)
end
local function report(reactor, monitor) local function report(reactor, monitor)
local value = getValue(reactor) local value = getValue(reactor)
local color = color(reactor) local color = color(reactor)
@@ -20,11 +26,4 @@ local function report(reactor, monitor)
monitor.setBackgroundColor(color) monitor.setBackgroundColor(color)
monitor.write("Coolant: " .. value .. "%") monitor.write("Coolant: " .. value .. "%")
end end
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 }