-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
60 lines (43 loc) · 1.29 KB
/
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
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
import time
import pyautogui
from cicauto.controller import cicauto
from cicauto.strategy import MainWorkshopStrat, EventWorkshopStrat
def position_finder(rel=False, offset=None):
print('Press Ctrl-C to quit.')
offset_x, offset_y = 0, 0
if rel:
offset_x, offset_y = offset[0], offset[1]
try:
while True:
x, y = pyautogui.position()
x -= offset_x
y -= offset_y
position_str = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4)
print(position_str)
except KeyboardInterrupt:
pass
def run_auto(state, strat):
while state.is_running():
try:
strat.update()
except Exception as e:
state.stop()
raise e
def main():
pyautogui.FAILSAFE = False
my_strat = MainWorkshopStrat(game=cicauto)
run_auto(cicauto, my_strat)
def event():
# pyautogui.PAUSE = 0.01
# NOTE: Currently broken
my_strat = EventWorkshopStrat(game=cicauto)
run_auto(cicauto, my_strat)
def debugger():
from cicauto.sdk.base import BaseContext
offset = BaseContext.get_game_offset()
position_finder(rel=True, offset=offset)
if __name__ == '__main__':
main()
# event()
# debugger()
# OCR Problem levels: 1, 11, 31, 51, 55, 57, 77, 91