I made a script in python that detects color on the screen and clicks
import pyautogui
def get_pixel_colour(i_x, i_y):
import PIL.ImageGrab
return PIL.ImageGrab.grab().load()[i_x, i_y]
while(True):
print (get_pixel_colour(400, 400))
if (get_pixel_colour(400, 400)) == (75, 219, 106):
pyautogui.click(400, 400)
I want to make this script faster since it only goes at about 50ms and i would like to get it to half of that. I'm fairly new to coding so I have no idea what to do to make it faster