Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! python3
- import sys
- import pyautogui
- # --- functions ---
- def find(region):
- found = dict()
- for digit in range(10):
- positions = pyautogui.locateAllOnScreen('digits/{}.png'.format(digit), region=region, grayscale=True)
- for x, _, _, _ in positions:
- found[x] = str(digit)
- cols = sorted(found)
- value = ''.join(found[col] for col in cols)
- return value
- # --- main ---
- # locate Power
- power = find( (888, 920, 150, 40) )
- print(power)
- # locate other value in different region
- other = find( (888, 1120, 150, 40) )
- print(other)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement