Untitled

 avatar
unknown
plain_text
a year ago
826 B
13
Indexable
import pyautogui
import keyboard
from time import sleep

# Definir as cores em variáveis
green_color = (12, 152, 33)
red_color = (254, 15, 23)
yellow_color = (244, 244, 64)

try:
    while not keyboard.is_pressed('1'):
        # Verificar se o pixel verde está presente
        if pyautogui.pixelMatchesColor(1369,839, green_color):
            pyautogui.press('a')
            sleep(0.05)
        # Verificar se o pixel vermelho está presente
        elif pyautogui.pixelMatchesColor(1483,839, red_color):
            pyautogui.press('s')
            sleep(0.05)
        # Verificar se o pixel amarelo está presente
        elif pyautogui.pixelMatchesColor(1592,840, yellow_color):
            pyautogui.press('j')
            sleep(0.05)
except Exception as e:
    print(f"Ocorreu um erro: {e}") 
Editor is loading...
Leave a Comment