(Sep-24-2020, 05:19 AM)finndude Wrote: If you have that in the loop then it will check everytime the loop is run.
Thanks, I cut lot of it out but basically the marketloop looks like this, and when I added the code you provided on top, it still says the 'break' out of loop - error.
def marketloop(): if key_press == s: break offers = pg.locateCenterOnScreen('offers.PNG', region=(0,0,1919,1079), grayscale=False, confidence=0.80) time.sleep(0.5) pg.click(offers.x, offers.y) time.sleep(0.5) search = pg.locateCenterOnScreen('search.PNG', region=(0,0,1919,1079), grayscale=False, confidence=0.80) time.sleep(0.5) pg.click(search.x, search.y) time.sleep(0.5) settings = pg.locateCenterOnScreen('settings.PNG', region=(0,0,1919,1079), grayscale=False, confidence=0.80) time.sleep(0.5) pg.click(settings.x, settings.y) time.sleep(0.5) #lots of the same cut out