This repository has been archived by the owner on Sep 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmain.py
63 lines (52 loc) · 1.42 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
61
62
63
from interface.Major import *
from recovery.recover import *
from config import recovery_times, run_time
from util.ats import screenshot
from util.clean import clean_tmp
times = recovery_times
play = run_time
f = open('log.txt', 'w')
st = '[MAIN] MAX APPLES: ' + \
str(times) + '\r' + '[MAIN] MAX TIMES: ' + str(play) + '\r'
f.write(st)
f.close()
clean_tmp()
while times >= 0:
time.sleep(0.2)
screenshot()
s = Major()
end = s.recognize()
if play == "inf":
ap = recover_ap()
if ap == 1 and times != 0:
continue
elif ap == 1 and times == 0:
apa = '[MAIN] Out of AP!'
output_log(apa)
break
elif ap == 2:
times = times - 1
out = '[MAIN] Apples left: ' + str(times)
output_log(out)
time.sleep(2)
elif play != "inf":
if end == "end":
play = play - 1
pl = '[MAIN] Times left: ' + str(play)
output_log(pl)
ap = recover_ap()
if ap == 1 and times != 0:
continue
elif ap == 1 and times == 0:
apb = '[MAIN] Out of AP!'
output_log(apb)
break
elif ap == 2:
times = times - 1
out = '[MAIN] Apples left: ' + str(times)
output_log(out)
time.sleep(2)
if play == 0:
break
endnote = '[MAIN] FINISHED'
output_log(endnote)