-
Notifications
You must be signed in to change notification settings - Fork 0
/
FCLICK.py
32 lines (27 loc) · 880 Bytes
/
FCLICK.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
31
32
#FCLICK
#Filip Rokita
#www.filiprokita.com
import pyautogui
import keyboard
import win32api
import win32con
import time
startButton = input("START BUTTON: ").lower()
def click(x, y):
win32api.SetCursorPos((x, y))
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0)
time.sleep(0.1)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0)
def getPixelColor(x, y):
screenshot = pyautogui.screenshot()
color = screenshot.getpixel((x, y))
return color
while True:
while keyboard.is_pressed(startButton) == True:
startPos = tuple(pyautogui.position())
startColor = getPixelColor(startPos[0], startPos[1])
while True:
nowColor = getPixelColor(startPos[0], startPos[1])
if nowColor != startColor:
click(startPos[0], startPos[1])
break