runhey 3 лет назад
Родитель
Сommit
7ee495b3a9

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

@@ -10,11 +10,11 @@ from tasks.Component.SwitchSoul.assets import SwitchSoulAssets
 from module.logger import logger
 from module.logger import logger
 
 
 
 
-def switch_parser(switch_str: str):
+def switch_parser(switch_str: str) -> tuple:
     switch_list = switch_str.split(',')
     switch_list = switch_str.split(',')
     if len(switch_list) != 2:
     if len(switch_list) != 2:
         raise ValueError('Switch_str must be 2 length')
         raise ValueError('Switch_str must be 2 length')
-    return [int(switch) for switch in switch_list]
+    return int(switch_list[0]), int(switch_list[1])
 
 
 class SwitchSoul(BaseTask, SwitchSoulAssets):
 class SwitchSoul(BaseTask, SwitchSoulAssets):
 
 

+ 6 - 0
tasks/Sougenbi/assets.py

@@ -36,6 +36,12 @@ class SougenbiAssets:
 	I_S_FIRE = RuleImage(roi_front=(1105,585,100,100), roi_back=(1105,585,100,100), threshold=0.7, method="Template matching", file="./tasks/Sougenbi/s/s_s_fire.png")
 	I_S_FIRE = RuleImage(roi_front=(1105,585,100,100), roi_back=(1105,585,100,100), threshold=0.7, method="Template matching", file="./tasks/Sougenbi/s/s_s_fire.png")
 	# 确认进入业原火 
 	# 确认进入业原火 
 	I_S_CHECK_SOUGENBI = RuleImage(roi_front=(772,222,307,292), roi_back=(772,222,307,292), threshold=0.8, method="Template matching", file="./tasks/Sougenbi/s/s_s_check_sougenbi.png")
 	I_S_CHECK_SOUGENBI = RuleImage(roi_front=(772,222,307,292), roi_back=(772,222,307,292), threshold=0.8, method="Template matching", file="./tasks/Sougenbi/s/s_s_check_sougenbi.png")
+	# 贪 
+	I_S_FIRE_GREED = RuleImage(roi_front=(1133,641,21,33), roi_back=(1133,641,21,33), threshold=0.8, method="Template matching", file="./tasks/Sougenbi/s/s_s_fire_greed.png")
+	# description 
+	I_S_FIRE_ANGER = RuleImage(roi_front=(1132,643,21,30), roi_back=(1132,643,21,30), threshold=0.8, method="Template matching", file="./tasks/Sougenbi/s/s_s_fire_anger.png")
+	# 痴 
+	I_S_FIRE_FOOLERY = RuleImage(roi_front=(1130,642,22,31), roi_back=(1130,642,22,31), threshold=0.8, method="Template matching", file="./tasks/Sougenbi/s/s_s_fire_foolery.png")
 
 
 
 
 	# Ocr Rule Assets
 	# Ocr Rule Assets

+ 27 - 0
tasks/Sougenbi/s/image.json

@@ -70,5 +70,32 @@
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "确认进入业原火"
     "description": "确认进入业原火"
+  },
+  {
+    "itemName": "s_fire_greed",
+    "imageName": "s_s_fire_greed.png",
+    "roiFront": "1133,641,21,33",
+    "roiBack": "1133,641,21,33",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "贪"
+  },
+  {
+    "itemName": "s_fire_anger",
+    "imageName": "s_s_fire_anger.png",
+    "roiFront": "1132,643,21,30",
+    "roiBack": "1132,643,21,30",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "s_fire_foolery",
+    "imageName": "s_s_fire_foolery.png",
+    "roiFront": "1130,642,22,31",
+    "roiBack": "1130,642,22,31",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "痴"
   }
   }
 ]
 ]

BIN
tasks/Sougenbi/s/s_s_fire_anger.png


BIN
tasks/Sougenbi/s/s_s_fire_foolery.png


BIN
tasks/Sougenbi/s/s_s_fire_greed.png


+ 5 - 5
tasks/Sougenbi/script_task.py

@@ -40,15 +40,15 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, SougenbiAssets):
         number_target = None
         number_target = None
         match con.sougenbi_config.sougenbi_class:
         match con.sougenbi_config.sougenbi_class:
             case SougenbiClass.GREED:
             case SougenbiClass.GREED:
-                image_target = self.I_S_GREED
+                image_target = self.I_S_FIRE_GREED
                 click_target = self.C_C_GREED
                 click_target = self.C_C_GREED
                 number_target = self.O_S_GREED
                 number_target = self.O_S_GREED
             case SougenbiClass.Anger:
             case SougenbiClass.Anger:
-                image_target = self.I_S_ANGER
+                image_target = self.I_S_FIRE_ANGER
                 click_target = self.C_C_ANGER
                 click_target = self.C_C_ANGER
                 number_target = self.O_S_ANGER
                 number_target = self.O_S_ANGER
             case SougenbiClass.Foolery:
             case SougenbiClass.Foolery:
-                image_target = self.I_S_FOOLERY
+                image_target = self.I_S_FIRE_FOOLERY
                 click_target = self.C_C_FOOLERY
                 click_target = self.C_C_FOOLERY
                 number_target = self.O_S_FOOLERY
                 number_target = self.O_S_FOOLERY
             case _:
             case _:
@@ -56,10 +56,10 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, SougenbiAssets):
         self.check_lock(con.general_battle_config.lock_team_enable, self.I_S_TEAM_LOCK, self.I_S_TEAM_UNLOCK)
         self.check_lock(con.general_battle_config.lock_team_enable, self.I_S_TEAM_LOCK, self.I_S_TEAM_UNLOCK)
         while 1:
         while 1:
             self.screenshot()
             self.screenshot()
+            if self.appear(image_target):
+                break
             if self.click(click_target, interval=0.5):
             if self.click(click_target, interval=0.5):
                 pass
                 pass
-            if self.appear(image_target, threshold=0.97):
-                break
 
 
         # 开始循环
         # 开始循环
         while 1:
         while 1: