diff --git a/autowsgr/infra/config.py b/autowsgr/infra/config.py index 12f214c8..62c50bf9 100644 --- a/autowsgr/infra/config.py +++ b/autowsgr/infra/config.py @@ -228,6 +228,8 @@ class DecisiveConfig(BaseModel): """旗舰优先级队列""" repair_level: int = 1 """维修策略 (1=中破修, 2=大破修)""" + use_quick_repair: bool = True + """是否使用快修""" full_destroy: bool = False """船舱满了是否解装舰船""" useful_skill: bool = False diff --git a/autowsgr/ops/decisive/handlers.py b/autowsgr/ops/decisive/handlers.py index 8f141f23..3ea0d592 100644 --- a/autowsgr/ops/decisive/handlers.py +++ b/autowsgr/ops/decisive/handlers.py @@ -246,6 +246,7 @@ def _handle_prepare_combat(self) -> None: current_fleet = self._state.fleet[:] if current_fleet != best_fleet: + time.sleep(0.5) # 等待进入出征准备页面 page.change_fleet(None, best_fleet[1:]) self._state.fleet = best_fleet else: diff --git a/autowsgr/ops/decisive/logic.py b/autowsgr/ops/decisive/logic.py index 9c36ee78..ca24d716 100644 --- a/autowsgr/ops/decisive/logic.py +++ b/autowsgr/ops/decisive/logic.py @@ -201,11 +201,11 @@ def get_best_fleet(self) -> list[str]: best: list[str] = [''] _log.debug('[决战] 当前舰船: {}', ships) for ship in self.config.level1: - if ship in ships and self._is_available(ship) and len(best) < 7: + if ship in ships and self._is_available(ship) and len(best) <= 7: best.append(ship) for ship in self.config.level2: - if ship in ships and ship not in best and self._is_available(ship) and len(best) < 7: + if ship in ships and ship not in best and self._is_available(ship) and len(best) <= 7: best.append(ship) for flag_ship in self.config.flagship_priority: @@ -214,7 +214,7 @@ def get_best_fleet(self) -> list[str]: best[idx], best[1] = best[1], best[idx] break - while len(best) < 7: + while len(best) <= 7: best.append('') _log.debug('[决战] 最优编队: {}', best) diff --git a/autowsgr/ui/decisive/fleet_ocr.py b/autowsgr/ui/decisive/fleet_ocr.py index ba71995c..a153f783 100644 --- a/autowsgr/ui/decisive/fleet_ocr.py +++ b/autowsgr/ui/decisive/fleet_ocr.py @@ -135,7 +135,7 @@ def use_skill( ship_area = ROI(x1=0.26, y1=0.685, x2=0.74, y2=0.715) ctrl.click(*skill_pos) - time.sleep(0.5) + time.sleep(1.0) screen = ctrl.screenshot() crop = ship_area.crop(screen) diff --git a/autowsgr/ui/map/panels/decisive.py b/autowsgr/ui/map/panels/decisive.py index 4f987a28..c8921d91 100644 --- a/autowsgr/ui/map/panels/decisive.py +++ b/autowsgr/ui/map/panels/decisive.py @@ -29,6 +29,9 @@ def enter_decisive(self) -> None: _log.info('[UI] 地图页面 → 决战页面') + # 0. 等待一下,确保地图页面加载完成 + time.sleep(0.5) + # 1. 确保在决战面板 self.ensure_panel(MapPanel.DECISIVE) time.sleep(0.5)