-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoment.py
62 lines (50 loc) · 1.59 KB
/
moment.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
from time import sleep
from win32dic import VK_CODE
import win32api , win32con , win32gui
class moment():
def L_dash():
self.KeyClick('w')
self.KeyClick('a')
self.KeyClick('a')
def R_dash():
self.KeyClick('w')
self.KeyClick('d')
self.KeyClick('d')
def R_side():
self.KeyClick('a')
self.KeyClick('d')
self.KeyClick('v')
def L_side():
self.KeyClick('d')
self.KeyClick('a')
self.KeyClick('v')
def L_upper():
self.KeyClick('s')
self.KeyClick('d')
self.KeyClick('v')
self.time.sleep(0.8)
def R_upper():
self.KeyClick('s')
self.KeyClick('a')
self.KeyClick('v')
self.time.sleep(0.8)
def D_Attack():
self.KeyClick('w')
self.KeyClick('s')
self.KeyClick('s')
self.KeyClick('v')
self.time.sleep(0.8)
def KeyClick(key):
try:
win32api.keybd_event(VK_CODE[key], 0, 0, 0)
time.sleep(0.1) # You may need to adjust this delay based on your requirements
win32api.keybd_event(VK_CODE[key], 0, win32con.KEYEVENTF_KEYUP, 0)
except KeyError:
print(f"Key {key} not found in VK_CODE dictionary.")
def KeyHold(key):
try:
win32api.keybd_event(VK_CODE[key], 0, 0, 0)
time.sleep(1) # You may need to adjust this delay based on your requirements
win32api.keybd_event(VK_CODE[key], 0, win32con.KEYEVENTF_KEYUP, 0)
except KeyError:
print(f"Key {key} not found in VK_CODE dictionary.")