From cc62b1b5749d88b7df949261b84df1ad8300e14f Mon Sep 17 00:00:00 2001 From: itzmarkoni Date: Sat, 14 Jun 2025 15:38:35 -0400 Subject: [PATCH] updated --- turbine_driver.lua | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/turbine_driver.lua b/turbine_driver.lua index a1ea4dd..75d2814 100644 --- a/turbine_driver.lua +++ b/turbine_driver.lua @@ -1,3 +1,8 @@ +local max = 90 +local maxVent = 70 +local minVent = 60 +local min = 40 + local function getValue() return turbine.getSteamFilledPercentage() * 100 end @@ -9,6 +14,21 @@ end local function watch() print("Turbine Steam Filled: " .. getValue()) + local value = getValue() + if value > max then + print("Warning: Steam above maximum! Taking action.") + reactor.scram(); + turbine.setDumpingMode("DUMPING") + elseif value >= minVent and value <= maxVent then + print("Steam within vent range. Adjusting vents.") + turbine.setDumpingMode("DUMPING") + elseif value >= min and value < minVent then + print("Steam within normal operation range.") + turbine.setDumpingMode("IDLE") + elseif value < min then + print("Warning: Steam below minimum! Taking action.") + turbine.setDumpingMode("IDLE") + end end local function report() @@ -16,6 +36,6 @@ local function report() monitor.setBackgroundColor(color) value = getValue() monitor.clearLine() - monitor.write("Turbine Steam" .. value .. "%") + monitor.write("Turbine Steam: " .. value .. "%") end return { report = report, watch = watch } \ No newline at end of file