From 97f8367a0019bd827086b0e016e44a1c27fce05e Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:55:23 +0800 Subject: [PATCH] Fix: Handle storage page in os_auto_search_quit() --- module/os_handler/map_event.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/module/os_handler/map_event.py b/module/os_handler/map_event.py index ee3244460..7c33989d0 100644 --- a/module/os_handler/map_event.py +++ b/module/os_handler/map_event.py @@ -1,12 +1,13 @@ from module.base.timer import Timer from module.combat.assets import * from module.exception import CampaignEnd -from module.handler.assets import * +from module.handler.assets import POPUP_CANCEL, POPUP_CONFIRM from module.logger import logger from module.os.assets import GLOBE_GOTO_MAP from module.os_handler.assets import * from module.os_handler.enemy_searching import EnemySearchingHandler from module.statistics.azurstats import DropImage +from module.ui.assets import BACK_ARROW from module.ui.switch import Switch @@ -208,7 +209,6 @@ class MapEventHandler(EnemySearchingHandler): if drop: drop.handle_add(main=self, before=4) self.device.click(AUTO_SEARCH_REWARD) - self.clicked = True self.interval_reset([ AUTO_SEARCH_REWARD, AUTO_SEARCH_OS_MAP_OPTION_ON, @@ -225,6 +225,14 @@ class MapEventHandler(EnemySearchingHandler): # because of duplicated clicks and clicks to places outside the map confirm_timer.reset() continue + # Donno why but it just entered storage, exit it anyway + # Equivalent to is_in_storage, but can't inherit StorageHandler here + # STORAGE_CHECK is a duplicate name, this is the os_handler/STORAGE_CHECK, not handler/STORAGE_CHECK + if self.appear(STORAGE_CHECK, offset=(20, 20), interval=5): + logger.info(f'{STORAGE_CHECK} -> {BACK_ARROW}') + self.device.click(BACK_ARROW) + confirm_timer.reset() + continue # End if self.is_in_map():