diff --git a/eve_orehold_watcher.py b/eve_orehold_watcher.py index e0329a1..08cb76a 100644 --- a/eve_orehold_watcher.py +++ b/eve_orehold_watcher.py @@ -624,6 +624,26 @@ def main(): notify(cp, "Eve watcher test", "If you got this on phone + toast, delivery works.") return + if "--read" in sys.argv: # one-shot: print current hold cur/cap/% + import pytesseract + tcmd = cp.get("ocr", "tesseract_cmd", fallback="").strip() + if tcmd: + pytesseract.pytesseract.tesseract_cmd = tcmd + rs = cp.get("ocr", "region", fallback="").strip() + region = [int(x) for x in rs.split(",")] if rs else auto_region(cp) + if not region: + print("READ none — Ore Hold readout not visible (open your Ore Hold window)") + return + img = grab_region(region) + img = img.resize((img.width * 2, img.height * 2)) + text = pytesseract.image_to_string(img, config="--psm 7") + parsed = parse_orehold_text(text) + if parsed: + cur, cap = parsed + print(f"READ {cur}/{cap} m3 ({100.0*cur/cap:.1f}%)") + else: + print(f"READ fail — raw OCR={text!r}") + return mode = cp.get("watcher", "mode", fallback="ocr").strip().lower() print(f"=== eve_orehold_watcher starting (mode={mode}) ===") heartbeat(cp, "orehold")