diff --git a/arknights_mower/solvers/base_schedule.py b/arknights_mower/solvers/base_schedule.py index 1345155bb..d14bd55f7 100644 --- a/arknights_mower/solvers/base_schedule.py +++ b/arknights_mower/solvers/base_schedule.py @@ -54,6 +54,7 @@ def __init__(self, device: Device = None, recog: Recognizer = None) -> None: self.max_resting_count = 4 self.party_time = None self.drone_time = None + self.run_order_delay=10 def run(self) -> None: """ diff --git a/arknights_mower/utils/character_recognize.py b/arknights_mower/utils/character_recognize.py index af7d48f32..dd2adab26 100644 --- a/arknights_mower/utils/character_recognize.py +++ b/arknights_mower/utils/character_recognize.py @@ -9,7 +9,7 @@ from PIL import Image, ImageDraw, ImageFont from .. import __rootdir__ -from ..data import agent_list +from ..data import agent_list,ocr_error from . import segment from .image import saveimg from .log import logger @@ -172,7 +172,7 @@ def agent(img, draw=False): f'干员名称识别异常:{x[1]} 为不存在的数据,请报告至 https://github.com/Konano/arknights-mower/issues' ) saveimg(__img, 'failure_agent') - raise Exception("启动 Plan B") + raise Exception(x[1]) else: if 80 <= np.min(__img): continue @@ -188,10 +188,15 @@ def agent(img, draw=False): raise Exception("启动 Plan B") except Exception as e: # 大哥不行了,二哥上! + _msg = str(e) ret_fail.append(poly) - if name in ocr_error.keys(): - name = ocr_error[name] - else: + if "Plan B" not in _msg: + if _msg in ocr_error.keys(): + name = ocr_error[_msg] + elif "Off" in _msg: + name = 'U-Official' + else: + continue ret_agent.append(name) ret_succ.append(poly) continue