-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
29 lines (23 loc) · 807 Bytes
/
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
import keyboard
from time import sleep
print('Now launch up a game! REMEMBER TO ALWAYS PRESS THE Q KEY TO EXIT THE PROGRAM!')
for key in list('failsafe'):
while not keyboard.is_pressed(key):
pass
keyboard.wait('enter')
while True:
if keyboard.is_pressed('q'):
break
if keyboard.is_pressed('up') or \
keyboard.is_pressed('w') or \
keyboard.is_pressed('space') or \
keyboard.is_pressed('enter'):
keyboard.press_and_release('w')
if keyboard.is_pressed('left') or \
keyboard.is_pressed('d'):
keyboard.press_and_release('d')
if keyboard.is_pressed('right') or \
keyboard.is_pressed('a'):
keyboard.press_and_release('a')
keyboard.press_and_release('enter')
sleep(0.3)