Browse Source

fix(SoulsTidy):添加 奉纳出现“吉运”、"小吉运"以及御魂堆叠=1个时的识别

minjie 7 months ago
parent
commit
2fe04b2001

+ 9 - 1
tasks/SoulsTidy/assets.py

@@ -15,6 +15,8 @@ class SoulsTidyAssets:
 	C_ST_DETAIL = RuleClick(roi_front=(1188,318,87,74), roi_back=(1190,317,87,74), name="st_detail")
 	# 出现神赐 
 	C_ST_GOD_PRSENT = RuleClick(roi_front=(717,165,100,48), roi_back=(926,165,100,54), name="st_god_prsent")
+	# 御魂奉纳奖励 
+	C_ST_SOUL_OFFERING_REWARD = RuleClick(roi_front=(717,165,100,48), roi_back=(926,165,100,54), name="st_soul_offering_reward")
 
 
 	# Image Rule Assets
@@ -50,10 +52,16 @@ class SoulsTidyAssets:
 	I_ST_GOLD = RuleImage(roi_front=(170,100,950,500), roi_back=(170,100,950,500), threshold=0.9, method="Template matching", file="./tasks/SoulsTidy/simple/simple_st_gold.png")
 	# 御魂溢出 
 	I_ST_SOUL_OVERFLOW = RuleImage(roi_front=(447,260,384,42), roi_back=(447,260,384,42), threshold=0.8, method="Template matching", file="./tasks/SoulsTidy/simple/simple_st_soul_overflow.png")
-	# 狗粮御魂的堆叠标识 
+	# 5星御魂的堆叠标识_大于1个 
 	I_ST_SOUL_STACK = RuleImage(roi_front=(142,234,20,16), roi_back=(142,234,20,16), threshold=0.8, method="Template matching", file="./tasks/SoulsTidy/simple/simple_st_soul_stack.png")
 	# 御魂关闭状态 
 	I_ST_SOULS_CLOSE = RuleImage(roi_front=(1180,227,56,83), roi_back=(1166,215,84,107), threshold=0.8, method="Template matching", file="./tasks/SoulsTidy/simple/simple_st_souls_close.png")
+	# 5星御魂堆叠标识_1个 
+	I_ST_SOUL_STACK_1 = RuleImage(roi_front=(89,239,105,19), roi_back=(89,239,105,19), threshold=0.8, method="Template matching", file="./tasks/SoulsTidy/simple/simple_st_soul_stack_1.png")
+	# 吉运 
+	I_ST_LUCK = RuleImage(roi_front=(596,236,110,56), roi_back=(596,236,110,56), threshold=0.8, method="Template matching", file="./tasks/SoulsTidy/simple/simple_st_luck.png")
+	# 小吉运 
+	I_ST_SMALL_LUCK = RuleImage(roi_front=(549,236,201,35), roi_back=(549,236,201,35), threshold=0.8, method="Template matching", file="./tasks/SoulsTidy/simple/simple_st_small_luck.png")
 
 
 	# Long Click Rule Assets

+ 12 - 1
tasks/SoulsTidy/script_task.py

@@ -126,7 +126,8 @@ class ScriptTask(GameUi, SoulsTidyAssets):
             logger.info('Sort by level')
             # 开始奉纳
             while 1:
-                if self.wait_until_appear(self.I_ST_SOUL_STACK, wait_time=2):
+                if (self.wait_until_appear(self.I_ST_SOUL_STACK, wait_time=2) or
+                        self.wait_until_appear(self.I_ST_SOUL_STACK_1, wait_time=2)):
                     # 方式1. 御魂堆叠奉纳
                     logger.info('Soul stack')
                 else:
@@ -174,6 +175,16 @@ class ScriptTask(GameUi, SoulsTidyAssets):
                         logger.info('God present appear')
                         self.click(self.C_ST_GOD_PRSENT, interval=2)
                         continue
+                    elif self.appear(self.I_ST_LUCK):
+                        # 出现吉运
+                        logger.info('luck appear')
+                        self.click(self.C_ST_SOUL_OFFERING_REWARD, interval=2)
+                        continue
+                    elif self.appear(self.I_ST_SMALL_LUCK):
+                        # 出现小吉运
+                        logger.info('small luck appear')
+                        self.click(self.C_ST_SOUL_OFFERING_REWARD, interval=2)
+                        continue
                     if self.appear_then_click(self.I_ST_DONATE, interval=5.5):
                         self.wait_until_appear(self.I_ST_GOLD, True, wait_time=5)
                         continue

+ 6 - 0
tasks/SoulsTidy/simple/click.json

@@ -10,5 +10,11 @@
     "roiFront": "717,165,100,48",
     "roiBack": "926,165,100,54",
     "description": "出现神赐"
+  },
+  {
+    "itemName": "st_soul_offering_reward",
+    "roiFront": "717,165,100,48",
+    "roiBack": "926,165,100,54",
+    "description": "御魂奉纳奖励"
   }
 ]

+ 28 - 1
tasks/SoulsTidy/simple/image.json

@@ -150,7 +150,7 @@
     "roiBack": "142,234,20,16",
     "method": "Template matching",
     "threshold": 0.8,
-    "description": "狗粮御魂的堆叠标识"
+    "description": "5星御魂的堆叠标识_大于1个"
   },
   {
     "itemName": "st_souls_close",
@@ -160,5 +160,32 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "御魂关闭状态"
+  },
+  {
+    "itemName": "st_soul_stack_1",
+    "imageName": "simple_st_soul_stack_1.png",
+    "roiFront": "89,239,105,19",
+    "roiBack": "89,239,105,19",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "5星御魂堆叠标识_1个"
+  },
+  {
+    "itemName": "st_luck",
+    "imageName": "simple_st_luck.png",
+    "roiFront": "596,236,110,56",
+    "roiBack": "596,236,110,56",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "吉运"
+  },
+  {
+    "itemName": "st_small_luck",
+    "imageName": "simple_st_small_luck.png",
+    "roiFront": "549,236,201,35",
+    "roiBack": "549,236,201,35",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "小吉运"
   }
 ]

BIN
tasks/SoulsTidy/simple/simple_st_luck.png


BIN
tasks/SoulsTidy/simple/simple_st_small_luck.png


BIN
tasks/SoulsTidy/simple/simple_st_soul_stack_1.png