From f78abe3c9fe8f0468c9ae6f2bdf6a1a4b925ec0f Mon Sep 17 00:00:00 2001 From: brockdarnold Date: Mon, 15 Jun 2026 05:38:58 +0000 Subject: [PATCH] publish eve_combat_watcher.py --- eve_combat_watcher.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/eve_combat_watcher.py b/eve_combat_watcher.py index 5db88d5..035518d 100644 --- a/eve_combat_watcher.py +++ b/eve_combat_watcher.py @@ -106,6 +106,10 @@ def main(): # compress reminder: ping when raw ore piled up since your last compression crosses this # many m³ (default 18,000 ≈ what Brock sits on). Tune via [combat] compress_at_m3. compress_at_m3 = g("compress_at_m3", 18000) + # after this long with no ore flowing, treat the session as over and auto-pause ALL + # watchers (drop a marker bot_mining() honors) so quitting never spams Discord. + pause_secs = g("mining_pause_secs", 300) + PAUSE_MARKER = os.path.join(w.HERE, ".mining_paused") if "--test" in sys.argv: w.notify(cp, "Gamelog watcher test", "Combat/tackle/hold/bounty alerts will reach you.", @@ -156,6 +160,12 @@ def main(): f"({int(time.time()-last_mine)}s) — rock depleted or out of range. " "Lock a new rock.", priority="high", tags="pick") print("[gamelog] mining stall — switch-rocks alert") + # stopped for good (you quit / warped off)? auto-pause every watcher so the rest + # of the session is silent until ore flows again. + if last_mine and time.time() - last_mine > pause_secs \ + and not os.path.exists(PAUSE_MARKER): + open(PAUSE_MARKER, "w").close() + print("[gamelog] mining idle — auto-paused watchers") time.sleep(1); continue clean = TAG.sub("", line) @@ -164,6 +174,12 @@ def main(): last_mine = time.time() last_ore = mm.group(2) mine_alerted = False # re-arm: lasers are pulling again + if os.path.exists(PAUSE_MARKER): # ore flowing -> resume all watchers + try: + os.remove(PAUSE_MARKER) + print("[gamelog] mining resumed — watchers un-paused") + except OSError: + pass raw_m3 += int(mm.group(1).replace(",", "")) * ore_vol(mm.group(2)) if raw_m3 >= compress_at_m3 and not compress_alerted \ and w.bot_mining(cp) and not w.bot_muted(cp):