diff --git a/main.lua b/main.lua index 4bc9ee2..2d7ec8a 100644 --- a/main.lua +++ b/main.lua @@ -14,6 +14,8 @@ burnRateDriver = kernel.addDriver("burnrate_driver") environmentDriver = kernel.addDriver("environment_driver") +reactorStatus = false + function setNewLine() local x,y = monitor.getCursorPos() monitor.setCursorPos(1, y + 1) @@ -21,13 +23,16 @@ function setNewLine() end local function runMonitors() - parallel.waitForAll( - tempDriver.watch, - coolantDriver.watch, - statusDriver.watch, - turbineDriver.watch, - burnRateDriver.watch, - environmentDriver.watch) + if(reactorStatus) then + parallel.waitForAll( + tempDriver.watch, + coolantDriver.watch, + statusDriver.watch, + turbineDriver.watch, + burnRateDriver.watch, + environmentDriver.watch) + else + end end local function runDisplay() diff --git a/status_driver.lua b/status_driver.lua index fbff2de..0470982 100644 --- a/status_driver.lua +++ b/status_driver.lua @@ -22,6 +22,8 @@ local function startUp() reactor.activate() return end + + reactorStatus = reactor.getStatus() end local function shutdown() @@ -33,7 +35,7 @@ local function report() local value = getValue() local color = colors.black monitor.setBackgroundColor(color) - + setNewLine() monitor.write("Reactor Status: " .. tostring(value)) end