-
Notifications
You must be signed in to change notification settings - Fork 0
/
Macro.py
64 lines (55 loc) · 1.83 KB
/
Macro.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
54
55
56
57
58
59
60
61
62
63
64
from Actuator import Actuator
# from HotkeyHandler import HotkeyHandler
import keyboard
import os
import sys
from time import sleep
def restart():
print("Restarting script...\n")
os.execl(sys.executable, sys.executable, *sys.argv)
def stop():
print("Sending stop signal to listener...\n")
return False
def mammonite(actuator):
print("Mammonite!!")
actuator.send_clicks(interval=0)
if __name__ == '__main__':
pass
"""
actuator = Actuator()
combos = {
('shift', 'f9'): (restart, ),
('shift', 'f12'): (stop, ),
('z'): (mammonite, actuator),
}
h = HotkeyHandler(combos, debug=True)
h.start()
execute = False
while True:
if keyboard.is_pressed('['): execute = True
elif keyboard.is_pressed(']'): execute = False
if execute: mammonite(actuator)
sleep(0.05)
"""
from pywinauto.application import Application
from time import sleep
(w, h) = (1920, 1080)
var = 0.15
cooldown = 15
process_id = int(input("Enter PID: "))
def clicks():
wrapper.click_input(coords=(int(0.50 * w), int(0.50 * h)))
wrapper.click_input(coords=(int((0.50 - var) * w), int(0.50 * h)))
#wrapper.click_input(coords=(int((0.50 - var) * w), int((0.50 - var) * h)))
wrapper.click_input(coords=(int(0.50 * w), int((0.50 - var) * h)))
#wrapper.click_input(coords=(int((0.50 + var) * w), int((0.50 - var) * h)))
wrapper.click_input(coords=(int((0.50 + var) * w), int(0.50 * h)))
#wrapper.click_input(coords=(int((0.50 + var) * w), int((0.50 + var) * h)))
wrapper.click_input(coords=(int(0.50 * w), int((0.50 + var) * h)))
#wrapper.click_input(coords=(int((0.50 - var) * w), int((0.50 + var) * h)))
wrapper.minimize()
app = Application().connect(process=process_id)
wrapper = app.window().wrapper_object()
while(True):
clicks()
sleep(cooldown)