@@ -110,8 +110,10 @@ def activity(self):
110
110
if activities := self .wait_ocr (match = [re .compile (r'^\d+天\d+小时' )], box = 'bottom_left' ,
111
111
raise_if_not_found = False , time_out = 4 ):
112
112
self .click (activities [0 ])
113
- if self .wait_click_ocr (match = ['活动战役' , '物资模式' ], box = 'bottom' , after_sleep = 0.5 ,
114
- raise_if_not_found = False , time_out = 4 , log = True ):
113
+ if to_click := self .wait_ocr (match = ['活动战役' , '物资模式' ], box = 'bottom' ,
114
+ raise_if_not_found = False , time_out = 4 , log = True ):
115
+ self .sleep (2 )
116
+ self .click (to_click )
115
117
battles = self .wait_ocr (match = map_re , time_out = 4 )
116
118
if battles :
117
119
self .click (battles [- 1 ])
@@ -150,7 +152,7 @@ def arena(self):
150
152
self .wait_click_ocr (match = ['战役推进' ], box = 'right' , after_sleep = 0.5 , raise_if_not_found = True )
151
153
self .wait_click_ocr (match = ['模拟作战' ], box = 'top_right' , after_sleep = 0.5 , raise_if_not_found = True )
152
154
self .wait_click_ocr (match = ['实兵演习' ], box = 'bottom' , after_sleep = 0.5 , raise_if_not_found = True )
153
- self .wait_pop_up (time_out = 4 )
155
+ self .wait_pop_up (time_out = 10 )
154
156
remaining_count = self .arena_remaining ()
155
157
count = 0
156
158
if remaining_count > 1 :
@@ -187,7 +189,7 @@ def bingqi(self):
187
189
def guild (self ):
188
190
self .info_set ('current_task' , 'guild' )
189
191
self .wait_click_ocr (match = ['班组' ], box = 'bottom_right' , after_sleep = 0.5 , raise_if_not_found = True )
190
- self .wait_click_ocr (match = ['要务' ], box = 'bottom_right' , after_sleep = 0.5 , raise_if_not_found = True )
192
+ self .wait_click_ocr (match = ['要务' ], box = 'bottom_right' , after_sleep = 0.5 , raise_if_not_found = True , settle_time = 2 )
191
193
result = self .wait_ocr (match = ['开始作战' , '每日要务已完成' ], box = 'bottom_right' ,
192
194
raise_if_not_found = True , log = True )
193
195
if result [0 ].name == '开始作战' :
@@ -267,8 +269,8 @@ def wait_click_ocr_with_pop_up(self, match, box=None):
267
269
268
270
def do_wait_pop_up_and_click (self , match , box ):
269
271
boxes = self .ocr ()
270
- if pop_up := find_boxes_by_name (boxes , pop_ups ):
271
- self .click ( pop_up )
272
+ if find_boxes_by_name (boxes , pop_ups ):
273
+ self .back ( after_sleep = 2 )
272
274
return False
273
275
elif click := find_boxes_by_name (boxes , match ):
274
276
if click := find_boxes_within_boundary (click , self .get_box_by_name (box )):
@@ -284,8 +286,8 @@ def wait_ocr_with_possible_pop_up(self, match, box=None, raise_if_not_found=True
284
286
285
287
def do_wait_ocr_with_possible_pop_up (self , match , box ):
286
288
boxes = self .ocr ()
287
- if pop_up := find_boxes_by_name (boxes , pop_ups ):
288
- self .click ( pop_up )
289
+ if find_boxes_by_name (boxes , pop_ups ):
290
+ self .back ( after_sleep = 2 )
289
291
return False
290
292
elif click := find_boxes_by_name (boxes , match ):
291
293
if box :
@@ -324,9 +326,7 @@ def challenge_arena_opponent(self):
324
326
self .click (box )
325
327
self .wait_click_ocr (match = ['进攻' ], box = 'bottom_right' , after_sleep = 0.5 ,
326
328
raise_if_not_found = True )
327
- self .auto_battle ()
328
- self .wait_ocr_with_possible_pop_up (match = '刷新' , box = 'bottom_right' , raise_if_not_found = True ,
329
- time_out = 30 )
329
+ self .auto_battle (end_match = '刷新' )
330
330
self .sleep (3 )
331
331
challenged += 1
332
332
continue
0 commit comments