updated
This commit is contained in:
@@ -3,9 +3,10 @@ local function getValue(reactor)
|
||||
return reactor.getTemperature() or 0
|
||||
end
|
||||
|
||||
local function watch(reactor, monitor)
|
||||
print("Temperature: " .. getValue(reactor))
|
||||
sleep(1)
|
||||
local function configureReport(monitor)
|
||||
local x,y = monitor.getCursorPos()
|
||||
monitor.setCursorPos(x, y + 1)
|
||||
monitor.clearLine()
|
||||
end
|
||||
|
||||
local function color(reactor)
|
||||
@@ -13,6 +14,11 @@ local function color(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)
|
||||
@@ -20,11 +26,4 @@ local function report(reactor, monitor)
|
||||
monitor.setBackgroundColor(color)
|
||||
monitor.write("Coolant: " .. value .. "%")
|
||||
end
|
||||
|
||||
local function configureReport(monitor)
|
||||
local x,y = monitor.getCursorPos()
|
||||
monitor.setCursorPos(x, y + 1)
|
||||
monitor.clearLine()
|
||||
end
|
||||
|
||||
return { report = report, watch = watch }
|
||||
Reference in New Issue
Block a user