From 2515a4786053a49d7546c5cc1dc6b09d110f3e76 Mon Sep 17 00:00:00 2001 From: itzmarkoni Date: Sat, 14 Jun 2025 18:01:55 -0400 Subject: [PATCH] updated --- burnrate_driver.lua | 7 +++++-- coolant_driver.lua | 9 ++++----- status_driver.lua | 8 +++++--- temperature_driver.lua | 39 +++++++++++++++++++++------------------ turbine_driver.lua | 11 ++++++----- 5 files changed, 41 insertions(+), 33 deletions(-) diff --git a/burnrate_driver.lua b/burnrate_driver.lua index 9d1435d..4edfdcc 100644 --- a/burnrate_driver.lua +++ b/burnrate_driver.lua @@ -19,8 +19,7 @@ end -- sleep(0.05) -- Update every tenth second -- end -- end -local function watch() -end + local function stepUp() -- local value = getValue() @@ -36,6 +35,10 @@ local function stepDown() -- end end + +local function watch() +end + local function report() local color = color() monitor.setBackgroundColor(color) diff --git a/coolant_driver.lua b/coolant_driver.lua index ef62bb1..cc2878a 100644 --- a/coolant_driver.lua +++ b/coolant_driver.lua @@ -10,6 +10,10 @@ local function color() return colors.black end +local function checkCoolantLevel() + local coolantLevel = getValue() + return true +end -- local function watch() -- while true do @@ -22,11 +26,6 @@ local function watch() checkCoolantLevel() end -local function checkCoolantLevel() - local coolantLevel = getValue() - return true -end - local function report() local value = getValue() local color = color() diff --git a/status_driver.lua b/status_driver.lua index b0f11e5..20d4757 100644 --- a/status_driver.lua +++ b/status_driver.lua @@ -15,14 +15,16 @@ end -- end -- end +local function checkStatus() + local value = getValue() +end + local function watch() checkStatus() end -local function checkStatus() - local value = getValue() -end + local function report() local value = getValue() diff --git a/temperature_driver.lua b/temperature_driver.lua index dcea73f..8954978 100644 --- a/temperature_driver.lua +++ b/temperature_driver.lua @@ -8,24 +8,6 @@ local function getValue() return math.floor(fahrenheit * 10000 + 0.5) / 10000 end -local function color() - local temperature = getValue() - return colors.black -end - --- local function watch() --- while true do --- print("Temperature: " .. getValue()) --- checkTemperature() --- sleep(0.05) -- Update every tenth second --- end --- end - - -local function watch() - checkTemperature() -end - local function checkTemperature() local temperature = getValue() local upperThreshold = max - 20 @@ -40,6 +22,27 @@ local function checkTemperature() end end +local function color() + local temperature = getValue() + return colors.black +end + +-- local function watch() +-- while true do +-- print("Temperature: " .. getValue()) +-- checkTemperature() +-- sleep(0.05) -- Update every tenth second +-- end +-- end + + + + + +local function watch() + checkTemperature() +end + local function report() local value = getValue() local color = color() diff --git a/turbine_driver.lua b/turbine_driver.lua index 82d2215..1cc4d04 100644 --- a/turbine_driver.lua +++ b/turbine_driver.lua @@ -19,11 +19,6 @@ end -- end -- end - -local function watch() - checkSteamLevel() -end - local function checkSteamLevel() local value = getValue() if value > max then @@ -45,6 +40,11 @@ local function checkSteamLevel() end end +local function watch() + checkSteamLevel() +end + + local function report() local color = color() monitor.setBackgroundColor(color) @@ -52,4 +52,5 @@ local function report() monitor.clearLine() monitor.write("Turbine Steam: " .. value .. "%") end + return { report = report, watch = watch } \ No newline at end of file