Просмотр исходного кода

Merge pull request #1583 from LGG686/dev-s

fix(GeneralBattle): 添加未知结算弹窗处理
huangrunheng 5 месяцев назад
Родитель
Сommit
aa38d5e54a

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

@@ -98,7 +98,7 @@ class GeneralBattleAssets:
 	# 左下角的位置指针 
 	I_LOCAL = RuleImage(roi_front=(25,563,30,34), roi_back=(25,563,30,34), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_local.png")
 	# description 
-	I_STATISTICS = RuleImage(roi_front=(61,644,33,28), roi_back=(61,644,33,28), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_statistics.png")
+	I_STATISTICS = RuleImage(roi_front=(70,630,33,28), roi_back=(35,28,411,661), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_statistics.png")
 	# 左上角的退出 
 	I_EXIT = RuleImage(roi_front=(14,12,43,41), roi_back=(14,12,43,41), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_exit.png")
 	# 退出确认 
@@ -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/image.json

@@ -137,8 +137,8 @@
   {
     "itemName": "statistics",
     "imageName": "gb_statistics.png",
-    "roiFront": "61,644,33,28",
-    "roiBack": "61,644,33,28",
+    "roiFront": "70,630,33,28",
+    "roiBack": "35,28,411,661",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"

+ 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": "关闭御魂不一致提示弹窗"
   },
   {

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

@@ -237,6 +237,11 @@ class GeneralBattle(GeneralBuff, GeneralBattleAssets):
                 # self.appear_then_click(self.I_REWARD_SOUL_6, action=action_click, interval=1.5)
                 ):
                 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.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
                 # not self.appear(self.I_REWARD_STATISTICS) and

+ 2 - 2
tasks/Component/GeneralBuff/assets.py

@@ -26,9 +26,9 @@ class GeneralBuffAssets:
 	# description 
 	I_EXP_100 = RuleImage(roi_front=(383,406,30,40), roi_back=(368,126,58,386), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_exp_100.png")
 	# description 
-	I_OPEN_YELLOW = RuleImage(roi_front=(773,297,17,21), roi_back=(766,133,35,366), threshold=0.6, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_open_yellow.png")
+	I_OPEN_YELLOW = RuleImage(roi_front=(774,299,13,18), roi_back=(766,133,35,366), threshold=0.6, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_open_yellow.png")
 	# description 
-	I_CLOSE_RED = RuleImage(roi_front=(773,297,17,21), roi_back=(764,134,38,369), threshold=0.6, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_close_red.png")
+	I_CLOSE_RED = RuleImage(roi_front=(773,365,12,20), roi_back=(764,134,38,369), threshold=0.6, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_close_red.png")
 	# 用来判定是否点击的那个 
 	I_CLOUD = RuleImage(roi_front=(357,505,65,38), roi_back=(313,484,158,75), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBuff/gb/gb_cloud.png")
 

BIN
tasks/Component/GeneralBuff/gb/gb_close_red.png


BIN
tasks/Component/GeneralBuff/gb/gb_open_yellow.png


+ 2 - 2
tasks/Component/GeneralBuff/gb/image.json

@@ -65,7 +65,7 @@
   {
     "itemName": "open_yellow",
     "imageName": "gb_open_yellow.png",
-    "roiFront": "773,297,17,21",
+    "roiFront": "774,299,13,18",
     "roiBack": "766,133,35,366",
     "method": "Template matching",
     "threshold": 0.6,
@@ -74,7 +74,7 @@
   {
     "itemName": "close_red",
     "imageName": "gb_close_red.png",
-    "roiFront": "773,297,17,21",
+    "roiFront": "773,365,12,20",
     "roiBack": "764,134,38,369",
     "method": "Template matching",
     "threshold": 0.6,

+ 1 - 1
tasks/Component/ReplaceShikigami/replace_shikigami.py

@@ -52,7 +52,7 @@ class ReplaceShikigami(BaseTask, ReplaceShikigamiAssets):
             if self.appear(check_selected):
                 break
             if self.appear(check_click, interval=1):
-                if self.wait_until_pos_stable(check_click, stable_time=0.8, timeout=2.5):
+                if self.wait_until_pos_stable(check_click, stable_time=1.5, timeout=3.5):
                     self.click(check_click)
                 continue
             if self.click(self.C_SHIKIGAMI_SWITCH_1, interval=3.5):