Hello,
I have recently started using the pytautogui library and I have tried to create a bot for the google dinosaur game, and it works at the start but it can't reach high points and I don't know if it's because the library is just not fast enough to process the information or it's a thing of my code or pc, could someone please explain this to me and tell me if I should change something in my code??
here is my code:
import pyautogui
import keyboard
import time
def press_space():
pyautogui.keyDown("space")
time.sleep(0.2)
pyautogui.keyUp("space")
time.sleep(2)
pyautogui.PAUSE = 0
while not keyboard.is_pressed("q"):
bg_color = pyautogui.pixel(200, 300)
pos1 = pyautogui.pixel(790, 285)
pos2 = pyautogui.pixel(790, 315)
if pos1 != bg_color or pos2 != bg_color:
press_space()