Skip to content

Instantly share code, notes, and snippets.

@BluumDK
Created March 24, 2022 11:00
Show Gist options
  • Select an option

  • Save BluumDK/b8ec10f953c24ebb0f08cc2ca9f77615 to your computer and use it in GitHub Desktop.

Select an option

Save BluumDK/b8ec10f953c24ebb0f08cc2ca9f77615 to your computer and use it in GitHub Desktop.
import time
import keyboard
import pyautogui
import win32api
import win32con
def click(x, y):
win32api.SetCursorPos((x, y))
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0)
time.sleep(0.0)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0)
while not keyboard.is_pressed('q'):
if pyautogui.pixelMatchesColor(1120, 540, (1, 1, 1)):
click(1120, 540)
if pyautogui.pixelMatchesColor(1020, 540, (1, 1, 1)):
click(1020, 540)
if pyautogui.pixelMatchesColor(880, 540, (1, 1, 1)):
click(880, 540)
if pyautogui.pixelMatchesColor(800, 540, (1, 1, 1)):
click(790, 540)
if pyautogui.pixelMatchesColor(1120, 540, (0, 0, 0)):
click(1120, 540)
if pyautogui.pixelMatchesColor(1020, 540, (0, 0, 0)):
click(1020, 540)
if pyautogui.pixelMatchesColor(880, 540, (0, 0, 0)):
click(880, 540)
if pyautogui.pixelMatchesColor(800, 540, (0, 0, 0)):
click(790, 540)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment