Skip to content

Commit 5c4ac94

Browse files
committed
修复卡住
1 parent c529309 commit 5c4ac94

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/tasks/BaseGfTask.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,18 @@ def auto_battle(self, end_match=None, end_box=None, has_dialog=False):
9898
if results[0].name != '战斗失败':
9999
self.wait_click_ocr(match='确认', box='bottom_right', raise_if_not_found=False, time_out=5)
100100
if end_match:
101+
if isinstance(end_match, list):
102+
end_match = end_match + pop_ups
103+
else:
104+
end_match = [end_match] + pop_ups
101105
while True:
102-
match = self.wait_ocr(match=end_match + pop_ups, box=end_box, raise_if_not_found=True, time_out=30)
106+
match = self.wait_ocr(match=end_match, box=end_box, raise_if_not_found=True, time_out=30)
103107
if match[0].name in pop_ups:
104108
self.back(after_sleep=2)
105109
continue
106110
if match:
107111
self.log_info(f'battle end matched: {match}')
112+
break
108113
self.sleep(2)
109114

110115
def is_main(self, recheck_time=0, esc=True):

0 commit comments

Comments
 (0)