publish eve_rock_watcher.py

This commit is contained in:
brockdarnold 2026-06-15 04:53:58 +00:00
parent c356fc4fd3
commit 97397ecb37

View file

@ -106,7 +106,11 @@ def read_selected_quantity(cp):
digits = re.sub(r"\D", "", m.group(1))
if len(digits) < 2:
return None, None
ore = match_ore(flat.lower()) or "rock"
# the rock's name sits just before its 'Quantity' line in the same popup block
# (e.g. "Omber Distance ... Quantity 47,765 Units") — match there, not the whole
# window (the hold's "Compressed Kernite" would otherwise win).
ore = match_ore(flat[max(0, m.start() - 180):m.start()].lower()) \
or match_ore(flat.lower()) or "rock"
return int(digits), ore