updated
This commit is contained in:
@@ -36,6 +36,13 @@ local function slowStepDown()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function slowStepUp()
|
||||||
|
local value = getValue()
|
||||||
|
if value < max then
|
||||||
|
reactor.setBurnRate(value + smallRateStep)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function stepDown()
|
local function stepDown()
|
||||||
local value = getValue()
|
local value = getValue()
|
||||||
if value > min then
|
if value > min then
|
||||||
@@ -55,4 +62,4 @@ local function report()
|
|||||||
monitor.clearLine()
|
monitor.clearLine()
|
||||||
monitor.write("Burn Rate: " .. value)
|
monitor.write("Burn Rate: " .. value)
|
||||||
end
|
end
|
||||||
return { report = report, watch = watch, stepUp = stepUp, stepDown = stepDown, slowStepDown = slowStepDown }
|
return { report = report, watch = watch, stepUp = stepUp, stepDown = stepDown, slowStepDown = slowStepDown, slowStepUp = slowStepUp }
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
local maxValue = 80
|
local maxValue = 80
|
||||||
local minValue = 60
|
local minValue = 60
|
||||||
|
local minCoolant = 30
|
||||||
|
|
||||||
local function getValue()
|
local function getValue()
|
||||||
return (reactor.getCoolantFilledPercentage() or 0) * 100
|
return (reactor.getCoolantFilledPercentage() or 1) * 100
|
||||||
end
|
end
|
||||||
|
|
||||||
local function checkCoolantLevel()
|
local function checkCoolantLevel()
|
||||||
@@ -12,6 +13,9 @@ local function checkCoolantLevel()
|
|||||||
elseif coolantLevel > minValue then
|
elseif coolantLevel > minValue then
|
||||||
-- print("Coolant approaching minimum, slowly stepping down burn rate.")
|
-- print("Coolant approaching minimum, slowly stepping down burn rate.")
|
||||||
-- burnRateDriver.slowStepDown()
|
-- burnRateDriver.slowStepDown()
|
||||||
|
elseif coolantLevel <= minCoolant then
|
||||||
|
print("Critical Warning: Coolant below minimum safe level! SCRAMMING reactor.")
|
||||||
|
reactor.scram()
|
||||||
elseif coolantLevel <= minValue then
|
elseif coolantLevel <= minValue then
|
||||||
print("Warning: Coolant below minimum! Stepping down burn rate.")
|
print("Warning: Coolant below minimum! Stepping down burn rate.")
|
||||||
burnRateDriver.stepDown()
|
burnRateDriver.stepDown()
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ local function checkTemperature()
|
|||||||
burnRateDriver.stepDown()
|
burnRateDriver.stepDown()
|
||||||
elseif temperature <= lowerThreshold then
|
elseif temperature <= lowerThreshold then
|
||||||
print("Warning: Temperature approaching lower limit! Taking action.")
|
print("Warning: Temperature approaching lower limit! Taking action.")
|
||||||
burnRateDriver.stepUp()
|
burnRateDriver.slowStepUp()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user