Просмотр исходного кода

fix(SoulsTidy): #662 Fixed click failure

Neptine 1 год назад
Родитель
Сommit
99365e679d
2 измененных файлов с 11 добавлено и 3 удалено
  1. 3 3
      dev_tools/assets_test.py
  2. 8 0
      tasks/SoulsTidy/script_task.py

+ 3 - 3
dev_tools/assets_test.py

@@ -34,10 +34,10 @@ def detect_ocr(file: str, target: RuleOcr):
 
 
 
 
 # 图片文件路径 可以是相对路径
 # 图片文件路径 可以是相对路径
-IMAGE_FILE = r"C:\Users\Ryland\Desktop\401100578-df75cd36-6ae1-48f9-9605-58cde7c0fa00.png"
+IMAGE_FILE = r"C:\Users\Neptine\Desktop\404528170-67ec447a-cc2c-4c62-b253-51e383f6a863.png"
 if __name__ == '__main__':
 if __name__ == '__main__':
-    from tasks.KekkaiUtilize.script_task import ScriptTask
-    targe = ScriptTask.I_SHI_GROWN
+    from tasks.SoulsTidy.script_task import ScriptTask
+    targe = ScriptTask.I_UI_CONFIRM
     print(detect_image(IMAGE_FILE, targe))
     print(detect_image(IMAGE_FILE, targe))
 
 
     # ocr demo
     # ocr demo

+ 8 - 0
tasks/SoulsTidy/script_task.py

@@ -85,6 +85,14 @@ class ScriptTask(GameUi, SoulsTidyAssets):
             if self.appear(self.I_ST_CAT):
             if self.appear(self.I_ST_CAT):
                 # 出现招财猫
                 # 出现招财猫
                 break
                 break
+            
+            # https://github.com/runhey/OnmyojiAutoScript/issues/662
+            if self.appear(self.I_ST_UNSELECTED):
+                self.ui_click_until_disappear(self.I_ST_UNSELECTED)
+                continue
+            if self.appear_then_click(self.I_UI_CONFIRM, interval=0.5):
+                continue
+
             if self.appear_then_click(self.I_ST_GREED_CLOSE, interval=0.7):
             if self.appear_then_click(self.I_ST_GREED_CLOSE, interval=0.7):
                 continue
                 continue
             if self.appear_then_click(self.I_ST_BONGNA, interval=1, threshold=0.6):
             if self.appear_then_click(self.I_ST_BONGNA, interval=1, threshold=0.6):