Skip to content

Commit

Permalink
修复自动战斗报错
Browse files Browse the repository at this point in the history
修复椿结束战斗可能不切人
  • Loading branch information
ok-oldking committed Jan 16, 2025
1 parent 21bb22a commit 6078909
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/char/Camellya.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@ def wait_resonance_not_gray(self, timeout=5):
def on_combat_end(self, chars):
next_char = str((self.index + 1) % len(chars) + 1)
self.logger.debug(f'Camellya on_combat_end {self.index} switch next char: {next_char}')
self.task.send_key(next_char)
start = time.time()
while time.time() - start < 6:
self.task.load_chars()
current_char = self.task.get_current_char(raise_exception=False)
if current_char and current_char.name != "Camellya":
break
else:
self.task.send_key(next_char)
self.sleep(0.2, False)
self.logger.debug(f'Camellya on_combat_end {self.index} switch end')

def do_perform(self):
if self.has_intro:
Expand Down
2 changes: 1 addition & 1 deletion src/combat/CombatCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def has_target(self):
def has_long_actionbar_chars(self):
if not self._in_combat:
self.load_chars()
current_char = self.get_current_char()
current_char = self.get_current_char(raise_exception=False)
if current_char and current_char.has_long_actionbar():
return True
return False
Expand Down

0 comments on commit 6078909

Please sign in to comment.