In the code below as you can see i'm trying to find an image in the screen with a .png(that i didn't add because i don't think it's the problem) but it doesn't find anything
import pyautogui as pt
from time import sleep
class Clicker:
def __init__(self, target_png, speed):
self.target_png = target_png
self.speed = speed
pt.FAILSAFE = True
def nav_to_image(self):
try:
position = pt.locateOnScreen(self.target_png, confidence=.8)
pt.moveTo(position[0] + 15, position[1] + 15, duration=self.speed)
pt.doubleClick()
except:
print('No img found')
return 0
if __name__=='__main__':
sleep(1)
clicker = Clicker('accetta.png', speed=.001)
end = 0
while True:
sleep(1)
if clicker.nav_to_image() == 00:
end += 1
if end > 5:
break