diff --git a/autowsgr/__init__.py b/autowsgr/__init__.py index e398332..96e3ce8 100644 --- a/autowsgr/__init__.py +++ b/autowsgr/__init__.py @@ -1 +1 @@ -__version__ = '1.3.2' +__version__ = '1.4.0' diff --git a/autowsgr/game/game_operation.py b/autowsgr/game/game_operation.py index cc20c2b..34edcf4 100644 --- a/autowsgr/game/game_operation.py +++ b/autowsgr/game/game_operation.py @@ -59,15 +59,13 @@ def click_result(timer: Timer, max_times=1): timer.wait_images(IMG.fight_image[14]) looted = False while timer.wait_image(IMG.fight_image[14], timeout=0.5): - if not looted: + if timer.can_get_loot and not looted: if timer.image_exist(IMG.fight_result['LOOT'], need_screen_shot=True): timer.got_loot_num += 1 timer.logger.info(f'捞到胖次! 当前胖次数:{timer.got_loot_num}') looted = True else: timer.logger.debug('没有识别到胖次') - else: - timer.logger.debug('已经识别过胖次') timer.click(915, 515, delay=0.25, times=1) diff --git a/autowsgr/game/get_game_info.py b/autowsgr/game/get_game_info.py index 7667abd..ef9f799 100644 --- a/autowsgr/game/get_game_info.py +++ b/autowsgr/game/get_game_info.py @@ -143,12 +143,17 @@ def get_loot_and_ship(timer: Timer): try: timer.got_loot_num = ret.get('loot') if timer.got_loot_num is None: + timer.can_get_loot = False timer.got_loot_num = 0 except: timer.logger.warning('赋值给got_loot_num失败') + timer.can_get_loot = False timer.got_loot_num = 0 - timer.logger.info(f'已掉落胖次:{timer.got_loot_num}') timer.logger.info(f'已掉落舰船:{timer.got_ship_num}') + if timer.can_get_loot: + timer.logger.info(f'已掉落胖次:{timer.got_loot_num}') + else: + timer.logger.info('胖次活动未开启, 无法捞胖次') return ret diff --git a/autowsgr/scripts/daily_api.py b/autowsgr/scripts/daily_api.py index c5b12f0..9ad79c3 100644 --- a/autowsgr/scripts/daily_api.py +++ b/autowsgr/scripts/daily_api.py @@ -120,8 +120,9 @@ def _get_unfinished_plan_description(self, i: int) -> str: plan_str += f'正在执行的PLAN: {self.fight_complete_times[i][2]}, ' plan_str += f'已出击次数/目标次数: {self.fight_complete_times[i][0]}/{self.fight_complete_times[i][1]}, ' plan_str += f'消耗快修数量: {self.timer.quick_repaired_cost}, ' - plan_str += f'已掉落船数量: {self.timer.got_ship_num}, ' - plan_str += f'已掉落胖次数量: {self.timer.got_loot_num}' + plan_str += f'已掉落船数量: {self.timer.got_ship_num}' + if self.timer.can_get_loot: + plan_str += f', 已掉落胖次数量: {self.timer.got_loot_num}' return plan_str def _get_unfinished(self) -> int: diff --git a/autowsgr/timer/timer.py b/autowsgr/timer/timer.py index 773c21a..bccec41 100644 --- a/autowsgr/timer/timer.py +++ b/autowsgr/timer/timer.py @@ -40,6 +40,7 @@ def __init__(self, config: UserConfig, logger: Logger) -> None: self.got_ship_num = 0 # 当天已掉落的船 self.got_loot_num = 0 # 当天已掉落的胖次 self.quick_repaired_cost = 0 # 消耗快修数量 + self.can_get_loot = True # 是否可以捞胖次 """ 以上时能用到的 以下是暂时用不到的