-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathauto_task.py
337 lines (291 loc) · 13.1 KB
/
auto_task.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
import time
import keyboard as keyboard
from auto_player import Player
my_player = Player(accuracy=0.8, adb_mode=False)
def change_accuracy(new_accuracy):
my_player.change_accuracy(new_accuracy)
def change_interval(new_interval):
my_player.change_interval(new_interval)
def change_click(click_pattern):
my_player.change_click(click_pattern)
def gain_diamond():
if my_player.exist(['free_diamond']):
my_player.find_touch(['free_diamond', 'REWARD'])
def gain_rewards(arena_shop_task):
while True:
# 仓库收米
if my_player.exist(['shop']):
my_player.find_touch_skewing(['shop'], 90, 104)
my_player.find_touch(['destroy'])
if my_player.exist(['start_destroy']):
my_player.find_touch(['start_destroy', 'REWARD'])
my_player.find_touch(['cancel', 'gain_reward', 'REWARD_2', 'REWARD', 'lobby'])
# 友情点
if my_player.exist(['friend']):
my_player.find_touch(['friend', 'give', 'confirm', 'close'])
# 邮箱
if my_player.exist(['mail']):
my_player.find_touch(['mail'])
time.sleep(my_player.interval)
my_player.find_touch(['gain_mail'])
time.sleep(my_player.interval)
my_player.find_touch(['REWARD', 'close_3'])
# 商店每日免费物品
if my_player.exist(['shop']):
my_player.find_touch(['shop', '0'])
my_player.find_touch(['buy', 'REWARD'])
if arena_shop_task:
my_player.find_touch(['arena_shop'])
my_player.find_touch_skewing(['arena_shop_2'], 0, 110)
my_player.find_touch(['buy', 'REWARD'])
my_player.find_touch_skewing(['arena_shop_2'], 0, 220)
my_player.find_touch(['buy', 'REWARD'])
my_player.find_touch_skewing(['arena_shop_2'], 0, 330)
my_player.find_touch(['buy', 'REWARD'])
my_player.find_touch_skewing(['arena_shop_2'], 0, 440)
my_player.find_touch(['buy', 'REWARD'])
my_player.find_touch(['home', 'home'])
time.sleep(my_player.interval)
# 付费商店每日,每周,每月钻石
if my_player.exist(['pay_shop']):
my_player.find_touch(['pay_shop'])
time.sleep(my_player.interval)
if my_player.exist(["restrict"]):
my_player.find_touch_skewing(['restrict'], 90, 110)
my_player.find_touch(['confirm_10'])
my_player.find_touch(['gift'])
my_player.find_touch_skewing(['everyday'], 0, 120)
gain_diamond()
my_player.find_touch_skewing(['everyweek'], 0, 240)
gain_diamond()
my_player.find_touch_skewing(['everyweek'], 0, 360)
gain_diamond()
my_player.find_touch(['home'])
# 特殊竞技场收米
if my_player.exist(['ark']):
my_player.find_touch(['ark', 'ark', 'arena', 'arena', 'special_arena', 'special_arena'])
my_player.find_touch_skewing(['touch'], 90, 87)
time.sleep(my_player.interval)
my_player.find_touch(['gain_reward_2', 'REWARD', 'home'])
time.sleep(my_player.interval)
# 任务委托收米
if my_player.exist(['base']):
my_player.find_touch(['base'])
time.sleep(my_player.interval * 2.5)
my_player.find_touch(['board', 'gain_all', 'REWARD', 'dispatch_all', 'dispatch', 'home', 'home'])
time.sleep(my_player.interval * 2.5)
# 日常任务
if my_player.exist(['mission']):
my_player.find_touch_skewing(['mission'], 180, 150)
my_player.find_touch(['gain_all_2', 'gain_all_2', 'REWARD', 'close_2'])
if my_player.exist(['000']):
break
# 露菲弹窗广告
if my_player.exist(['ad']):
my_player.find_touch(['ad', 'confirm_2'])
def recruit():
my_player.find_touch_same_screen(['recruit_one', 'skip', 'confirm_3'])
def simulation_room(overclocking):
if my_player.exist(['ark']):
my_player.find_touch(['ark', 'simulation_room', 'simulation_room'])
time.sleep(my_player.interval)
if overclocking:
my_player.find_touch_skewing(['start_simulation_1'], 90, 133)
time.sleep(my_player.interval)
my_player.find_touch(['bios_setting', 'start_simulation_3'])
else:
my_player.find_touch(['start_simulation_1', 'difficulty', 'zone'])
time.sleep(my_player.interval)
my_player.find_touch(['start_simulation_2'])
while True:
if my_player.exist(['start_simulation_2']):
my_player.find_touch(['start_simulation_2'])
if my_player.exist(['normal_battle']):
my_player.find_touch(['normal_battle'])
elif my_player.exist(['hard_battle']):
my_player.find_touch(['hard_battle'])
elif my_player.exist(['boss_battle']):
my_player.find_touch(['boss_battle'])
elif my_player.exist(['treatment_room']):
my_player.find_touch(['treatment_room', 'cure', 'confirm_5', 'confirm_5'])
elif my_player.exist(['cure']):
my_player.find_touch(['cure', 'confirm_5', 'confirm_5'])
if my_player.exist(['quick_battle']):
my_player.find_touch(['quick_battle'])
elif my_player.exist(['enter_battle']):
my_player.find_touch(['enter_battle'])
if my_player.exist(['next_step']):
my_player.find_touch(['next_step'])
if my_player.exist(['EPIC']):
my_player.find_touch(['EPIC', 'confirm_7', 'confirm_4'])
handle_buff()
elif my_player.exist(['SSR']):
my_player.find_touch(['SSR', 'confirm_7', 'confirm_4'])
handle_buff()
elif my_player.exist(['SR']):
my_player.find_touch(['SR', 'confirm_7', 'confirm_4'])
handle_buff()
elif my_player.exist(['R']):
my_player.find_touch(['R', 'confirm_7', 'confirm_4'])
handle_buff()
handle_buff()
if my_player.exist(['enter_B']):
my_player.find_touch(['enter_B'])
elif my_player.exist(['enter_C']):
my_player.find_touch(['enter_C'])
elif my_player.exist(['end_simulation']):
my_player.find_touch(['end_simulation', 'confirm_9'])
if my_player.exist(['EPIC']):
my_player.find_touch(['EPIC', 'confirm_4'])
elif my_player.exist(['SSR']):
my_player.find_touch(['SSR', 'confirm_4'])
elif my_player.exist(['SR']):
my_player.find_touch(['SR', 'confirm_4'])
elif my_player.exist(['R']):
my_player.find_touch(['R', 'confirm_4'])
handle_buff()
my_player.find_touch(['home', 'home'])
break
def auto_consult():
while True:
if my_player.exist(['lobby']):
my_player.find_touch_skewing(['lobby'], 180, 145)
my_player.find_touch(['consult'])
if my_player.exist(['quick_consult']):
my_player.find_touch(['quick_consult', 'confirm_6', 'next_nikke'])
continue
if my_player.exist(['nikke_consult']):
my_player.find_touch_skewing(['nikke_consult'], 90, 110)
if my_player.exist(['quick_consult']):
my_player.find_touch(['quick_consult', 'confirm_6', 'next_nikke'])
else:
my_player.find_touch(['consult_2', 'confirm_6', 'confirm_6', 'auto'])
if my_player.exist(['consult_2']):
my_player.find_touch(['consult_2', 'confirm_6', 'confirm_6', 'auto'])
if my_player.exist(['confirm_6']):
my_player.find_touch(['confirm_6'])
# 小红帽选项
if my_player.exist(['consult_option_2']):
time.sleep(my_player.interval)
my_player.find_touch(['consult_option', 'skip', 'next_nikke'])
if my_player.exist(['consult_option']):
time.sleep(my_player.interval)
my_player.find_touch(['consult_option', 'skip', 'next_nikke'])
if my_player.exist(['rank_up']):
my_player.find_touch(['rank_up', 'next_nikke'])
if my_player.exist(['consult_done']) and my_player.exist(['next_nikke']):
my_player.find_touch(['next_nikke'])
if my_player.exist(['consult_done']):
my_player.find_touch(['home'])
break
def auto_arena():
while True:
if my_player.exist(['ark']):
my_player.find_touch(['ark', 'arena', 'arena', 'rookie_arena'])
if my_player.exist(['rookie_arena']):
my_player.find_touch(['rookie_arena'])
if my_player.exist(['enter_battle_2']):
my_player.find_touch_skewing(['enter_battle_2'], 90, 190)
my_player.find_touch(['enter_battle_3'])
if my_player.exist(['win']):
my_player.find_touch(['win'])
if my_player.exist(['lose']):
my_player.find_touch(['lose'])
if my_player.exist(['enter_battle_4']) and not my_player.exist(['enter_battle_2']):
my_player.find_touch(['home'])
break
def union_battle():
while True:
if my_player.exist(['friend']):
my_player.find_touch_skewing(['friend'], 90, 60)
if my_player.exist(['union_attack']):
my_player.find_touch(['union_attack', 'skip_reward', 'skip_reward', 'confirm_8'])
if my_player.exist(['union_attack_2']):
my_player.find_touch_skewing(['union_attack_2'], 90, 285)
if my_player.exist(['enter_union_battle']):
my_player.find_touch(['enter_union_battle'])
elif my_player.exist(['02']):
my_player.find_touch(['02', 'enter_union_battle'])
if my_player.exist(['03']):
my_player.find_touch(['03', 'enter_union_battle'])
if my_player.exist(['battle_times_done']):
my_player.find_touch(['home'])
time.sleep(1)
break
if my_player.exist(['next_step']):
my_player.find_touch(['next_step'])
if my_player.exist(['confirm_8']):
if my_player.exist(['skip_reward']):
my_player.find_touch(['skip_reward'])
my_player.find_touch(['confirm_8'])
def interception_battle():
while True:
if my_player.exist(['next_step']):
my_player.find_touch(['next_step'])
if my_player.exist(['ark']):
my_player.find_touch(['ark', 'interception', 'interception'])
if my_player.exist(['interception_battle']):
my_player.find_touch_skewing(['interception_battle'], 90, 170)
if my_player.exist(['quick_battle_2']):
my_player.find_touch(['quick_battle_2', 'next_step'])
elif my_player.exist(['enter_union_battle']):
my_player.find_touch(['enter_union_battle'])
else:
my_player.find_touch(['home'])
break
def single_raids():
while True:
if my_player.exist(['challenge_mode']):
my_player.find_touch(['7'])
if my_player.exist(['single_raids']):
my_player.find_touch(['single_raids'])
if my_player.exist(['quick_battle_2']):
my_player.find_touch(['quick_battle_2', 'max'])
my_player.find_touch_skewing(['max'], 35, 100)
elif my_player.exist(['challenge']):
my_player.find_touch(['challenge', 'confirm_2'])
if my_player.exist(['enter_union_battle']):
my_player.find_touch(['enter_union_battle'])
elif my_player.exist(['team_set']):
my_player.find_touch_skewing(['team_set_2'], 0, 43)
my_player.find_touch(['enter_union_battle'])
if my_player.exist(['next_step']):
my_player.find_touch(['next_step'])
if my_player.exist(['enemy_defeated']):
my_player.find_touch(['enemy_defeated'])
if my_player.exist(['battle_times_done_2']):
my_player.find_touch(['home'])
break
def continuous_click():
while True:
if keyboard.is_pressed('q'):
my_player.continuous_click()
def auto_all(auto_task_list, arena_shop_task, overclocking):
if auto_task_list[0]:
simulation_room(overclocking)
time.sleep(my_player.interval)
if auto_task_list[1]:
auto_arena()
time.sleep(my_player.interval)
if auto_task_list[2]:
auto_consult()
time.sleep(my_player.interval)
if auto_task_list[4]:
union_battle()
time.sleep(my_player.interval)
if auto_task_list[5]:
interception_battle()
time.sleep(my_player.interval)
if auto_task_list[6]:
single_raids()
time.sleep(my_player.interval)
if auto_task_list[3]:
gain_rewards(arena_shop_task)
time.sleep(my_player.interval)
def handle_buff():
if my_player.exist(['exceeded_buff']):
my_player.find_touch_skewing(['exceeded_buff'], 90, 300)
my_player.find_touch(['confirm_4'])
if my_player.exist(['repeated_buff']):
my_player.find_touch_skewing(['repeated_buff'], 90, 300)
my_player.find_touch(['confirm_4'])