From 25c9f6638cbe5592782b80fa9b9cde6d12117881 Mon Sep 17 00:00:00 2001 From: "firedcto@gmail.com" Date: Sat, 16 Nov 2024 01:19:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=87=AA=E5=8A=A8=E6=88=98?= =?UTF-8?q?=E6=96=97=E9=94=81=E5=AE=9A=E6=95=8C=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/combat/CombatCheck.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/combat/CombatCheck.py b/src/combat/CombatCheck.py index b95c375..008652a 100644 --- a/src/combat/CombatCheck.py +++ b/src/combat/CombatCheck.py @@ -164,9 +164,8 @@ def in_combat(self): if not self._in_realm: self._in_multiplayer = self.in_multiplayer() in_combat = self.has_target() or ((not self.check_team or self.in_team()[0]) and self.check_health_bar()) - in_combat = in_combat and self.check_target_enemy_btn() + in_combat = in_combat and self.check_target_enemy_btn() and self.target_enemy(wait=True) if in_combat: - self.target_enemy(wait=False) logger.info( f'enter combat cost {(time.time() - start):2f} boss_lv_template:{self.boss_lv_template is not None} boss_health_box:{self.boss_health_box} has_count_down:{self.has_count_down}') self._in_combat = True @@ -220,9 +219,11 @@ def target_enemy(self, wait=True): else: if self.has_target(): return True - return self.wait_until(self.has_target, time_out=1.5, wait_until_before_delay=0, - wait_until_check_delay=0.3, - pre_action=self.middle_click) + else: + logger.info(f'target lost try retarget') + return self.wait_until(self.has_target, time_out=2.1, wait_until_before_delay=0.1, + wait_until_check_delay=0.5, + pre_action=self.middle_click) def check_health_bar(self): if self._in_combat: