diff --git a/src/transmute/transmute.py b/src/transmute/transmute.py index 3be7fdc..b800e1a 100644 --- a/src/transmute/transmute.py +++ b/src/transmute/transmute.py @@ -879,14 +879,18 @@ class Transmute: self._switch_to_gems_tab() wait(0.3, 0.4) - pos = self._gems_stack_monitor_for(gem_template) - if pos is None: - img = grab() - matches = template_finder.search_all(gem_template, img, threshold=0.85, roi=left_roi) - if not matches: - Logger.info(f" no {gem_template} left in GEMS tab -- stopping {tier_name}") - break - pos = matches[0].center_monitor + # Always verify the stack is actually still there before clicking it. + # A static coordinate from _gems_stack_monitor_for tells us WHERE to + # click but says nothing about whether anything is still there — for + # a "999 = depleted-unknown" plan (OCR couldn't read the count), that + # made the depletion check dead code: it kept blindly clicking the + # same empty slot every iteration instead of ever stopping. + img = grab() + matches = template_finder.search_all(gem_template, img, threshold=0.85, roi=left_roi) + if not matches: + Logger.info(f" no {gem_template} left in GEMS tab -- stopping {tier_name}") + break + pos = self._gems_stack_monitor_for(gem_template) or matches[0].center_monitor # Step 1: ctrl+shift+left-click x3 -- 3 gems move from GEMS tab into the convert panel. Logger.info(f" [{i+1}/{n_transmutes}] loading 3x {gem_template} into GEMS convert panel @ {pos}")