I am using PYautoGUI and im trying to make a script that will solve a puzzle. The puzzle tells me to tap the pair (what ever image there is two of) I have this code so far:
if pyautogui.locateCenterOnScreen('TapPair.png', confidence=0.9, region=(689, 250, 640, 1000)) != None:
for image in images:
found = list(pyautogui.locateAllOnScreen(image, confidence=0.99, region=(689, 250, 640, 1000)))
if len(found) >= 2:
for i in found:
pyautogui.click(i)
print("Got a match")
time.sleep(2)
break
Problem is: it TAPS every image that it matches with... why?


