diff --git a/config.py b/config.py index 647c561..c3626b9 100644 --- a/config.py +++ b/config.py @@ -33,10 +33,12 @@ config = { 'windows': { # required when supporting windows game 'exe': 'Client-Win64-Shipping.exe', 'calculate_pc_exe_path': calculate_pc_exe_path, + 'hwnd_class': 'UnrealWindow', 'interaction': 'PostMessage', 'can_bit_blt': True, # default false, opengl games does not support bit_blt 'bit_blt_render_full': True, - 'check_hdr_and_night_light': True + 'check_hdr_and_night_light': True, + 'require_bg': True }, 'supported_resolution': { 'ratio': '16:9', diff --git a/src/char/BaseChar.py b/src/char/BaseChar.py index fbccb09..0336115 100644 --- a/src/char/BaseChar.py +++ b/src/char/BaseChar.py @@ -51,6 +51,7 @@ class BaseChar: self.logger = get_logger(self.name) self.full_ring_area = 0 self.freeze_durations = [] + self.last_perform = 0 self._is_forte_full = False self.config = {"_full_ring_area": 0, "_ring_color_index": -1} if type(self) is not BaseChar: @@ -71,6 +72,7 @@ class BaseChar: def perform(self): # self.wait_down() + self.last_perform = time.time() self.do_perform() self.logger.debug(f'set current char false {self.index}') diff --git a/src/task/BaseCombatTask.py b/src/task/BaseCombatTask.py index f30f351..ecc214d 100644 --- a/src/task/BaseCombatTask.py +++ b/src/task/BaseCombatTask.py @@ -107,7 +107,6 @@ class BaseCombatTask(BaseWWTask, FindFeature, OCR, CombatCheck): current_con = current_char.get_current_con() if current_con == 1: has_intro = True - for i, char in enumerate(self.chars): if char == current_char: priority = Priority.CURRENT_CHAR @@ -121,8 +120,10 @@ class BaseCombatTask(BaseWWTask, FindFeature, OCR, CombatCheck): max_priority = priority switch_to = char if switch_to == current_char: - # self.check_combat() logger.warning(f"can't find next char to switch to, maybe switching too fast click and wait") + if time.time() - current_char.last_perform < 0.1: + current_char.continues_normal_attack(0.1) + logger.warning(f"can't find next char to switch to, performing too fast add a normal attack") return current_char.perform() switch_to.has_intro = has_intro logger.info(f'switch_next_char {current_char} -> {switch_to} has_intro {has_intro}')