-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.py
More file actions
39 lines (30 loc) · 654 Bytes
/
Copy pathgame.py
File metadata and controls
39 lines (30 loc) · 654 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
36
37
38
39
import ctypes
from time import sleep
KEYEVENTF_EXTENDEDKEY = 0x0001
KEYEVENTF_KEYUP = 0x0002
VK_CAPITAL = 0x14
VK_NUMLOCK = 0x90
VK_SCROLL = 0x91
keybd_event = ctypes.windll.user32.keybd_event
def pressKey(key):
# Press key
keybd_event(key, 0, KEYEVENTF_EXTENDEDKEY | 0, 0)
# And release it
keybd_event(key, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0)
return
def playGame(game):
return
def main():
while True:
pressKey(VK_NUMLOCK)
sleep(0.2)
pressKey(VK_NUMLOCK)
pressKey(VK_CAPITAL)
sleep(0.2)
pressKey(VK_CAPITAL)
pressKey(VK_SCROLL)
sleep(0.2)
pressKey(VK_SCROLL)
return
if __name__ == '__main__':
main()