diff --git a/coolant_driver.lua b/coolant_driver.lua index a4f4baf..7cb8e85 100644 --- a/coolant_driver.lua +++ b/coolant_driver.lua @@ -1,12 +1,13 @@ local function report(reactor) if reactor then - return reactor.getCoolantFilledPercentage() + return (reactor.getCoolantFilledPercentage() or 0) * 100 else return "No reactor found" end end local function watch(reactor, monitor) + local coolantLevel = print("Coolant: " .. report(reactor)) sleep(1) end diff --git a/main.lua b/main.lua index 38b74ff..bd83abc 100644 --- a/main.lua +++ b/main.lua @@ -8,7 +8,6 @@ local function runMonitors() while true do tempDriver.watch(reactor, monitor) coolantDriver.watch(reactor, monitor) - sleep(1) end end @@ -26,8 +25,6 @@ local function runDisplay() monitor.write(item.Label .. ": " .. item.value) monitor.setCursorPos(1, i + 1) end - - sleep(1) end end