Преглед изворни кода

Merge pull request #1916 from runhey/dev

Dev
huangrunheng пре 1 месец
родитељ
комит
fc68a2af7f
69 измењених фајлова са 225 додато и 300 уклоњено
  1. 2 2
      tasks/AbyssShadows/script_task.py
  2. BIN
      tasks/ActivityShikigami/as/as_lock.png
  3. BIN
      tasks/ActivityShikigami/as/as_shi.png
  4. BIN
      tasks/ActivityShikigami/as/as_to_battle_main.png
  5. BIN
      tasks/ActivityShikigami/as/as_to_battle_main_2.png
  6. 1 1
      tasks/ActivityShikigami/as/image.json
  7. 4 4
      tasks/ActivityShikigami/as/pages.json
  8. 16 16
      tasks/ActivityShikigami/assets.py
  9. BIN
      tasks/ActivityShikigami/fire/fire_pass_1.png
  10. BIN
      tasks/ActivityShikigami/fire/fire_pass_2.png
  11. BIN
      tasks/ActivityShikigami/fire/fire_pass_3.png
  12. BIN
      tasks/ActivityShikigami/fire/fire_pass_4.png
  13. 20 20
      tasks/ActivityShikigami/fire/image.json
  14. 4 4
      tasks/ActivityShikigami/fire/ocr.json
  15. 69 12
      tasks/ActivityShikigami/script_task.py
  16. 0 1
      tasks/Component/Costume/costume_base.py
  17. 1 1
      tasks/Component/Costume/costume_test_shikigami.py
  18. 0 12
      tasks/Component/CostumeShikigami/assets.py
  19. 1 10
      tasks/Component/CostumeShikigami/sk1/image.json
  20. BIN
      tasks/Component/CostumeShikigami/sk1/sk1_sou_switch_sure_1.png
  21. 1 10
      tasks/Component/CostumeShikigami/sk10/image.json
  22. BIN
      tasks/Component/CostumeShikigami/sk10/sk10_sou_switch_sure_10.png
  23. 1 10
      tasks/Component/CostumeShikigami/sk11/image.json
  24. BIN
      tasks/Component/CostumeShikigami/sk11/sk11_sou_switch_sure_11.png
  25. 1 10
      tasks/Component/CostumeShikigami/sk12/image.json
  26. BIN
      tasks/Component/CostumeShikigami/sk12/sk12_sou_switch_sure_12.png
  27. 1 10
      tasks/Component/CostumeShikigami/sk2/image.json
  28. BIN
      tasks/Component/CostumeShikigami/sk2/sk2_sou_switch_sure_2.png
  29. 1 10
      tasks/Component/CostumeShikigami/sk3/image.json
  30. BIN
      tasks/Component/CostumeShikigami/sk3/sk3_sou_switch_sure_3.png
  31. 1 10
      tasks/Component/CostumeShikigami/sk4/image.json
  32. BIN
      tasks/Component/CostumeShikigami/sk4/sk4_sou_switch_sure_4.png
  33. 1 10
      tasks/Component/CostumeShikigami/sk5/image.json
  34. BIN
      tasks/Component/CostumeShikigami/sk5/sk5_sou_switch_sure_5.png
  35. 1 10
      tasks/Component/CostumeShikigami/sk6/image.json
  36. BIN
      tasks/Component/CostumeShikigami/sk6/sk6_sou_switch_sure_6.png
  37. 1 10
      tasks/Component/CostumeShikigami/sk7/image.json
  38. BIN
      tasks/Component/CostumeShikigami/sk7/sk7_sou_switch_sure_7.png
  39. 1 10
      tasks/Component/CostumeShikigami/sk8/image.json
  40. BIN
      tasks/Component/CostumeShikigami/sk8/sk8_sou_switch_sure_8.png
  41. 1 10
      tasks/Component/CostumeShikigami/sk9/image.json
  42. BIN
      tasks/Component/CostumeShikigami/sk9/sk9_sou_switch_sure_9.png
  43. 0 2
      tasks/Component/GeneralBattle/assets.py
  44. BIN
      tasks/Component/GeneralBattle/gb/gb_exit_ensure.png
  45. 0 9
      tasks/Component/GeneralBattle/gb/image.json
  46. 5 5
      tasks/Component/GeneralBattle/general_battle.py
  47. 0 1
      tasks/Component/SwitchSoul/assets.py
  48. 1 10
      tasks/Component/SwitchSoul/ss/image.json
  49. BIN
      tasks/Component/SwitchSoul/ss/ss_sou_switch_sure.png
  50. 5 5
      tasks/Component/SwitchSoul/switch_soul.py
  51. 7 7
      tasks/DemonEncounter/assets.py
  52. 1 1
      tasks/Duel/script_task.py
  53. 7 9
      tasks/Exploration/assets.py
  54. 0 9
      tasks/Exploration/res/image.json
  55. BIN
      tasks/Exploration/res/res_get_reward.png
  56. 11 11
      tasks/FrogBoss/assets.py
  57. 11 5
      tasks/GlobalGame/assets.py
  58. 34 7
      tasks/GlobalGame/ui/image.json
  59. BIN
      tasks/GlobalGame/ui/ui_ui_cancel.png
  60. BIN
      tasks/GlobalGame/ui/ui_ui_cancel_old.png
  61. BIN
      tasks/GlobalGame/ui/ui_ui_confirm.png
  62. BIN
      tasks/GlobalGame/ui/ui_ui_confirm_old.png
  63. BIN
      tasks/GlobalGame/ui/ui_ui_reward.png
  64. BIN
      tasks/GlobalGame/ui/ui_ui_rewards.png
  65. 0 2
      tasks/RealmRaid/assets.py
  66. 1 10
      tasks/RealmRaid/res/image.json
  67. BIN
      tasks/RealmRaid/res/res_fresh_ensure.png
  68. 10 10
      tasks/RealmRaid/script_task.py
  69. 3 4
      tasks/Restart/assets.py

+ 2 - 2
tasks/AbyssShadows/script_task.py

@@ -547,13 +547,13 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, AbyssShadowsAssets):
             self.screenshot()
             if self.appear_then_click(self.I_EXIT, interval=2):
                 continue
-            if self.appear_then_click(self.I_EXIT_ENSURE, interval=2):
+            if self.appear_then_click(self.I_UI_CONFIRM, interval=2):
                 continue
             if self.appear_then_click(self.I_WIN, interval=2):
                 continue
             if self.appear(self.I_ABYSS_NAVIGATION):
                 break
-        logger.info(f"Click {self.I_EXIT_ENSURE.name}")
+        logger.info(f"Click {self.I_UI_CONFIRM.name}")
 
         return True
 

BIN
tasks/ActivityShikigami/as/as_lock.png


BIN
tasks/ActivityShikigami/as/as_shi.png


BIN
tasks/ActivityShikigami/as/as_to_battle_main.png


BIN
tasks/ActivityShikigami/as/as_to_battle_main_2.png


+ 1 - 1
tasks/ActivityShikigami/as/image.json

@@ -4,7 +4,7 @@
     "imageName": "as_lock.png",
     "roiFront": "825,657,28,25",
     "roiBack": "739,432,440,266",
-    "method": "Template matching",
+    "method": "Multi-scale template matching",
     "threshold": 0.5,
     "description": "上锁图标"
   },

+ 4 - 4
tasks/ActivityShikigami/as/pages.json

@@ -38,8 +38,8 @@
   {
     "itemName": "to_battle_main",
     "imageName": "as_to_battle_main.png",
-    "roiFront": "302,178,98,111",
-    "roiBack": "223,110,238,269",
+    "roiFront": "220,247,97,44",
+    "roiBack": "172,122,238,269",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "进入主要的战斗界面"
@@ -83,8 +83,8 @@
   {
     "itemName": "to_battle_main_2",
     "imageName": "as_to_battle_main_2.png",
-    "roiFront": "15,94,247,38",
-    "roiBack": "2,68,311,100",
+    "roiFront": "819,458,103,33",
+    "roiBack": "799,431,142,87",
     "method": "Template matching",
     "threshold": 0.65,
     "description": "description"

+ 16 - 16
tasks/ActivityShikigami/assets.py

@@ -25,7 +25,7 @@ class ActivityShikigamiAssets:
 
 	# Image Rule Assets
 	# 上锁图标 
-	I_LOCK = RuleImage(roi_front=(825,657,28,25), roi_back=(739,432,440,266), threshold=0.5, method="Template matching", file="./tasks/ActivityShikigami/as/as_lock.png")
+	I_LOCK = RuleImage(roi_front=(825,657,28,25), roi_back=(739,432,440,266), threshold=0.5, method="Multi-scale template matching", file="./tasks/ActivityShikigami/as/as_lock.png")
 	# 还未上锁图片 
 	I_UNLOCK = RuleImage(roi_front=(884,648,28,25), roi_back=(733,426,444,276), threshold=0.5, method="Template matching", file="./tasks/ActivityShikigami/as/as_unlock.png")
 	# 活动爬塔标志 
@@ -46,7 +46,7 @@ class ActivityShikigamiAssets:
 	# 红色退出 
 	I_RED_EXIT = RuleImage(roi_front=(1162,96,39,38), roi_back=(1120,49,110,135), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_red_exit.png")
 	# 进入主要的战斗界面 
-	I_TO_BATTLE_MAIN = RuleImage(roi_front=(302,178,98,111), roi_back=(223,110,238,269), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_to_battle_main.png")
+	I_TO_BATTLE_MAIN = RuleImage(roi_front=(220,247,97,44), roi_back=(172,122,238,269), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_to_battle_main.png")
 	# 点击进入boss战斗页面 
 	I_TO_BATTLE_BOSS = RuleImage(roi_front=(1111,248,37,136), roi_back=(979,142,234,327), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_to_battle_boss.png")
 	# description 
@@ -56,30 +56,30 @@ class ActivityShikigamiAssets:
 	# 从main进入到式神录 
 	I_BATTLE_MAIN_TO_RECORDS = RuleImage(roi_front=(1001,558,39,42), roi_back=(966,534,140,100), threshold=0.7, method="Template matching", file="./tasks/ActivityShikigami/as/as_battle_main_to_records.png")
 	# description 
-	I_TO_BATTLE_MAIN_2 = RuleImage(roi_front=(15,94,247,38), roi_back=(2,68,311,100), threshold=0.65, method="Template matching", file="./tasks/ActivityShikigami/as/as_to_battle_main_2.png")
+	I_TO_BATTLE_MAIN_2 = RuleImage(roi_front=(819,458,103,33), roi_back=(799,431,142,87), threshold=0.65, method="Template matching", file="./tasks/ActivityShikigami/as/as_to_battle_main_2.png")
 	# 确认跳过 
 	I_CONFIRM_SKIP = RuleImage(roi_front=(707,442,137,38), roi_back=(656,397,231,124), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_confirm_skip.png")
 
 
 	# Image Rule Assets
 	# description 
-	I_PASS_1 = RuleImage(roi_front=(359,295,100,53), roi_back=(68,203,1138,369), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_1.png")
+	I_PASS_1 = RuleImage(roi_front=(594,330,37,58), roi_back=(462,310,337,91), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_1.png")
 	# description 
-	I_PASS_2 = RuleImage(roi_front=(645,224,92,57), roi_back=(98,205,1076,366), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_2.png")
+	I_PASS_2 = RuleImage(roi_front=(625,335,31,44), roi_back=(562,326,182,66), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_2.png")
 	# description 
-	I_PASS_3 = RuleImage(roi_front=(648,227,91,55), roi_back=(103,162,1077,416), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_3.png")
+	I_PASS_3 = RuleImage(roi_front=(1178,620,71,61), roi_back=(1149,606,111,92), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_3.png")
 	# description 
-	I_PASS_4 = RuleImage(roi_front=(586,424,100,58), roi_back=(99,194,1080,398), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_4.png")
-	# 箱子 
-	I_PASS_5 = RuleImage(roi_front=(946,415,65,48), roi_back=(97,194,1036,398), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_5.png")
+	I_PASS_4 = RuleImage(roi_front=(482,499,58,54), roi_back=(448,439,126,137), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_4.png")
+	# 第一个 
+	I_PASS_5 = RuleImage(roi_front=(421,286,65,48), roi_back=(419,287,69,51), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_5.png")
 	# 印记 
-	I_PASS_6 = RuleImage(roi_front=(668,221,54,50), roi_back=(107,159,1012,394), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_6.png")
+	I_PASS_6 = RuleImage(roi_front=(548,333,54,50), roi_back=(547,335,58,52), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_6.png")
 	# description 
-	I_PASS_7 = RuleImage(roi_front=(329,233,51,51), roi_back=(95,180,1056,394), threshold=0.65, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_7.png")
+	I_PASS_7 = RuleImage(roi_front=(672,381,51,51), roi_back=(668,377,59,60), threshold=0.65, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_7.png")
 	# 印记选中间的 
-	I_PASS_8 = RuleImage(roi_front=(579,276,100,100), roi_back=(577,296,100,100), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_8.png")
-	# description 
-	I_PASS_9 = RuleImage(roi_front=(558,643,160,44), roi_back=(480,601,306,100), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_9.png")
+	I_PASS_8 = RuleImage(roi_front=(794,333,62,63), roi_back=(791,334,70,67), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_8.png")
+	# 第五个 
+	I_PASS_9 = RuleImage(roi_front=(929,285,50,40), roi_back=(921,278,70,56), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_9.png")
 	# 印记选左边的 
 	I_PASS_10 = RuleImage(roi_front=(279,309,100,100), roi_back=(291,305,100,100), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/fire/fire_pass_10.png")
 	# 印记选右边的 
@@ -94,9 +94,9 @@ class ActivityShikigamiAssets:
 	# 挑战 
 	O_FIRE = RuleOcr(roi=(1135,599,85,49), area=(1123,570,106,100), mode="Single", method="Default", keyword="挑战", name="fire")
 	# 体力的数量检测 
-	O_REMAIN_AP = RuleOcr(roi=(584,17,63,27), area=(583,16,63,30), mode="Digit", method="Default", keyword="", name="remain_ap")
+	O_REMAIN_AP = RuleOcr(roi=(777,16,63,27), area=(776,15,63,30), mode="Digit", method="Default", keyword="", name="remain_ap")
 	# 活动体力的剩余检测 
-	O_REMAIN_PASS = RuleOcr(roi=(791,18,50,29), area=(791,18,49,28), mode="Digit", method="Default", keyword="", name="remain_pass")
+	O_REMAIN_PASS = RuleOcr(roi=(1153,24,50,29), area=(1153,26,49,28), mode="Digit", method="Default", keyword="", name="remain_pass")
 	# 还有多少次购买体力的机会 
 	O_REMAIN_BUY = RuleOcr(roi=(808,531,39,42), area=(808,531,39,42), mode="DigitCounter", method="Default", keyword="", name="remain_buy")
 	# 活动票数(没有百分比) 

BIN
tasks/ActivityShikigami/fire/fire_pass_1.png


BIN
tasks/ActivityShikigami/fire/fire_pass_2.png


BIN
tasks/ActivityShikigami/fire/fire_pass_3.png


BIN
tasks/ActivityShikigami/fire/fire_pass_4.png


+ 20 - 20
tasks/ActivityShikigami/fire/image.json

@@ -2,8 +2,8 @@
   {
     "itemName": "pass_1",
     "imageName": "fire_pass_1.png",
-    "roiFront": "359,295,100,53",
-    "roiBack": "68,203,1138,369",
+    "roiFront": "594,330,37,58",
+    "roiBack": "462,310,337,91",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -11,8 +11,8 @@
   {
     "itemName": "pass_2",
     "imageName": "fire_pass_2.png",
-    "roiFront": "645,224,92,57",
-    "roiBack": "98,205,1076,366",
+    "roiFront": "625,335,31,44",
+    "roiBack": "562,326,182,66",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -20,8 +20,8 @@
   {
     "itemName": "pass_3",
     "imageName": "fire_pass_3.png",
-    "roiFront": "648,227,91,55",
-    "roiBack": "103,162,1077,416",
+    "roiFront": "1178,620,71,61",
+    "roiBack": "1149,606,111,92",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -29,8 +29,8 @@
   {
     "itemName": "pass_4",
     "imageName": "fire_pass_4.png",
-    "roiFront": "586,424,100,58",
-    "roiBack": "99,194,1080,398",
+    "roiFront": "482,499,58,54",
+    "roiBack": "448,439,126,137",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -38,17 +38,17 @@
   {
     "itemName": "pass_5",
     "imageName": "fire_pass_5.png",
-    "roiFront": "946,415,65,48",
-    "roiBack": "97,194,1036,398",
+    "roiFront": "421,286,65,48",
+    "roiBack": "419,287,69,51",
     "method": "Template matching",
     "threshold": 0.8,
-    "description": "箱子"
+    "description": "第一个"
   },
   {
     "itemName": "pass_6",
     "imageName": "fire_pass_6.png",
-    "roiFront": "668,221,54,50",
-    "roiBack": "107,159,1012,394",
+    "roiFront": "548,333,54,50",
+    "roiBack": "547,335,58,52",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "印记"
@@ -56,8 +56,8 @@
   {
     "itemName": "pass_7",
     "imageName": "fire_pass_7.png",
-    "roiFront": "329,233,51,51",
-    "roiBack": "95,180,1056,394",
+    "roiFront": "672,381,51,51",
+    "roiBack": "668,377,59,60",
     "method": "Template matching",
     "threshold": 0.65,
     "description": "description"
@@ -65,8 +65,8 @@
   {
     "itemName": "pass_8",
     "imageName": "fire_pass_8.png",
-    "roiFront": "579,276,100,100",
-    "roiBack": "577,296,100,100",
+    "roiFront": "794,333,62,63",
+    "roiBack": "791,334,70,67",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "印记选中间的"
@@ -74,11 +74,11 @@
   {
     "itemName": "pass_9",
     "imageName": "fire_pass_9.png",
-    "roiFront": "558,643,160,44",
-    "roiBack": "480,601,306,100",
+    "roiFront": "929,285,50,40",
+    "roiBack": "921,278,70,56",
     "method": "Template matching",
     "threshold": 0.8,
-    "description": "description"
+    "description": "第五个"
   },
   {
     "itemName": "pass_10",

+ 4 - 4
tasks/ActivityShikigami/fire/ocr.json

@@ -10,8 +10,8 @@
   },
   {
     "itemName": "remain_ap",
-    "roiFront": "584,17,63,27",
-    "roiBack": "583,16,63,30",
+    "roiFront": "777,16,63,27",
+    "roiBack": "776,15,63,30",
     "mode": "Digit",
     "method": "Default",
     "keyword": "",
@@ -19,8 +19,8 @@
   },
   {
     "itemName": "remain_pass",
-    "roiFront": "791,18,50,29",
-    "roiBack": "791,18,49,28",
+    "roiFront": "1153,24,50,29",
+    "roiBack": "1153,26,49,28",
     "mode": "Digit",
     "method": "Default",
     "keyword": "",

+ 69 - 12
tasks/ActivityShikigami/script_task.py

@@ -158,7 +158,16 @@ class ScriptTask(StateMachine, GameUi, Battle, BaseActivity, SwitchSoul, Activit
                 method_func = getattr(self, f'_run_{climb_type}')
                 method_func()
             except LimitCountOut as e:
-                self.ui_click(self.I_UI_BACK_YELLOW, stop=self.I_TO_BATTLE_MAIN, interval=2.8)
+                while 1:
+                    self.screenshot()
+                    if self.appear(self.I_TO_BATTLE_MAIN):
+                        break
+                    if self.appear_then_click(self.I_UI_BACK_CIRCLE, interval=1.5):
+                        continue
+                    if self.appear_then_click(self.I_UI_BACK_YELLOW, interval=2.5):
+                        continue
+                    if self.appear_then_click(self.I_UI_BACK_RED, interval=1.5):
+                        continue
             except LimitTimeOut as e:
                 break
             finally:
@@ -178,10 +187,43 @@ class ScriptTask(StateMachine, GameUi, Battle, BaseActivity, SwitchSoul, Activit
             更新前请先看 ./README.md
         """
         logger.hr(f'Start run climb type PASS', 1)
-        self.ui_clicks([self.I_TO_BATTLE_MAIN, self.I_TO_BATTLE_MAIN_2],
-                       stop=self.I_CHECK_BATTLE_MAIN, interval=1)
+        # self.ui_clicks([self.I_TO_BATTLE_MAIN_2],
+        #                stop=self.I_CHECK_BATTLE_MAIN, interval=1)
+        #
+        while 1:
+            self.screenshot()
+
+            if self.appear(self.I_UI_BACK_RED) and self.appear(self.I_PASS_4):
+                break
+            if self.appear_then_click(self.I_UI_CONFIRM, interval=0.5):
+                continue
+            if self.appear_then_click(self.I_UI_CONFIRM_SAMLL, interval=0.5):
+                continue
+            if self.appear_then_click(self.I_TO_BATTLE_MAIN_2, interval=1.5):
+                continue
+            if not self.appear(self.I_PASS_3):
+                continue
+            if self.appear_then_click(self.I_PASS_1, interval=1.5):
+                continue
+            if self.appear_then_click(self.I_PASS_2, interval=1.5):
+                continue
+        logger.info('Enter occupation reward screen')  # 进入到占领奖励
+        index = 0
+        clicks = [self.I_PASS_5, self.I_PASS_6, self.I_PASS_7, self.I_PASS_8, self.I_PASS_9]
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_CHECK_BATTLE_MAIN):
+                break
+            if self.click(clicks[index], interval=1.5):
+                sleep(1)
+            index = (index + 1) % len(clicks)
+        logger.info('Enter challenge screen')  # 正式进入挑战界面
+
+
+
+
         self.switch_soul(self.I_BATTLE_MAIN_TO_RECORDS, self.I_CHECK_BATTLE_MAIN)
-        self.switch_climb_mode_in_game('pass')
+        # self.switch_climb_mode_in_game('pass')
 
         ocr_limit_timer = Timer(1).start()
         click_limit_timer = Timer(4).start()
@@ -209,17 +251,23 @@ class ScriptTask(StateMachine, GameUi, Battle, BaseActivity, SwitchSoul, Activit
             if self.start_battle():
                 continue
 
-        self.ui_click(self.I_UI_BACK_YELLOW, stop=self.I_TO_BATTLE_MAIN, interval=4.5)
+        # self.ui_click(self.I_UI_BACK_YELLOW, stop=self.I_TO_BATTLE_MAIN, interval=4.5)
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_TO_BATTLE_MAIN):
+                break
+            if self.appear(self.I_CHECK_BATTLE_MAIN) and self.appear_then_click(self.I_UI_BACK_YELLOW, interval=2.5):
+                continue
 
     def _run_ap(self):
         """
             更新前请先看 ./README.md
         """
         logger.hr(f'Start run climb type AP')
-        self.ui_clicks([self.I_TO_BATTLE_MAIN, self.I_TO_BATTLE_MAIN_2],
+        self.ui_clicks([self.I_TO_BATTLE_MAIN],
                        stop=self.I_CHECK_BATTLE_MAIN, interval=1)
         self.switch_soul(self.I_BATTLE_MAIN_TO_RECORDS, self.I_CHECK_BATTLE_MAIN)
-        self.switch_climb_mode_in_game('ap')
+        # self.switch_climb_mode_in_game('ap')
 
         ocr_limit_timer = Timer(1).start()
         while 1:
@@ -242,7 +290,19 @@ class ScriptTask(StateMachine, GameUi, Battle, BaseActivity, SwitchSoul, Activit
             if self.start_battle():
                 continue
 
-        self.ui_click(self.I_UI_BACK_YELLOW, stop=self.I_TO_BATTLE_MAIN, interval=4.5)
+        # self.ui_click(self.I_UI_BACK_YELLOW, stop=self.I_TO_BATTLE_MAIN, interval=3.5, timeout=10)
+        while 1:
+            self.screenshot()
+
+            if self.appear(self.I_TO_BATTLE_MAIN):
+                break
+            if self.appear_then_click(self.I_UI_BACK_CIRCLE, interval=1.5):
+                continue
+            if self.appear_then_click(self.I_UI_BACK_YELLOW, interval=2.5):
+                continue
+            if self.appear_then_click(self.I_UI_BACK_RED, interval=1.5):
+                continue
+
 
     def _run_boss(self):
         """
@@ -294,7 +354,7 @@ class ScriptTask(StateMachine, GameUi, Battle, BaseActivity, SwitchSoul, Activit
                 continue
         # 运行战斗
         strategies, options = self.loadout_from_config(self.get_general_battle_conf())
-        strategies['success'] = 'activity'
+        # strategies['success'] = 'activity'
         self.loadout_show((strategies, options))
         self.state_show()
         with battle_wait_strategy(**strategies), battle_wait_options(**options):
@@ -305,9 +365,6 @@ class ScriptTask(StateMachine, GameUi, Battle, BaseActivity, SwitchSoul, Activit
             logger.info(f'Count {self.climb_type}: {self.count_map[self.climb_type]}')
         return win
 
-    # @battle_wait_strategy(success='activity')
-    # def battle_wait(self, *args, **kwargs):
-    #     return self.battle_wait_with_strategy(*args, **kwargs)
 
     def switch_soul(self, enter_button: RuleImage, cur_img: RuleImage):
         conf = self.conf.switch_soul_config

+ 0 - 1
tasks/Component/Costume/costume_base.py

@@ -89,7 +89,6 @@ shikigami_costume_model = {
         'I_SOU_CHECK_IN': f'I_SOU_CHECK_IN_{i}',
         'I_SOU_TEAM_PRESENT': f'I_SOU_TEAM_PRESENT_{i}',
         'I_SOU_CLICK_PRESENT': f'I_SOU_CLICK_PRESENT_{i}',
-        'I_SOU_SWITCH_SURE': f'I_SOU_SWITCH_SURE_{i}',
         # SwitchSoul 分组相关 (1-7组)
         **{f'I_SOU_CHECK_GROUP_{g}': f'I_SOU_CHECK_GROUP_{g}_{i}' for g in range(1, 8)},
         # SwitchSoul 队伍相关 (1-4队)

+ 1 - 1
tasks/Component/Costume/costume_test_shikigami.py

@@ -36,7 +36,7 @@ class ScriptTask(GameUi, SwitchSoul, SwitchSoulAssets, SoulsTidyAssets):
             [self.I_SOU_SWITCH_2, 0],
             [self.I_SOU_SWITCH_3, 0],
             [self.I_SOU_SWITCH_4, 0],
-            [self.I_SOU_SWITCH_SURE, 0],
+            [self.I_UI_CONFIRM, 0],
             # SoulsTidy - 御魂页面关键元素
             [self.I_ST_SOULS, 0],
             [self.I_ST_REPLACE, 0],

+ 0 - 12
tasks/Component/CostumeShikigami/assets.py

@@ -26,7 +26,6 @@ class CostumeShikigamiAssets:
 	# description 
 	I_SOU_SWITCH_4_1 = RuleImage(roi_front=(977,603,33,20), roi_back=(962,592,53,34), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk1/sk1_sou_switch_4_1.png")
 	# description 
-	I_SOU_SWITCH_SURE_1 = RuleImage(roi_front=(668,401,180,61), roi_back=(668,401,180,61), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk1/sk1_sou_switch_sure_1.png")
 	# 用于判断是否在式神录里面 
 	I_SOU_CHECK_IN_1 = RuleImage(roi_front=(269,69,50,49), roi_back=(269,69,50,49), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk1/sk1_sou_check_in_1.png")
 	# 检查是否为第一组 
@@ -69,7 +68,6 @@ class CostumeShikigamiAssets:
 	# 第四组切换 
 	I_SOU_SWITCH_4_10 = RuleImage(roi_front=(979,602,25,27), roi_back=(960,592,60,50), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk10/sk10_sou_switch_4_10.png")
 	# 确认切换 
-	I_SOU_SWITCH_SURE_10 = RuleImage(roi_front=(669,401,190,61), roi_back=(669,401,190,61), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk10/sk10_sou_switch_sure_10.png")
 	# 用于判断是否在式神录里面 
 	I_SOU_CHECK_IN_10 = RuleImage(roi_front=(277,79,34,36), roi_back=(265,71,60,50), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk10/sk10_sou_check_in_10.png")
 	# 检查是否为第一组 
@@ -126,7 +124,6 @@ class CostumeShikigamiAssets:
 	# description 
 	I_SOU_TEAM_PRESENT_11 = RuleImage(roi_front=(734,77,100,41), roi_back=(726,71,115,54), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk11/sk11_sou_team_present_11.png")
 	# description 
-	I_SOU_SWITCH_SURE_11 = RuleImage(roi_front=(702,401,116,55), roi_back=(690,399,148,64), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk11/sk11_sou_switch_sure_11.png")
 	# description 
 	I_SOUL_PRESET_11 = RuleImage(roi_front=(342,85,74,31), roi_back=(338,77,83,44), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk11/sk11_soul_preset_11.png")
 	# description 
@@ -169,7 +166,6 @@ class CostumeShikigamiAssets:
 	# description 
 	I_SOU_TEAM_PRESENT_12 = RuleImage(roi_front=(734,77,100,41), roi_back=(726,71,115,54), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk12/sk12_sou_team_present_12.png")
 	# description 
-	I_SOU_SWITCH_SURE_12 = RuleImage(roi_front=(702,401,116,55), roi_back=(690,399,148,64), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk12/sk12_sou_switch_sure_12.png")
 	# description 
 	I_SOUL_PRESET_12 = RuleImage(roi_front=(342,85,74,31), roi_back=(338,77,83,44), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk12/sk12_soul_preset_12.png")
 	# description 
@@ -198,7 +194,6 @@ class CostumeShikigamiAssets:
 	# description 
 	I_SOU_SWITCH_4_2 = RuleImage(roi_front=(977,603,32,21), roi_back=(962,592,56,40), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk2/sk2_sou_switch_4_2.png")
 	# description 
-	I_SOU_SWITCH_SURE_2 = RuleImage(roi_front=(668,401,180,61), roi_back=(668,401,180,61), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk2/sk2_sou_switch_sure_2.png")
 	# 用于判断是否在式神录里面 
 	I_SOU_CHECK_IN_2 = RuleImage(roi_front=(268,74,50,49), roi_back=(268,74,50,49), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk2/sk2_sou_check_in_2.png")
 	# 检查是否为第一组 
@@ -241,7 +236,6 @@ class CostumeShikigamiAssets:
 	# description 
 	I_SOU_SWITCH_4_3 = RuleImage(roi_front=(978,603,31,19), roi_back=(962,592,53,34), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk3/sk3_sou_switch_4_3.png")
 	# description 
-	I_SOU_SWITCH_SURE_3 = RuleImage(roi_front=(668,401,180,61), roi_back=(668,401,180,61), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk3/sk3_sou_switch_sure_3.png")
 	# 用于判断是否在式神录里面 
 	I_SOU_CHECK_IN_3 = RuleImage(roi_front=(268,74,50,49), roi_back=(268,74,50,49), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk3/sk3_sou_check_in_3.png")
 	# 检查是否为第一组 
@@ -284,7 +278,6 @@ class CostumeShikigamiAssets:
 	# description 
 	I_SOU_SWITCH_4_4 = RuleImage(roi_front=(978,602,31,20), roi_back=(962,592,53,34), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk4/sk4_sou_switch_4_4.png")
 	# description 
-	I_SOU_SWITCH_SURE_4 = RuleImage(roi_front=(668,401,180,61), roi_back=(668,401,180,61), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk4/sk4_sou_switch_sure_4.png")
 	# 用于判断是否在式神录里面 
 	I_SOU_CHECK_IN_4 = RuleImage(roi_front=(268,74,50,49), roi_back=(268,74,50,49), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk4/sk4_sou_check_in_4.png")
 	# 检查是否为第一组 
@@ -327,7 +320,6 @@ class CostumeShikigamiAssets:
 	# description 
 	I_SOU_SWITCH_4_5 = RuleImage(roi_front=(978,602,31,20), roi_back=(962,592,53,34), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk5/sk5_sou_switch_4_5.png")
 	# description 
-	I_SOU_SWITCH_SURE_5 = RuleImage(roi_front=(668,401,180,61), roi_back=(668,401,180,61), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk5/sk5_sou_switch_sure_5.png")
 	# 用于判断是否在式神录里面 
 	I_SOU_CHECK_IN_5 = RuleImage(roi_front=(268,74,50,49), roi_back=(268,74,50,49), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk5/sk5_sou_check_in_5.png")
 	# 检查是否为第一组 
@@ -370,7 +362,6 @@ class CostumeShikigamiAssets:
 	# description 
 	I_SOU_SWITCH_4_6 = RuleImage(roi_front=(977,601,32,21), roi_back=(962,592,53,34), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_switch_4_6.png")
 	# description 
-	I_SOU_SWITCH_SURE_6 = RuleImage(roi_front=(668,401,180,61), roi_back=(668,401,180,61), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_switch_sure_6.png")
 	# 用于判断是否在式神录里面 
 	I_SOU_CHECK_IN_6 = RuleImage(roi_front=(269,69,50,49), roi_back=(269,69,50,49), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_in_6.png")
 	# 检查是否为第一组 
@@ -413,7 +404,6 @@ class CostumeShikigamiAssets:
 	# description 
 	I_SOU_SWITCH_4_7 = RuleImage(roi_front=(975,604,37,23), roi_back=(963,589,61,48), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk7/sk7_sou_switch_4_7.png")
 	# description 
-	I_SOU_SWITCH_SURE_7 = RuleImage(roi_front=(668,401,180,61), roi_back=(668,401,180,61), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk7/sk7_sou_switch_sure_7.png")
 	# 用于判断是否在式神录里面 
 	I_SOU_CHECK_IN_7 = RuleImage(roi_front=(268,74,50,49), roi_back=(268,74,50,49), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk7/sk7_sou_check_in_7.png")
 	# 检查是否为第一组 
@@ -456,7 +446,6 @@ class CostumeShikigamiAssets:
 	# 第四组切换 
 	I_SOU_SWITCH_4_8 = RuleImage(roi_front=(981,603,25,27), roi_back=(960,592,60,50), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk8/sk8_sou_switch_4_8.png")
 	# 确认切换 
-	I_SOU_SWITCH_SURE_8 = RuleImage(roi_front=(668,401,180,61), roi_back=(668,401,180,61), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk8/sk8_sou_switch_sure_8.png")
 	# 用于判断是否在式神录里面 
 	I_SOU_CHECK_IN_8 = RuleImage(roi_front=(265,71,34,36), roi_back=(265,71,60,50), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk8/sk8_sou_check_in_8.png")
 	# 检查是否为第一组 
@@ -499,7 +488,6 @@ class CostumeShikigamiAssets:
 	# 第四组切换 
 	I_SOU_SWITCH_4_9 = RuleImage(roi_front=(979,602,25,27), roi_back=(960,592,60,50), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk9/sk9_sou_switch_4_9.png")
 	# 确认切换 
-	I_SOU_SWITCH_SURE_9 = RuleImage(roi_front=(669,401,190,61), roi_back=(669,401,190,61), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk9/sk9_sou_switch_sure_9.png")
 	# 用于判断是否在式神录里面 
 	I_SOU_CHECK_IN_9 = RuleImage(roi_front=(277,79,34,36), roi_back=(265,71,60,50), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk9/sk9_sou_check_in_9.png")
 	# 检查是否为第一组 

+ 1 - 10
tasks/Component/CostumeShikigami/sk1/image.json

@@ -62,15 +62,6 @@
     "threshold": 0.8,
     "description": "description"
   },
-  {
-    "itemName": "sou_switch_sure_1",
-    "imageName": "sk1_sou_switch_sure_1.png",
-    "roiFront": "668,401,180,61",
-    "roiBack": "668,401,180,61",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
   {
     "itemName": "sou_check_in_1",
     "imageName": "sk1_sou_check_in_1.png",
@@ -179,4 +170,4 @@
     "threshold": 0.8,
     "description": "更换"
   }
-]
+]

BIN
tasks/Component/CostumeShikigami/sk1/sk1_sou_switch_sure_1.png


+ 1 - 10
tasks/Component/CostumeShikigami/sk10/image.json

@@ -62,15 +62,6 @@
     "threshold": 0.8,
     "description": "第四组切换"
   },
-  {
-    "itemName": "sou_switch_sure_10",
-    "imageName": "sk10_sou_switch_sure_10.png",
-    "roiFront": "669,401,190,61",
-    "roiBack": "669,401,190,61",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "确认切换"
-  },
   {
     "itemName": "sou_check_in_10",
     "imageName": "sk10_sou_check_in_10.png",
@@ -179,4 +170,4 @@
     "threshold": 0.8,
     "description": "更换"
   }
-]
+]

BIN
tasks/Component/CostumeShikigami/sk10/sk10_sou_switch_sure_10.png


+ 1 - 10
tasks/Component/CostumeShikigami/sk11/image.json

@@ -125,15 +125,6 @@
     "threshold": 0.8,
     "description": "description"
   },
-  {
-    "itemName": "sou_switch_sure_11",
-    "imageName": "sk11_sou_switch_sure_11.png",
-    "roiFront": "702,401,116,55",
-    "roiBack": "690,399,148,64",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
   {
     "itemName": "soul_preset_11",
     "imageName": "sk11_soul_preset_11.png",
@@ -179,4 +170,4 @@
     "threshold": 0.8,
     "description": "description"
   }
-]
+]

BIN
tasks/Component/CostumeShikigami/sk11/sk11_sou_switch_sure_11.png


+ 1 - 10
tasks/Component/CostumeShikigami/sk12/image.json

@@ -125,15 +125,6 @@
     "threshold": 0.8,
     "description": "description"
   },
-  {
-    "itemName": "sou_switch_sure_12",
-    "imageName": "sk12_sou_switch_sure_12.png",
-    "roiFront": "702,401,116,55",
-    "roiBack": "690,399,148,64",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
   {
     "itemName": "soul_preset_12",
     "imageName": "sk12_soul_preset_12.png",
@@ -179,4 +170,4 @@
     "threshold": 0.8,
     "description": "description"
   }
-]
+]

BIN
tasks/Component/CostumeShikigami/sk12/sk12_sou_switch_sure_12.png


+ 1 - 10
tasks/Component/CostumeShikigami/sk2/image.json

@@ -62,15 +62,6 @@
     "threshold": 0.8,
     "description": "description"
   },
-  {
-    "itemName": "sou_switch_sure_2",
-    "imageName": "sk2_sou_switch_sure_2.png",
-    "roiFront": "668,401,180,61",
-    "roiBack": "668,401,180,61",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
   {
     "itemName": "sou_check_in_2",
     "imageName": "sk2_sou_check_in_2.png",
@@ -179,4 +170,4 @@
     "threshold": 0.8,
     "description": "更换"
   }
-]
+]

BIN
tasks/Component/CostumeShikigami/sk2/sk2_sou_switch_sure_2.png


+ 1 - 10
tasks/Component/CostumeShikigami/sk3/image.json

@@ -62,15 +62,6 @@
     "threshold": 0.8,
     "description": "description"
   },
-  {
-    "itemName": "sou_switch_sure_3",
-    "imageName": "sk3_sou_switch_sure_3.png",
-    "roiFront": "668,401,180,61",
-    "roiBack": "668,401,180,61",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
   {
     "itemName": "sou_check_in_3",
     "imageName": "sk3_sou_check_in_3.png",
@@ -179,4 +170,4 @@
     "threshold": 0.8,
     "description": "更换"
   }
-]
+]

BIN
tasks/Component/CostumeShikigami/sk3/sk3_sou_switch_sure_3.png


+ 1 - 10
tasks/Component/CostumeShikigami/sk4/image.json

@@ -62,15 +62,6 @@
     "threshold": 0.8,
     "description": "description"
   },
-  {
-    "itemName": "sou_switch_sure_4",
-    "imageName": "sk4_sou_switch_sure_4.png",
-    "roiFront": "668,401,180,61",
-    "roiBack": "668,401,180,61",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
   {
     "itemName": "sou_check_in_4",
     "imageName": "sk4_sou_check_in_4.png",
@@ -179,4 +170,4 @@
     "threshold": 0.8,
     "description": "更换"
   }
-]
+]

BIN
tasks/Component/CostumeShikigami/sk4/sk4_sou_switch_sure_4.png


+ 1 - 10
tasks/Component/CostumeShikigami/sk5/image.json

@@ -62,15 +62,6 @@
     "threshold": 0.8,
     "description": "description"
   },
-  {
-    "itemName": "sou_switch_sure_5",
-    "imageName": "sk5_sou_switch_sure_5.png",
-    "roiFront": "668,401,180,61",
-    "roiBack": "668,401,180,61",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
   {
     "itemName": "sou_check_in_5",
     "imageName": "sk5_sou_check_in_5.png",
@@ -179,4 +170,4 @@
     "threshold": 0.8,
     "description": "更换"
   }
-]
+]

BIN
tasks/Component/CostumeShikigami/sk5/sk5_sou_switch_sure_5.png


+ 1 - 10
tasks/Component/CostumeShikigami/sk6/image.json

@@ -62,15 +62,6 @@
     "threshold": 0.8,
     "description": "description"
   },
-  {
-    "itemName": "sou_switch_sure_6",
-    "imageName": "sk6_sou_switch_sure_6.png",
-    "roiFront": "668,401,180,61",
-    "roiBack": "668,401,180,61",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
   {
     "itemName": "sou_check_in_6",
     "imageName": "sk6_sou_check_in_6.png",
@@ -179,4 +170,4 @@
     "threshold": 0.8,
     "description": "更换"
   }
-]
+]

BIN
tasks/Component/CostumeShikigami/sk6/sk6_sou_switch_sure_6.png


+ 1 - 10
tasks/Component/CostumeShikigami/sk7/image.json

@@ -62,15 +62,6 @@
     "threshold": 0.8,
     "description": "description"
   },
-  {
-    "itemName": "sou_switch_sure_7",
-    "imageName": "sk7_sou_switch_sure_7.png",
-    "roiFront": "668,401,180,61",
-    "roiBack": "668,401,180,61",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
   {
     "itemName": "sou_check_in_7",
     "imageName": "sk7_sou_check_in_7.png",
@@ -179,4 +170,4 @@
     "threshold": 0.8,
     "description": "更换"
   }
-]
+]

BIN
tasks/Component/CostumeShikigami/sk7/sk7_sou_switch_sure_7.png


+ 1 - 10
tasks/Component/CostumeShikigami/sk8/image.json

@@ -62,15 +62,6 @@
     "threshold": 0.8,
     "description": "第四组切换"
   },
-  {
-    "itemName": "sou_switch_sure_8",
-    "imageName": "sk8_sou_switch_sure_8.png",
-    "roiFront": "668,401,180,61",
-    "roiBack": "668,401,180,61",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "确认切换"
-  },
   {
     "itemName": "sou_check_in_8",
     "imageName": "sk8_sou_check_in_8.png",
@@ -179,4 +170,4 @@
     "threshold": 0.8,
     "description": "更换"
   }
-]
+]

BIN
tasks/Component/CostumeShikigami/sk8/sk8_sou_switch_sure_8.png


+ 1 - 10
tasks/Component/CostumeShikigami/sk9/image.json

@@ -62,15 +62,6 @@
     "threshold": 0.8,
     "description": "第四组切换"
   },
-  {
-    "itemName": "sou_switch_sure_9",
-    "imageName": "sk9_sou_switch_sure_9.png",
-    "roiFront": "669,401,190,61",
-    "roiBack": "669,401,190,61",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "确认切换"
-  },
   {
     "itemName": "sou_check_in_9",
     "imageName": "sk9_sou_check_in_9.png",
@@ -179,4 +170,4 @@
     "threshold": 0.8,
     "description": "更换"
   }
-]
+]

BIN
tasks/Component/CostumeShikigami/sk9/sk9_sou_switch_sure_9.png


+ 0 - 2
tasks/Component/GeneralBattle/assets.py

@@ -109,8 +109,6 @@ class GeneralBattleAssets:
 	I_STATISTICS = RuleImage(roi_front=(70,630,33,28), roi_back=(35,28,411,661), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_statistics.png")
 	# 左上角的退出 
 	I_EXIT = RuleImage(roi_front=(14,12,43,41), roi_back=(14,12,43,41), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_exit.png")
-	# 退出确认 
-	I_EXIT_ENSURE = RuleImage(roi_front=(674,388,135,63), roi_back=(674,388,135,63), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_exit_ensure.png")
 	# 左上角好友图标 
 	I_FRIENDS = RuleImage(roi_front=(89,14,36,36), roi_back=(89,14,36,36), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_friends.png")
 	# 结算时左下角统计图标 

BIN
tasks/Component/GeneralBattle/gb/gb_exit_ensure.png


+ 0 - 9
tasks/Component/GeneralBattle/gb/image.json

@@ -152,15 +152,6 @@
     "threshold": 0.8,
     "description": "左上角的退出"
   },
-  {
-    "itemName": "exit_ensure",
-    "imageName": "gb_exit_ensure.png",
-    "roiFront": "674,388,135,63",
-    "roiBack": "674,388,135,63",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "退出确认"
-  },
   {
     "itemName": "friends",
     "imageName": "gb_friends.png",

+ 5 - 5
tasks/Component/GeneralBattle/general_battle.py

@@ -102,18 +102,18 @@ class GeneralBattle(BattleWait, GeneralBuff):
             self.screenshot()
             if self.appear_then_click(self.I_EXIT, interval=1.5):
                 continue
-            if self.appear(self.I_EXIT_ENSURE):
+            if self.appear(self.I_UI_CONFIRM):
                 break
         logger.info(f"Click {self.I_EXIT.name}")
 
         # 点击返回确认
         while 1:
             self.screenshot()
-            if self.appear_then_click(self.I_EXIT_ENSURE, interval=1.5):
+            if self.appear_then_click(self.I_UI_CONFIRM, interval=1.5):
                 continue
             if self.appear(self.I_FALSE):
                 break
-        logger.info(f"Click {self.I_EXIT_ENSURE.name}")
+        logger.info(f"Click {self.I_UI_CONFIRM.name}")
 
         # 点击失败确认
         self.wait_until_appear(self.I_FALSE)
@@ -144,13 +144,13 @@ class GeneralBattle(BattleWait, GeneralBuff):
             self.screenshot()
             if self.appear_then_click(self.I_EXIT, interval=1.5):
                 continue
-            if self.appear(self.I_EXIT_ENSURE):
+            if self.appear(self.I_UI_CONFIRM):
                 break
 
         # 点击返回确认
         while 1:
             self.screenshot()
-            if self.appear_then_click(self.I_EXIT_ENSURE, interval=1.5):
+            if self.appear_then_click(self.I_UI_CONFIRM, interval=1.5):
                 continue
             if self.appear_then_click(self.I_FALSE, interval=1.5):
                 continue

+ 0 - 1
tasks/Component/SwitchSoul/assets.py

@@ -43,7 +43,6 @@ class SwitchSoulAssets:
 	# description 
 	I_SOU_SWITCH_4 = RuleImage(roi_front=(978,603,25,22), roi_back=(962,592,53,34), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_switch_4.png")
 	# description 
-	I_SOU_SWITCH_SURE = RuleImage(roi_front=(668,401,180,61), roi_back=(668,401,180,61), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_switch_sure.png")
 	# 用于判断是否在式神录里面 
 	I_SOU_CHECK_IN = RuleImage(roi_front=(269,69,50,49), roi_back=(269,69,50,49), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_check_in.png")
 	# description 

+ 1 - 10
tasks/Component/SwitchSoul/ss/image.json

@@ -53,15 +53,6 @@
     "threshold": 0.8,
     "description": "description"
   },
-  {
-    "itemName": "sou_switch_sure",
-    "imageName": "ss_sou_switch_sure.png",
-    "roiFront": "668,401,180,61",
-    "roiBack": "668,401,180,61",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
   {
     "itemName": "sou_check_in",
     "imageName": "ss_sou_check_in.png",
@@ -170,4 +161,4 @@
     "threshold": 0.8,
     "description": "通用进入式神录"
   }
-]
+]

BIN
tasks/Component/SwitchSoul/ss/ss_sou_switch_sure.png


+ 5 - 5
tasks/Component/SwitchSoul/switch_soul.py

@@ -154,19 +154,19 @@ class SwitchSoul(BaseTask, SwitchSoulAssets):
         for i in range(3):
             sleep(0.8)
             self.screenshot()
-            if self.appear(self.I_SOU_SWITCH_SURE):
+            if self.appear(self.I_UI_CONFIRM):
                 while 1:
-                    self.click(self.I_SOU_SWITCH_SURE, 3)
+                    self.click(self.I_UI_CONFIRM, 3)
                     self.screenshot()
                     if self.appear_then_click(self.I_CHECK_BLOCK, 3):
                         continue
-                    if not self.appear(self.I_SOU_SWITCH_SURE):
+                    if not self.appear(self.I_UI_CONFIRM):
                         break
                 continue
             if not self.appear_then_click(target_team, interval=3):
                 logger.warning(f'Click team {team} failed in group {group}')
         # 兜底若还出现确认按钮则点击
-        self.ui_click_until_disappear(self.I_SOU_SWITCH_SURE)
+        self.ui_click_until_disappear(self.I_UI_CONFIRM)
         logger.info(f'Switch soul_one group {group} team {team}')
 
     def switch_souls(self, target: tuple or list[tuple]) -> None:
@@ -275,7 +275,7 @@ class SwitchSoul(BaseTask, SwitchSoulAssets):
             self.screenshot()
             if cnt_click >= 4:
                 break
-            if self.appear_then_click(self.I_SOU_SWITCH_SURE, interval=0.8):
+            if self.appear_then_click(self.I_UI_CONFIRM, interval=0.8):
                 continue
             if self.ocr_appear_click_by_rule(self.O_SS_TEAM_NAME, self.I_SOU_CLICK_PRESENT, interval=1.5):
                 cnt_click += 1

+ 7 - 7
tasks/DemonEncounter/assets.py

@@ -60,7 +60,7 @@ class DemonEncounterAssets:
 
 
 	# Click Rule Assets
-	# 从下开始数第一个(点击区已收缩, 仅包住内部图形)
+	# 从下开始数第一个 
 	C_DE_1 = RuleClick(roi_front=(1222,497,39,25), roi_back=(1222,497,39,25), name="de_1")
 	# 2 
 	C_DE_2 = RuleClick(roi_front=(1204,424,39,31), roi_back=(1204,424,39,31), name="de_2")
@@ -68,13 +68,13 @@ class DemonEncounterAssets:
 	C_DE_3 = RuleClick(roi_front=(1234,364,32,22), roi_back=(1234,364,32,22), name="de_3")
 	# 第四个 
 	C_DE_4 = RuleClick(roi_front=(1214,297,34,27), roi_back=(1214,297,34,27), name="de_4")
-	# 灯笼1类型识别搜索区(须容纳完整灯笼图案, 仅供check_lantern匹配, 不用于点击)
+	# 灯笼1类型识别搜索区(须容纳完整灯笼图案, 仅供check_lantern匹配, 不用于点击) 
 	C_DE_MATCH_1 = RuleClick(roi_front=(1211,478,61,58), roi_back=(1211,478,61,58), name="de_match_1")
-	# 灯笼2类型识别搜索区
+	# 灯笼2类型识别搜索区 
 	C_DE_MATCH_2 = RuleClick(roi_front=(1196,409,55,56), roi_back=(1196,409,55,56), name="de_match_2")
-	# 灯笼3类型识别搜索区
+	# 灯笼3类型识别搜索区 
 	C_DE_MATCH_3 = RuleClick(roi_front=(1225,344,53,55), roi_back=(1225,344,53,55), name="de_match_3")
-	# 灯笼4类型识别搜索区
+	# 灯笼4类型识别搜索区 
 	C_DE_MATCH_4 = RuleClick(roi_front=(1200,282,56,53), roi_back=(1200,282,56,53), name="de_match_4")
 
 
@@ -97,6 +97,8 @@ class DemonEncounterAssets:
 	I_SUSHI = RuleImage(roi_front=(602,318,72,54), roi_back=(581,294,115,116), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/demon_sushi.png")
 	# 50勾玉购买 
 	I_JADE_50 = RuleImage(roi_front=(593,425,84,46), roi_back=(548,405,182,83), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/demon_jade_50.png")
+	# 地图中央未购买的宝箱展示 
+	I_DE_BOX_CENTER = RuleImage(roi_front=(618,325,45,34), roi_back=(547,264,190,157), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/demon_de_box_center.png")
 
 
 	# Image Rule Assets
@@ -104,8 +106,6 @@ class DemonEncounterAssets:
 	I_DE_BALLOON = RuleImage(roi_front=(1214,295,28,27), roi_back=(1198,269,81,266), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/demon_de_balloon.png")
 	# 右侧的宝箱 
 	I_DE_BOX = RuleImage(roi_front=(1210,295,34,33), roi_back=(1183,278,96,277), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/demon_de_box.png")
-	# 地图中央未购买的宝箱展示 
-	I_DE_BOX_CENTER = RuleImage(roi_front=(618,325,45,34), roi_back=(547,264,190,157), threshold=0.8, method="Template matching", file="./tasks/DemonEncounter/demon/demon_de_box_center.png")
 	# 挑战某一个后的封印图片 
 	I_DE_DEFEAT_2 = RuleImage(roi_front=(1211,422,28,35), roi_back=(1211,422,28,35), threshold=0.7, method="Template matching", file="./tasks/DemonEncounter/demon/demon_de_defeat_2.png")
 	# description 

+ 1 - 1
tasks/Duel/script_task.py

@@ -207,7 +207,7 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, DuelAssets, SwitchOnmyoji):
             self.screenshot()
             if self.appear(self.I_D_FAIL) or self.appear(self.I_FALSE):
                 return
-            if self.appear_then_click(self.I_EXIT_ENSURE):
+            if self.appear_then_click(self.I_UI_CONFIRM):
                 continue
             # 选式神界面退出或战斗内退出
             if self.appear_then_click(self.I_DUEL_EXIT, interval=1) or self.appear_then_click(self.I_EXIT, interval=1):

+ 7 - 9
tasks/Exploration/assets.py

@@ -68,9 +68,9 @@ class ExplorationAssets:
 	C_CLICK_ROTATE_4 = RuleClick(roi_front=(921,590,21,21), roi_back=(921,590,21,21), name="click_rotate_4")
 	# 随机点 
 	C_SAFE_RANDOM = RuleClick(roi_front=(0,0,111,12), roi_back=(0,0,111,12), name="safe_random")
-	# 探索大地图 · 主线 tab 标题("章"字锚点)点击区域 
+	# 点击探索大地图主线tab标题 
 	C_CLICK_MAIN_TITLE = RuleClick(roi_front=(1070,174,77,28), roi_back=(1070,174,77,28), name="click_main_title")
-	# 探索大地图 · 玩法 tab 标题("御魂"标题锚点)点击区域 
+	# 点击探索大地图玩法tab标题 
 	C_CLICK_PALY_TITLE = RuleClick(roi_front=(1178,172,77,28), roi_back=(1178,172,77,28), name="click_paly_title")
 
 
@@ -108,13 +108,9 @@ class ExplorationAssets:
 	# description 
 	I_BATTLE_START = RuleImage(roi_front=(555,688,39,27.5), roi_back=(221,677,561,41), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_battle_start.png")
 	# description 
-	I_GET_REWARD = RuleImage(roi_front=(464,231,339,44), roi_back=(464,231,339,44), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_get_reward.png")
-	# description 
 	I_RED_CLOSE = RuleImage(roi_front=(1027,129,41,42), roi_back=(1021,121,54,55), threshold=0.6, method="Template matching", file="./tasks/Exploration/res/res_red_close.png")
-	# description
+	# description 
 	I_E_EXIT_CONFIRM = RuleImage(roi_front=(694,380,163,49), roi_back=(694,380,163,49), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_e_exit_confirm.png")
-	# 探索章节切换文件夹图标(移植自mine)
-	I_E_OPEN_FOLDER = RuleImage(roi_front=(1241,114,22,28), roi_back=(1212,88,68,123), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_e_open_folder.png")
 	# 宝箱 
 	I_TREASURE_BOX_CLICK = RuleImage(roi_front=(31,543,27,24), roi_back=(11,520,378,65), threshold=0.65, method="Template matching", file="./tasks/Exploration/res/res_treasure_box_click.png")
 	# 困28滚动到最后 
@@ -131,9 +127,11 @@ class ExplorationAssets:
 	I_EXP_ARROW_LEFT = RuleImage(roi_front=(1244,115,18,26), roi_back=(1178,78,100,100), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_exp_arrow_left.png")
 	# 战斗中的队友标识 
 	I_TEAM_EMOJI_FIGHT = RuleImage(roi_front=(38,405,37,37), roi_back=(18,386,74,75), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_team_emoji_fight.png")
-	# 探索大地图 · 主线 tab 标题锚点("章"字,仅主线 tab 命中,玩法 tab 不命中) 
+	# 探索章节切换文件夹图标(移植自mine) 
+	I_E_OPEN_FOLDER = RuleImage(roi_front=(1241,114,22,28), roi_back=(1212,88,68,123), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_e_open_folder.png")
+	# 探索大地图主线tab标题锚点(章字) 
 	I_CHECK_MAIN_TITLE = RuleImage(roi_front=(1150,457,32,32), roi_back=(1069,222,113,336), threshold=0.85, method="Template matching", file="./tasks/Exploration/res/res_check_main_title.png")
-	# 探索大地图 · 玩法 tab 标题锚点("御魂"标题,仅玩法 tab 命中,主线 tab 不命中) 
+	# 探索大地图玩法tab标题锚点(御魂) 
 	I_CHECK_PLAY_TITLE = RuleImage(roi_front=(1073,214,40,32), roi_back=(1065,210,190,316), threshold=0.85, method="Template matching", file="./tasks/Exploration/res/res_check_play_title.png")
 
 

+ 0 - 9
tasks/Exploration/res/image.json

@@ -143,15 +143,6 @@
     "threshold": 0.8,
     "description": "description"
   },
-  {
-    "itemName": "get_reward",
-    "imageName": "res_get_reward.png",
-    "roiFront": "464,231,339,44",
-    "roiBack": "464,231,339,44",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
   {
     "itemName": "red_close",
     "imageName": "res_red_close.png",

BIN
tasks/Exploration/res/res_get_reward.png


+ 11 - 11
tasks/FrogBoss/assets.py

@@ -21,13 +21,13 @@ class FrogBossAssets:
 	I_SUCCESS_LEFT = RuleImage(roi_front=(292,306,100,100), roi_back=(238,243,202,221), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_success_left.png")
 	# 右边输了 
 	I_FAILURE_RIGHT = RuleImage(roi_front=(1097,303,100,100), roi_back=(1029,256,224,199), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_failure_right.png")
-	# 开始下一局
+	# 开始下一局 
 	I_NEXT_COMPETITION = RuleImage(roi_front=(783,492,28,22), roi_back=(692,437,157,147), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_next_competition.png")
 	# 30万金币 
 	I_GOLD_30 = RuleImage(roi_front=(862,499,78,76), roi_back=(831,441,147,187), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_gold_30.png")
 	# 确认竞猜 
 	I_BET_SURE = RuleImage(roi_front=(1025,402,100,100), roi_back=(972,340,200,226), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_bet_sure.png")
-	# 获胜奖励说明弹窗中的竞猜金币
+	# 获胜奖励说明弹窗中的竞猜金币 
 	I_GOLD_30_CHECK = RuleImage(roi_front=(513,196,58,53), roi_back=(495,195,104,111), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_gold_30_check.png")
 	# description 
 	I_BETTED = RuleImage(roi_front=(1093,313,125,54), roi_back=(207,240,1058,312), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_betted.png")
@@ -46,21 +46,21 @@ class FrogBossAssets:
 	I_FROG_BOSS_ENTER = RuleImage(roi_front=(1188,303,36,38), roi_back=(1169,203,78,320), threshold=0.7, method="Template matching", file="./tasks/FrogBoss/fb/fb_frog_boss_enter.png")
 	# 休息中 
 	I_FROG_BOSS_REST = RuleImage(roi_front=(627,284,169,64), roi_back=(601,259,220,113), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_frog_boss_rest.png")
-	# 竞猜主页面
+	# 竞猜主页面 
 	I_FROG_CHECK = RuleImage(roi_front=(664,31,148,65), roi_back=(551,4,371,145), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_frog_check.png")
-	# 进入记录页面
+	# 进入记录页面 
 	I_FROG_LOG = RuleImage(roi_front=(1171,624,43,41), roi_back=(1157,601,83,89), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_frog_log.png")
-	#
+	#  
 	I_FROG_LOG_CHECK = RuleImage(roi_front=(549,31,192,52), roi_back=(469,0,371,145), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_frog_log_check.png")
-	# 上一局胜
+	# 上一局胜 
 	I_FROG_LAST_WIN = RuleImage(roi_front=(178,210,61,49), roi_back=(148,147,114,123), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_frog_last_win.png")
-	# 上一局败
+	# 上一局败 
 	I_FROG_LAST_LOSE = RuleImage(roi_front=(178,210,61,49), roi_back=(148,147,114,123), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_frog_last_lose.png")
-	# 关闭记录
+	# 关闭记录 
 	I_FROG_LOG_CLOSE = RuleImage(roi_front=(1188,99,43,41), roi_back=(1166,73,83,89), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_frog_log_close.png")
-	# 上一局选择红色
+	# 上一局选择红色 
 	I_FROG_LAST_SELECT_RED = RuleImage(roi_front=(342,149,36,38), roi_back=(327,120,70,77), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_frog_last_select_red.png")
-	# 上一句选择蓝色
+	# 上一句选择蓝色 
 	I_FROG_LAST_SELECT_BLUE = RuleImage(roi_front=(342,149,36,38), roi_back=(327,120,70,77), threshold=0.8, method="Template matching", file="./tasks/FrogBoss/fb/fb_frog_last_select_blue.png")
 
 
@@ -71,7 +71,7 @@ class FrogBossAssets:
 	O_RIGHT_COUNT = RuleOcr(roi=(1139,472,77,32), area=(1139,472,77,32), mode="Digit", method="Default", keyword="", name="right_count")
 	# Ocr-description 
 	O_TIME_REMAIN = RuleOcr(roi=(705,533,91,35), area=(705,533,91,35), mode="Duration", method="Default", keyword="", name="time_remain")
-	# 上一句对局时间
+	# 上一句对局时间 
 	O_FROG_LAST_TIME = RuleOcr(roi=(120,154,160,30), area=(120,154,160,30), mode="Single", method="Default", keyword="", name="frog_last_time")
 
 

+ 11 - 5
tasks/GlobalGame/assets.py

@@ -39,21 +39,25 @@ class GlobalGameAssets:
 
 
 	# Image Rule Assets
+	# 长一点的确认(旧) 
+	I_UI_CONFIRM_OLD = RuleImage(roi_front=(685,376,179,66), roi_back=(663,334,232,193), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_confirm_old.png")
 	# 长一点的确认 
-	I_UI_CONFIRM = RuleImage(roi_front=(667,398,179,66), roi_back=(667,398,179,66), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_confirm.png")
+	I_UI_CONFIRM = RuleImage(roi_front=(664,407,179,66), roi_back=(643,389,214,95), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_confirm.png")
+	# 长一点的取消(旧) 
+	I_UI_CANCEL_OLD = RuleImage(roi_front=(417,368,177,62), roi_back=(366,349,261,173), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_cancel_old.png")
 	# 长一点的取消 
-	I_UI_CANCEL = RuleImage(roi_front=(432,403,177,62), roi_back=(432,403,177,62), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_cancel.png")
+	I_UI_CANCEL = RuleImage(roi_front=(438,407,177,62), roi_back=(356,384,276,125), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_cancel.png")
 	# '获得奖励' 四个大字 
-	I_UI_REWARD = RuleImage(roi_front=(481,185,317,42), roi_back=(464,142,350,145), threshold=0.73, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_reward.png")
+	I_UI_REWARD = RuleImage(roi_front=(530,126,211,66), roi_back=(464,69,352,303), threshold=0.73, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_reward.png")
 	# description 
 	I_UI_BACK_RED = RuleImage(roi_front=(1041,111,34,38), roi_back=(877,15,383,254), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_back_red.png")
 	# description 
 	I_UI_BACK_YELLOW = RuleImage(roi_front=(26,17,47,46), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_back_yellow.png")
 	# description 
-	I_UI_BACK_BLUE = RuleImage(roi_front=(32,37,51,45), roi_back=(2,1,133,119), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_back_blue.png")
-	# 圆形返回按钮(移植自mine)
 	I_UI_BACK_CIRCLE = RuleImage(roi_front=(24,21,36,39), roi_back=(0,0,95,101), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_back_circle.png")
 	# description 
+	I_UI_BACK_BLUE = RuleImage(roi_front=(32,37,51,45), roi_back=(2,1,133,119), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_back_blue.png")
+	# description 
 	I_UI_AWARD = RuleImage(roi_front=(577,499,100,100), roi_back=(530,408,199,220), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_award.png")
 	# 短一点的确认 
 	I_UI_CONFIRM_SAMLL = RuleImage(roi_front=(681,392,130,62), roi_back=(558,380,265,99), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_confirm_samll.png")
@@ -65,5 +69,7 @@ class GlobalGameAssets:
 	I_UI_CHECK = RuleImage(roi_front=(564,341,40,38), roi_back=(512,329,164,78), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_check.png")
 	# 知道了 
 	I_UI_GOTIT_SMALL = RuleImage(roi_front=(678,396,127,60), roi_back=(622,371,242,100), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_gotit_small.png")
+	# 圆形返回按钮(移植自mine) 
+	# I_UI_BACK_CIRCLE = RuleImage(roi_front=(24,21,36,39), roi_back=(0,0,95,101), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_back_circle.png")
 
 

+ 34 - 7
tasks/GlobalGame/ui/image.json

@@ -1,18 +1,36 @@
 [
+  {
+    "itemName": "ui_confirm_old",
+    "imageName": "ui_ui_confirm_old.png",
+    "roiFront": "685,376,179,66",
+    "roiBack": "663,334,232,193",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "长一点的确认(旧)"
+  },
   {
     "itemName": "ui_confirm",
     "imageName": "ui_ui_confirm.png",
-    "roiFront": "667,398,179,66",
-    "roiBack": "667,398,179,66",
+    "roiFront": "664,407,179,66",
+    "roiBack": "643,389,214,95",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "长一点的确认"
   },
+  {
+    "itemName": "ui_cancel_old",
+    "imageName": "ui_ui_cancel_old.png",
+    "roiFront": "417,368,177,62",
+    "roiBack": "366,349,261,173",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "长一点的取消(旧)"
+  },
   {
     "itemName": "ui_cancel",
     "imageName": "ui_ui_cancel.png",
-    "roiFront": "432,403,177,62",
-    "roiBack": "432,403,177,62",
+    "roiFront": "438,407,177,62",
+    "roiBack": "356,384,276,125",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "长一点的取消"
@@ -20,8 +38,8 @@
   {
     "itemName": "ui_reward",
     "imageName": "ui_ui_reward.png",
-    "roiFront": "481,185,317,42",
-    "roiBack": "464,142,350,145",
+    "roiFront": "530,126,211,66",
+    "roiBack": "464,69,352,303",
     "method": "Template matching",
     "threshold": 0.73,
     "description": "'获得奖励' 四个大字"
@@ -44,6 +62,15 @@
     "threshold": 0.8,
     "description": "description"
   },
+  {
+    "itemName": "ui_back_circle",
+    "imageName": "ui_ui_back_circle.png",
+    "roiFront": "24,21,36,39",
+    "roiBack": "0,0,95,101",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
   {
     "itemName": "ui_back_blue",
     "imageName": "ui_ui_back_blue.png",
@@ -116,4 +143,4 @@
     "threshold": 0.8,
     "description": "圆形返回按钮(移植自mine)"
   }
-]
+]

BIN
tasks/GlobalGame/ui/ui_ui_cancel.png


BIN
tasks/GlobalGame/ui/ui_ui_cancel_old.png


BIN
tasks/GlobalGame/ui/ui_ui_confirm.png


BIN
tasks/GlobalGame/ui/ui_ui_confirm_old.png


BIN
tasks/GlobalGame/ui/ui_ui_reward.png


BIN
tasks/GlobalGame/ui/ui_ui_rewards.png


+ 0 - 2
tasks/RealmRaid/assets.py

@@ -39,8 +39,6 @@ class RealmRaidAssets:
 	I_FIRE = RuleImage(roi_front=(982,494,136,63), roi_back=(140,129,1024,584), threshold=0.8, method="Template matching", file="./tasks/RealmRaid/res/res_fire.png")
 	# 打完个后出现的领取奖励 
 	I_SOUL_RAID = RuleImage(roi_front=(577,502,100,100), roi_back=(577,502,100,100), threshold=0.8, method="Template matching", file="./tasks/RealmRaid/res/res_soul_raid.png")
-	# 刷新确认 
-	I_FRESH_ENSURE = RuleImage(roi_front=(672,403,173,59), roi_back=(672,403,173,59), threshold=0.8, method="Template matching", file="./tasks/RealmRaid/res/res_fresh_ensure.png")
 	# 没有锁图片,适配呱太入侵 
 	I_UNLOCK_2 = RuleImage(roi_front=(1002,643,30,41), roi_back=(1002,643,30,41), threshold=0.9, method="Template matching", file="./tasks/RealmRaid/res/res_unlock_2.png")
 	# 以锁图片,适配呱太 

+ 1 - 10
tasks/RealmRaid/res/image.json

@@ -125,15 +125,6 @@
     "threshold": 0.8,
     "description": "打完个后出现的领取奖励"
   },
-  {
-    "itemName": "fresh_ensure",
-    "imageName": "res_fresh_ensure.png",
-    "roiFront": "672,403,173,59",
-    "roiBack": "672,403,173,59",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "刷新确认"
-  },
   {
     "itemName": "unlock_2",
     "imageName": "res_unlock_2.png",
@@ -179,4 +170,4 @@
     "threshold": 0.8,
     "description": "description"
   }
-]
+]

BIN
tasks/RealmRaid/res/res_fresh_ensure.png


+ 10 - 10
tasks/RealmRaid/script_task.py

@@ -154,9 +154,9 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, RealmRaidAssets):
         while 1:
             self.screenshot()
             #看到弹窗点掉,不然会卡死
-            if self.appear(self.I_FRESH_ENSURE):
+            if self.appear(self.I_UI_CONFIRM):
                 logger.info("Pop-up detected: Refresh Confirmation. Clicking Confirm.")
-                self.appear_then_click(self.I_FRESH_ENSURE, interval=1.5)
+                self.appear_then_click(self.I_UI_CONFIRM, interval=1.5)
                 continue
             # 检查票数
             if not self.check_ticket(con.raid_config.number_base):
@@ -179,10 +179,10 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, RealmRaidAssets):
                 else:
                     logger.info('No one can attack, break')
                     # 检查是否有“刷新确认”弹窗挡路
-                    if self.appear(self.I_FRESH_ENSURE):
+                    if self.appear(self.I_UI_CONFIRM):
                         logger.info("Closing obstructing refresh dialog (Click Ensure)...")
                         # 点击“确定”来完成刷新(或者你可以改成点取消)
-                        self.appear_then_click(self.I_FRESH_ENSURE, interval=2)
+                        self.appear_then_click(self.I_UI_CONFIRM, interval=2)
                     success = False
                     break
             # 判断是不是左上角第一个
@@ -459,15 +459,15 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, RealmRaidAssets):
             return False
         while 1:
             self.screenshot()
-            if self.appear(self.I_FRESH_ENSURE):
+            if self.appear(self.I_UI_CONFIRM):
                 break
             if self.appear_then_click(self.I_FRESH, interval=1):
                 continue
         while 1:
             self.screenshot()
-            if not self.appear(self.I_FRESH_ENSURE):
+            if not self.appear(self.I_UI_CONFIRM):
                 return True
-            if self.appear_then_click(self.I_FRESH_ENSURE, interval=1):
+            if self.appear_then_click(self.I_UI_CONFIRM, interval=1):
                 continue
 
     def fire(self, order: int):
@@ -483,8 +483,8 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, RealmRaidAssets):
             
             logger.info("Title not found! Checking for popups or rewards...")
             
-            # 如果看到了“刷新确认”弹窗 (I_FRESH_ENSURE 是右边的确定)
-            if self.appear(self.I_FRESH_ENSURE):
+            # 如果看到了“刷新确认”弹窗 (self.I_UI_CONFIRM 是右边的确定)
+            if self.appear(self.I_UI_CONFIRM):
                 logger.info("Refresh popup detected! Clicking CANCEL (Red Button).")
                 # 点击“取消”按钮的坐标 (基于1280x720分辨率)
                 self.device.click(x=530, y=460) 
@@ -506,7 +506,7 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, RealmRaidAssets):
             self.screenshot()
             
             # 双重保险:如果在进攻阶段又弹出了窗口,也把它关掉
-            if self.appear(self.I_FRESH_ENSURE):
+            if self.appear(self.I_UI_CONFIRM):
                 logger.info("Refresh popup blocking attack! Clicking CANCEL.")
                 self.device.click(x=530, y=460) # 点取消
                 time.sleep(1.0)

+ 3 - 4
tasks/Restart/assets.py

@@ -91,12 +91,9 @@ class RestartAssets:
 	# Click Rule Assets
 	# 相同服务器多个角色选择界面,点击空白区域 确认登录 
 	C_LOGIN_ENSURE_LOGIN_CHARACTER_IN_SAME_SVR = RuleClick(roi_front=(600,240,500,400), roi_back=(600,240,500,400), name="login_ensure_login_character_in_same_svr")
-	# 卷轴关闭区域点击(用户新增,用于点击I_LOGIN_SCROOLL_CLOSE的区域而不依赖图片识别)
+	# 卷轴关闭区域点击(用户新增,用于点击I_LOGIN_SCROOLL_CLOSE的区域而不依赖图片识别) 
 	C_LOGIN_SCROLL_CLOSE_AREA = RuleClick(roi_front=(1181,634,28,39), roi_back=(1162,595,77,112), name="login_scroll_close_area")
 
-	# 庭院卷轴收起状态标志(移植自mine)
-	I_LOGIN_COURTYARD = RuleImage(roi_front=(40,640,100,50), roi_back=(40,640,100,50), threshold=0.8, method="Template matching", file="./tasks/Restart/login/login_courtyard.png")
-
 
 	# Image Rule Assets
 	# 庭院卷轴打开 
@@ -135,6 +132,8 @@ class RestartAssets:
 	I_EARLY_SERVER_CANCEL = RuleImage(roi_front=(435,404,172,56), roi_back=(435,404,172,56), threshold=0.8, method="Template matching", file="./tasks/Restart/login/login_early_server_cancel.png")
 	# 取消继续战斗 
 	I_CANCEL_BATTLE = RuleImage(roi_front=(471,395,129,55), roi_back=(367,227,545,296), threshold=0.8, method="Template matching", file="./tasks/Restart/login/login_cancel_battle.png")
+	# 庭院卷轴收起状态标志(移植自mine) 
+	I_LOGIN_COURTYARD = RuleImage(roi_front=(40,640,100,50), roi_back=(40,640,100,50), threshold=0.8, method="Template matching", file="./tasks/Restart/login/login_courtyard.png")
 
 
 	# Ocr Rule Assets