mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-16 06:25:24 +00:00
Chore: Treat invalid staring page of planner scan as GamePageUnknownError
so error image can be saved
This commit is contained in:
parent
33eedc2c63
commit
365b1744e5
@ -101,7 +101,7 @@ class AzurLaneAutoScript:
|
|||||||
self.device.sleep(10)
|
self.device.sleep(10)
|
||||||
return False
|
return False
|
||||||
except GamePageUnknownError:
|
except GamePageUnknownError:
|
||||||
logger.info('Game server may be under maintenance or network may be broken, check server status now')
|
# logger.info('Game server may be under maintenance or network may be broken, check server status now')
|
||||||
self.checker.check_now()
|
self.checker.check_now()
|
||||||
if self.checker.is_available():
|
if self.checker.is_available():
|
||||||
logger.critical('Game page unknown')
|
logger.critical('Game page unknown')
|
||||||
|
@ -4,6 +4,7 @@ import cv2
|
|||||||
from pponnxcr.predict_system import BoxedResult
|
from pponnxcr.predict_system import BoxedResult
|
||||||
|
|
||||||
from module.base.utils import area_center, area_in_area
|
from module.base.utils import area_center, area_in_area
|
||||||
|
from module.exception import GamePageUnknownError
|
||||||
from module.logger import logger
|
from module.logger import logger
|
||||||
from module.ocr.ocr import Ocr, OcrWhiteLetterOnComplexBackground
|
from module.ocr.ocr import Ocr, OcrWhiteLetterOnComplexBackground
|
||||||
from module.ui.scroll import AdaptiveScroll
|
from module.ui.scroll import AdaptiveScroll
|
||||||
@ -173,7 +174,7 @@ class PlannerScan(SynthesizeUI, PlannerMixin):
|
|||||||
logger.hr('Parse planner result', level=2)
|
logger.hr('Parse planner result', level=2)
|
||||||
if not self.ui_page_appear(page_planner):
|
if not self.ui_page_appear(page_planner):
|
||||||
logger.error('Not in page_planner, game must in the planner result page before scanning')
|
logger.error('Not in page_planner, game must in the planner result page before scanning')
|
||||||
return []
|
raise GamePageUnknownError
|
||||||
|
|
||||||
scroll = AdaptiveScroll(RESULT_SCROLL.button, name=RESULT_SCROLL.name)
|
scroll = AdaptiveScroll(RESULT_SCROLL.button, name=RESULT_SCROLL.name)
|
||||||
scroll.drag_threshold = 0.1
|
scroll.drag_threshold = 0.1
|
||||||
|
Loading…
Reference in New Issue
Block a user