publish eve_rock_watcher.py
This commit is contained in:
parent
322263e738
commit
ca77f3e5e2
1 changed files with 17 additions and 2 deletions
|
|
@ -292,6 +292,7 @@ def main():
|
|||
last_alert = {}
|
||||
last_status = 0.0
|
||||
region = mode = None
|
||||
empty_streak = 0
|
||||
while True:
|
||||
if not w.bot_mining(cp): # only during a mining session
|
||||
tracker.h.clear()
|
||||
|
|
@ -308,10 +309,24 @@ def main():
|
|||
try:
|
||||
rows = read_rows(cp, region, mode)
|
||||
if not rows:
|
||||
# nothing selected at the moment — KEEP the fixed region (positions are
|
||||
# stable; don't burn CPU re-hunting on a 9000px screen), just retry.
|
||||
# The saved region may be stale (you compressed, reselected, or the window
|
||||
# moved), so a fixed box reads empty forever. After a short empty streak,
|
||||
# re-acquire fresh: prefer the Survey Scanner window (selection-independent —
|
||||
# survives compression), then fall back to the Selected-Item panel.
|
||||
empty_streak += 1
|
||||
if empty_streak % 6 == 0:
|
||||
nm = None
|
||||
r = detect_survey_region(cp)
|
||||
if r:
|
||||
region, mode, nm = r, "survey", "survey"
|
||||
else:
|
||||
r = detect_selected_region(cp)
|
||||
if r:
|
||||
region, mode, nm = r, "selected", "selected"
|
||||
print(f"[rock] empty {empty_streak}x — re-detect: {nm or 'still nothing visible'}")
|
||||
time.sleep(poll)
|
||||
continue
|
||||
empty_streak = 0
|
||||
now = time.time()
|
||||
keyed = tracker.update(rows, now)
|
||||
hr = hold_rate()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue