Sfoglia il codice sorgente

fix(Exploration): Normalize misrecognized level numbers by replacing similar characters #1540

ryland 5 mesi fa
parent
commit
85fcc79a42
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      tasks/Exploration/base.py

+ 2 - 1
tasks/Exploration/base.py

@@ -139,6 +139,8 @@ class BaseExploration(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, Replace
             # 获取当前章节名
             # 获取当前章节名
             results = self.O_E_EXPLORATION_LEVEL_NUMBER.detect_and_ocr(self.device.image)
             results = self.O_E_EXPLORATION_LEVEL_NUMBER.detect_and_ocr(self.device.image)
             text1 = [result.ocr_text for result in results]
             text1 = [result.ocr_text for result in results]
+            # https://github.com/runhey/OnmyojiAutoScript/issues/1540
+            text1 = [text.replace("名", "第").replace("书", "第") for text in text1]
             # 判断当前章节有无目标章节
             # 判断当前章节有无目标章节
             result = set(text1).intersection({explorationConfig.exploration_config.exploration_level})
             result = set(text1).intersection({explorationConfig.exploration_config.exploration_level})
             # 有则跳出检测
             # 有则跳出检测
@@ -157,7 +159,6 @@ class BaseExploration(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, Replace
                 raise GameStuckError(
                 raise GameStuckError(
                     f"Swiped too many times ({swipeCount}), seems stuck in exploration level selection"
                     f"Swiped too many times ({swipeCount}), seems stuck in exploration level selection"
                 )
                 )
-                return False
             time.sleep(1)
             time.sleep(1)
 
 
         # 选中对应章节
         # 选中对应章节