-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bot.py
30 lines (26 loc) · 812 Bytes
/
Bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from pyautogui import *
import pyautogui
import time
import keyboard
import random
import win32api, win32con
#Y:600
#x1 560
#660
#760
#860
def click(x,y):
win32api.SetCursorPos((x,y))
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0)
time.sleep(0.05) #this pauses it for 1/100th of a second
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,0,0)
#The section below is where you will fill in your specific mousePosition values from the displayMousePosition.py output(s)
while keyboard.is_pressed('q') == False:
if pyautogui.pixel(560, 700)[0] == 0: #[0] is the index for R/red
click(560, 700)
if pyautogui.pixel(660, 700)[0] == 0:
click(660, 700)
if pyautogui.pixel(760, 700)[0] == 0:
click(760, 700)
if pyautogui.pixel(860, 700)[0] == 0:
click(860, 700)