From 136938a3e326b45a06b41980dd12ed53b5f1b867 Mon Sep 17 00:00:00 2001
From: annabunches <annabunches@gmail.com>
Date: Tue, 11 Feb 2025 00:42:22 -0500
Subject: [PATCH] Fixes and add some default output.

---
 AirMonitor/AirZone.cs | 18 ++++++++++++------
 AirMonitor/Program.cs |  9 +++++++--
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/AirMonitor/AirZone.cs b/AirMonitor/AirZone.cs
index 29a8699..7a5225d 100644
--- a/AirMonitor/AirZone.cs
+++ b/AirMonitor/AirZone.cs
@@ -3,9 +3,11 @@ using SpaceEngineers.Game.ModAPI.Ingame;
 using System.Collections.Generic;
 using VRage.Game.ModAPI.Ingame.Utilities;
 
-namespace IngameScript {
-    partial class Program {
-               public class AirZone
+namespace IngameScript
+{
+    partial class Program
+    {
+        public class AirZone
         {
             public bool Triggered = false;
 
@@ -28,14 +30,18 @@ namespace IngameScript {
                 if (block is IMyAirVent)
                 {
                     _vents.Add(block as IMyAirVent);
-                } else if (block is IMyDoor) {
-                    SequenceableDoor wrapped = SequenceableFactory.MakeSequenceable(block as IMyDoor, _ini, "") as SequenceableDoor;
+                }
+                else if (block is IMyDoor)
+                {
+                    SequenceableDoor wrapped = SequenceableFactory.MakeSequenceable(block as IMyDoor, _ini, "airMonitor") as SequenceableDoor;
                     wrapped.Step = 0;
                     wrapped.DeployOpen = false;
                     wrapped.LockOpen = false;
                     wrapped.LockClosed = true;
                     _sequencer.AddBlock(wrapped);
-                } else {
+                }
+                else
+                {
                     _console.Print("Tried to add incompatible block '{block.CustomName}'");
                 }
                 // TODO: support for arbitrary (sub-)sequences here could be powerful
diff --git a/AirMonitor/Program.cs b/AirMonitor/Program.cs
index 78ada01..4e97772 100644
--- a/AirMonitor/Program.cs
+++ b/AirMonitor/Program.cs
@@ -27,6 +27,7 @@ namespace IngameScript
         private MyCommandLine _cli;
         private Dictionary<string, AirZone> _zones;
         private List<IEnumerator<bool>> _jobs;
+        private int _totalTicks = 0;
 
         public Program()
         {
@@ -62,6 +63,7 @@ namespace IngameScript
                 }
             }
 
+            _console.Print($"Found {_zones.Count} zones.");
             foreach (AirZone zone in _zones.Values)
             {
                 _jobs.Add(zone.Monitor());
@@ -71,6 +73,7 @@ namespace IngameScript
 
         public void Main(string argument, UpdateType updateSource)
         {
+            _console.PrintLower($"Air Monitor\nTotal Ticks: {++_totalTicks}");
             if (argument != "")
             {
                 _cli.TryParse(argument);
@@ -78,9 +81,11 @@ namespace IngameScript
                 {
                     for (int i = 0; i < _cli.ArgumentCount; i++)
                     {
-                        if (_zones.ContainsKey(_cli.Argument(i)))
+                        string zone = _cli.Argument(i);
+                        _console.Print($"Resetting {zone}.");
+                        if (_zones.ContainsKey(zone))
                         {
-                            _zones[_cli.Argument(i)].Triggered = false;
+                            _zones[zone].Triggered = false;
                         }
                     }
                 }