-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
53 lines (42 loc) · 1.03 KB
/
main.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import pyautogui
from pynput import keyboard
from time import sleep as s
print("Program is running!")
COMBINATIONS = [
{keyboard.KeyCode(char=']')}
]
current = set()
def execute():
print("Bot is on!")
# Add space
pyautogui.moveTo(748, 432)
s(0.002)
pyautogui.click()
s(0.002)
pyautogui.press("space")
s(0.002)
pyautogui.moveTo(1178, 432)
s(0.002)
pyautogui.click()
s(0.002)
# Delete space
pyautogui.moveTo(748, 432)
s(0.002)
pyautogui.click()
s(0.002)
pyautogui.press("backspace")
s(0.002)
pyautogui.moveTo(1178, 432)
s(0.002)
pyautogui.click()
s(0.002)
def on_press(key):
if any([key in COMBO for COMBO in COMBINATIONS]):
current.add(key)
if any(all(k in current for k in COMBO)for COMBO in COMBINATIONS):
execute()
def on_release(key):
if any([key in COMBO for COMBO in COMBINATIONS]):
current.remove(key)
with keyboard.Listener(on_press=on_press, on_release=on_release) as listener:
listener.join()