Ok so i have this script, it clicks only the pixels that have a certain shade of grey, it works fine for the most part except one thing, it loops too long and takes about like a second to go through each time how should i change my break to work better and stop it from looping all around after ive found one valid pixel?
xx = 0
while xx <= 600:
with mss.mss() as sct:
region = {'top': 0, 'left': 0, 'width': 1920, 'height': 1080}
imgg = sct.grab(region)
pxls = imgg.pixels
for row, pxl in enumerate(pxls):
for col, pxll in enumerate(pxl):
if pxll == (102, 102, 102):
if col>=71 and col<=328 and row<=530 and row>=378:
foundpxl = pxll
print(str(col) +" , "+ str(row))
pyautogui.click(col,row)
break
xx = xx + 1
time.sleep(.05)