From ac7be3e9508511dbb59efdfea203d25820c5943e Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Thu, 30 May 2024 17:33:05 +0800 Subject: [PATCH] Fix: Check page_planner before scanning --- tasks/planner/scan.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasks/planner/scan.py b/tasks/planner/scan.py index 5580c177b..353c51904 100644 --- a/tasks/planner/scan.py +++ b/tasks/planner/scan.py @@ -6,6 +6,7 @@ from module.base.utils import area_center, area_in_area from module.logger import logger from module.ocr.ocr import Ocr, OcrWhiteLetterOnComplexBackground from module.ui.scroll import AdaptiveScroll +from tasks.base.page import page_planner from tasks.daily.synthesize import SynthesizeUI from tasks.planner.assets.assets_planner_result import * from tasks.planner.keywords import ITEM_CLASSES @@ -167,6 +168,10 @@ class PlannerScan(SynthesizeUI, PlannerMixin): in: planner result """ logger.hr('Parse planner result', level=2) + if not self.ui_page_appear(page_planner): + logger.error('Not in page_planner, game must in the planner result page before scanning') + return [] + scroll = AdaptiveScroll(RESULT_SCROLL.button, name=RESULT_SCROLL.name) scroll.drag_threshold = 0.1 scroll.edge_threshold = 0.1