local maxValue = 80 local minValue = 50 local minCoolant = 30 local function getValue() return (reactor.getCoolantFilledPercentage() or 1) * 100 end local function checkCoolantLevel() local coolantLevel = getValue() if coolantLevel > maxValue then -- Do nothing if coolant is above the max value elseif coolantLevel > minValue then -- print("Coolant approaching minimum, slowly stepping down burn rate.") -- burnRateDriver.slowStepDown() elseif coolantLevel <= minCoolant then print("Critical Warning: Coolant below minimum safe level! SCRAMMING reactor.") reactor.scram() elseif coolantLevel <= minValue then print("Warning: Coolant below minimum! Stepping down burn rate.") burnRateDriver.stepDown() end return true end local function watch() while true do checkCoolantLevel() sleep(0.05) end end -- local function watch() -- checkCoolantLevel() -- end local function report() local value = getValue() local color = colors.black monitor.setBackgroundColor(color) monitor.clearLine() monitor.write("Coolant: " .. value .. "%") end return { report = report, watch = watch}