Эх сурвалжийг харах

feat(GeneralBattle): 添加御魂不一致提示弹窗处理功能

- 在assets.py中新增关闭御魂不一致提示和禁用7天的图像识别规则
- 在general_battle.py中添加弹窗检测和点击处理逻辑
Azur 9 сар өмнө
parent
commit
e8cca913cf

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

@@ -142,6 +142,10 @@ class GeneralBattleAssets:
 	I_GREED_GHOST = RuleImage(roi_front=(56,40,45,45), roi_back=(56,40,45,45), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_greed_ghost.png")
 	# 确认按钮 
 	I_CONFIRM = RuleImage(roi_front=(732,383,83,43), roi_back=(330,228,615,286), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_confirm.png")
+	# 关闭御魂不一致提示弹窗 
+	I_CONFIRM_CLOSE_DIFF_SOUL = RuleImage(roi_front=(571,404,135,54), roi_back=(517,374,226,112), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_confirm_close_diff_soul.png")
+	# 禁用御魂不一致提示7天 
+	I_DISABLE_7DAYS_DIFF_SOUL = RuleImage(roi_front=(547,342,27,36), roi_back=(524,325,70,71), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_disable_7days_diff_soul.png")
 
 
 	# Ocr Rule Assets

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


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


+ 18 - 0
tasks/Component/GeneralBattle/gb/img_supplement.json

@@ -16,5 +16,23 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "确认按钮"
+  },
+  {
+    "itemName": "confirm_close_diff_soul",
+    "imageName": "gb_confirm_close_diff_soul.png",
+    "roiFront": "571,404,135,54",
+    "roiBack": "517,374,226,112",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "关闭御魂不一致提示弹窗"
+  },
+  {
+    "itemName": "disable_7days_diff_soul",
+    "imageName": "gb_disable_7days_diff_soul.png",
+    "roiFront": "547,342,27,36",
+    "roiBack": "524,325,70,71",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "禁用御魂不一致提示7天"
   }
 ]

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

@@ -58,6 +58,10 @@ class GeneralBattle(GeneralBuff, GeneralBattleAssets):
             self.screenshot()
             if self.is_in_real_battle(False):  # 战斗阶段
                 return True
+            if self.appear_then_click(self.I_DISABLE_7DAYS_DIFF_SOUL, interval=0.6):  # 关闭御魂不一致提示
+                continue
+            if self.appear_then_click(self.I_CONFIRM_CLOSE_DIFF_SOUL, interval=0.6):  # 确认关闭御魂不一致提示
+                continue
             if self.is_in_prepare(False):  # 战斗准备阶段
                 if not getattr(config, 'lock_team_enable', False):  # 没有锁定阵容
                     if self.current_count == 1 and not confed:  # 第一次战斗且是本次第一次配置