-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__main__.py
More file actions
72 lines (62 loc) · 1.48 KB
/
__main__.py
File metadata and controls
72 lines (62 loc) · 1.48 KB
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
65
66
67
68
69
70
71
72
'''
Stellaris game assistant.
Assignes hotkey to planet prev/next buttons and
pop growth specification buttons.
'''
DEFAULT_POS = [750, 100]
BUTTON_DISTANCE = 35
import mouse
import keyboard
from time import sleep
pos = DEFAULT_POS[:]
def main():
keyboard.add_hotkey('p', clickPrev)
keyboard.add_hotkey('[', clickNext)
keyboard.add_hotkey(']', clickGrowing)
keyboard.add_hotkey('\\', clickAssembling)
keyboard.add_hotkey('shift+p', setPrev)
# keyboard.block_key('m')
print('go...')
try:
while True:
sleep(1)
except KeyboardInterrupt:
print('Ctrl+C received. Quiting...')
finally:
keyboard.unregister_all_hotkeys()
print('All resources released. ')
def clickPrev():
print('prev')
mouse.move(*pos)
sleep(.1)
mouse.click()
def clickNext():
print('next')
mouse.move(pos[0] + BUTTON_DISTANCE, pos[1])
sleep(.1)
mouse.click()
def clickGrowing():
print('assembling')
mouse.move(pos[0] - 35, pos[1] + 280)
sleep(.1)
mouse.click()
sleep(.1)
#mouse.move(pos[0] + 200, pos[1] + 280)
mouse.move(pos[0] + 200, pos[1] + 130)
sleep(.1)
mouse.click()
def clickAssembling():
print('assembling')
mouse.move(pos[0] + 20, pos[1] + 280)
sleep(.1)
mouse.click()
sleep(.1)
mouse.move(pos[0] + 200, pos[1] + 280)
sleep(.1)
mouse.click()
def setPrev():
x, y = mouse.get_position()
pos[0] = x
pos[1] = y
print(x, y)
main()