Browse Source

fix(GeneralBattle): 调整确认按钮的图像识别参数并添加进弹窗处理

- 调整 I_CONFIRM_CLOSE_DIFF_SOUL 的 roi_back 区域为更大范围 (508,372,255,161)
- 降低识别阈值从 0.8 到 0.7 以提高识别成功率
- 在结算流程中添加对整个皮肤弹窗的自动关闭处理
- 更新 img_supplement.json 中对应资源配置
yuyuyuyuyu 5 months ago
parent
commit
8a4b86b7ad

+ 1 - 1
tasks/Component/GeneralBattle/assets.py

@@ -143,7 +143,7 @@ class GeneralBattleAssets:
 	# 确认按钮 
 	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")
+	I_CONFIRM_CLOSE_DIFF_SOUL = RuleImage(roi_front=(571,404,135,54), roi_back=(508,372,255,161), threshold=0.7, 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")
 

+ 2 - 2
tasks/Component/GeneralBattle/gb/img_supplement.json

@@ -21,9 +21,9 @@
     "itemName": "confirm_close_diff_soul",
     "imageName": "gb_confirm_close_diff_soul.png",
     "roiFront": "571,404,135,54",
-    "roiBack": "517,374,226,112",
+    "roiBack": "508,372,255,161",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.7,
     "description": "关闭御魂不一致提示弹窗"
   },
   {

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

@@ -239,7 +239,8 @@ class GeneralBattle(GeneralBuff, GeneralBattleAssets):
                 continue
             # 未知结算弹窗(皮肤碎片等):点一下空白区域尝试跳过
             if self.appear(self.I_STATISTICS) and not self.appear(self.I_REWARD)and not self.appear(self.I_WIN):
-                self.click(self.C_RANDOM_CLICK)
+                self.click(self.C_RANDOM_CLICK)  #碎片
+                self.appear_then_click(self.I_CONFIRM_CLOSE_DIFF_SOUL) #整个皮肤
                 continue
             if (not self.appear(self.I_REWARD) and
                 not self.appear(self.I_REWARD_GOLD)#  and