-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSlowAutoClicker.py
More file actions
35 lines (31 loc) · 877 Bytes
/
SlowAutoClicker.py
File metadata and controls
35 lines (31 loc) · 877 Bytes
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
33
34
35
import time
import pyautogui
from tqdm import tqdm
from pynput import keyboard
class AutoClicker:
def __init__(self, clicks, interval):
self.clicks = clicks
self.interval = interval
self.running = True
self.listener = keyboard.Listener(on_release=self.on_release)
self.listener.start()
def on_release(self, key):
if key == keyboard.Key.esc:
self.running = False
return False
def start_clicking(self):
for i in tqdm(range(self.clicks)):
if not self.running:
break
#print(f'{i} out of {self.clicks}')
pyautogui.click()
time.sleep(self.interval)
print('3...')
time.sleep(1)
print('2...')
time.sleep(1)
print('1...')
time.sleep(1)
print('CLICK!')
auto_clicker = AutoClicker(1000000, 0.00001)
auto_clicker.start_clicking()