Răsfoiți Sursa

fix(GeneralBattle): Add "Preset" button with number #740

huangrunheng 1 an în urmă
părinte
comite
67a474b42d

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

@@ -121,6 +121,8 @@ class GeneralBattleAssets:
 	I_GREEN_MARKER_LEFT_TOP = RuleImage(roi_front=(0,0,1280,720), roi_back=(0,0,1280,720), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_green_marker_left_top.png")
 	# 绿标-下半部分 
 	I_GREEN_MARKER_BOTTOM = RuleImage(roi_front=(0,0,1280,720), roi_back=(0,0,1280,720), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_green_marker_bottom.png")
+	# 新版本的预设图案带数字 
+	I_PRESET_WIT_NUMBER = RuleImage(roi_front=(40,655,37,37), roi_back=(9,636,100,74), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_preset_wit_number.png")
 
 
 	# Image Rule Assets

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


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

@@ -241,5 +241,14 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "绿标-下半部分"
+  },
+  {
+    "itemName": "preset_wit_number",
+    "imageName": "gb_preset_wit_number.png",
+    "roiFront": "40,655,37,37",
+    "roiBack": "9,636,100,74",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "新版本的预设图案带数字"
   }
 ]

+ 4 - 2
tasks/Component/GeneralBattle/general_battle.py

@@ -87,7 +87,7 @@ class GeneralBattle(GeneralBuff, GeneralBattleAssets):
                 self.screenshot()
                 if self.appear_then_click(self.I_PREPARE_HIGHLIGHT, interval=1.5):
                     continue
-                if not self.appear(self.I_PRESET):
+                if not (self.appear(self.I_PRESET) or self.appear(self.I_PRESET_WIT_NUMBER)):
                     break
             logger.info(f"Click {self.I_PREPARE_HIGHLIGHT.name}")
 
@@ -297,6 +297,8 @@ class GeneralBattle(GeneralBuff, GeneralBattleAssets):
                 break
             if self.appear_then_click(self.I_PRESET, threshold=0.8, interval=1):
                 continue
+            if self.appear_then_click(self.I_PRESET_WIT_NUMBER, threshold=0.8, interval=1):
+                continue
             if self.ocr_appear(self.O_PRESET):
                 self.click(self.O_PRESET, interval=1)
                 continue
@@ -417,7 +419,7 @@ class GeneralBattle(GeneralBuff, GeneralBattleAssets):
             return True
         elif self.appear(self.I_PREPARE_DARK):
             return True
-        elif self.appear(self.I_PRESET):
+        elif self.appear(self.I_PRESET) or self.appear(self.I_PRESET_WIT_NUMBER):
             return True
         else:
             return False