Skip to content

Commit 3b6dfb0

Browse files
committed
bug fix
1 parent 9977012 commit 3b6dfb0

4 files changed

Lines changed: 19 additions & 8 deletions

File tree

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ numpy==2.2.6
2121
# opencv-python
2222
# openvino
2323
# shapely
24-
ok-script==1.0.13
24+
ok-script==1.0.14
2525
# via -r requirements.in
2626
onnxocr-ppocrv4==0.0.5
2727
# via -r requirements.in

src/tasks/AutoDefence.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,20 @@ def do_run(self):
9191
if _status == Mission.START:
9292
self.wait_until(self.in_team, time_out=30)
9393
self.sleep(2)
94+
self.init_param()
9495
if self.external_movement is not _default_movement:
9596
self.log_info("任务开始")
96-
if not self.external_movement():
97+
self.external_movement()
98+
time_out = 10
99+
self.log_info(f"外部移动执行完毕,等待战斗开始,{time_out}秒后超时")
100+
if not self.wait_until(lambda: self.current_wave != -1, post_action=self.get_wave_info, time_out=time_out):
101+
self.log_info(f"超时重开")
97102
self.open_in_mission_menu()
103+
else:
104+
self.log_info(f"战斗开始")
98105
else:
99106
self.log_info_notify("任务开始")
100107
self.soundBeep()
101-
self.init_param()
102108
elif _status == Mission.STOP:
103109
self.quit_mission()
104110
self.init_param()
@@ -111,7 +117,6 @@ def do_run(self):
111117
self.sleep(0.2)
112118

113119
def init_param(self):
114-
self.stop_mission = False
115120
self.current_round = -1
116121
self.current_wave = -1
117122

src/tasks/AutoExploration.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,17 @@ def do_run(self):
8787
if _status == Mission.START:
8888
self.wait_until(self.in_team, time_out=30)
8989
self.sleep(2)
90+
self.init_param()
9091
if self.external_movement is not _default_movement:
9192
self.log_info("任务开始")
92-
if not self.external_movement():
93+
self.external_movement()
94+
time_out = 10
95+
self.log_info(f"外部移动执行完毕,等待战斗开始,{time_out}秒后超时")
96+
if not self.wait_until(self.find_serum, time_out=time_out):
97+
self.log_info(f"超时重开")
9398
self.open_in_mission_menu()
99+
else:
100+
self.log_info(f"战斗开始")
94101
else:
95102
self.log_info_notify("任务开始")
96103
self.soundBeep()
@@ -106,7 +113,7 @@ def do_run(self):
106113
self.sleep(0.2)
107114

108115
def init_param(self):
109-
self.current_wave = -1
116+
self.current_round = -1
110117

111118
def stop_func(self):
112119
self.get_round_info()

src/tasks/ImportTask.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ def do_run(self):
135135
self.log_info('任务完成')
136136
self.wait_until(self.in_team, time_out=30)
137137
self.sleep(2)
138-
if not self.walk_to_aim():
139-
self.open_in_mission_menu()
138+
self.walk_to_aim()
140139
_wave_start = time.time()
141140
_delay_task_start = _wave_start + 1
142141
self.current_wave = -1

0 commit comments

Comments
 (0)