-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHotkeys.py
59 lines (42 loc) · 1.17 KB
/
Hotkeys.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
import pyautogui
import time
tempGroup = 9
HandleToHotKeys: dict = {
"Deselect All": ["esc"],
# Game world Hotkeys
"Move Camera Left": ["left"],
"Move Camera Right": ["right"],
"Move Camera Forward": ["up"],
"Move Camera Backward": ["down"],
# Find Unit Hotkeys
"Find idle Villager": ["."],
"Find Explorer": ["é"],
"Find idle Military": [","],
"Find Home City": ["h"],
"Find Town Center": ["t"],
"Find Wagon": [";"],
"Find Mill": ["CTRL", "i"],
"Find Market": ["CTRL", "m"],
# Building Construction Hotkeys
"Build Town Center": ["g"],
"Build Market": ["m"],
"Build Mill": ["i"],
# Selection Group Hotkeys
"Select temp Group": [str(tempGroup)],
"Create temp Group": ["CTRL", str(tempGroup)],
"Create Group 9": ["CTRL", "9"],
# Town Center Hotkeys
"Train Villager": ["v"],
}
def sleepKeys(func):
time.sleep(0.1)
re = func
time.sleep(0.7)
return re
@sleepKeys
def SendHotKeys(handle: str):
assert handle in HandleToHotKeys
pyautogui.hotkey(*HandleToHotKeys[handle])
@sleepKeys
def Find_idle_Villager():
pyautogui.hotkey(*HandleToHotKeys["Find idle Villager"])