updated
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
local function report(reactor)
|
local function report(reactor)
|
||||||
if reactor then
|
if reactor then
|
||||||
return reactor.getCoolantFilledPercentage()
|
return (reactor.getCoolantFilledPercentage() or 0) * 100
|
||||||
else
|
else
|
||||||
return "No reactor found"
|
return "No reactor found"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function watch(reactor, monitor)
|
local function watch(reactor, monitor)
|
||||||
|
local coolantLevel =
|
||||||
print("Coolant: " .. report(reactor))
|
print("Coolant: " .. report(reactor))
|
||||||
sleep(1)
|
sleep(1)
|
||||||
end
|
end
|
||||||
|
|||||||
3
main.lua
3
main.lua
@@ -8,7 +8,6 @@ local function runMonitors()
|
|||||||
while true do
|
while true do
|
||||||
tempDriver.watch(reactor, monitor)
|
tempDriver.watch(reactor, monitor)
|
||||||
coolantDriver.watch(reactor, monitor)
|
coolantDriver.watch(reactor, monitor)
|
||||||
sleep(1)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -26,8 +25,6 @@ local function runDisplay()
|
|||||||
monitor.write(item.Label .. ": " .. item.value)
|
monitor.write(item.Label .. ": " .. item.value)
|
||||||
monitor.setCursorPos(1, i + 1)
|
monitor.setCursorPos(1, i + 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
sleep(1)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user