Procházet zdrojové kódy

fix(task): DemonEncounter wait battle for result too long

runhey před 3 roky
rodič
revize
56e8b75a3c

+ 1 - 0
tasks/CollectiveMissions/script_task.py

@@ -225,6 +225,7 @@ class ScriptTask(GameUi, CollectiveMissionsAssets):
                 continue
                 continue
             if self.appear_then_click(self.I_CM_PRESENT, interval=1):
             if self.appear_then_click(self.I_CM_PRESENT, interval=1):
                 continue
                 continue
+        self.ui_reward_appear_click(True)
         logger.info('Donate finished')
         logger.info('Donate finished')
         return True
         return True
 
 

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

@@ -108,9 +108,11 @@ class GeneralBattleAssets:
 	# 结算金币 
 	# 结算金币 
 	I_REWARD_GOLD = RuleImage(roi_front=(943,312,97,69), roi_back=(943,312,97,69), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold.png")
 	I_REWARD_GOLD = RuleImage(roi_front=(943,312,97,69), roi_back=(943,312,97,69), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_reward_gold.png")
 	# 针对封魔的特殊 
 	# 针对封魔的特殊 
-	I_DE_WIN = RuleImage(roi_front=(472,49,100,100), roi_back=(447,36,191,133), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_de_win.png")
+	I_DE_WIN = RuleImage(roi_front=(472,49,100,100), roi_back=(239,36,399,133), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_de_win.png")
 	# description 
 	# description 
 	I_PRESENT_LESS_THAN_5 = RuleImage(roi_front=(222,648,418,43), roi_back=(222,648,418,43), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_present_less_than_5.png")
 	I_PRESENT_LESS_THAN_5 = RuleImage(roi_front=(222,648,418,43), roi_back=(222,648,418,43), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_present_less_than_5.png")
+	# 封魔的金币 
+	I_DE_GOLD = RuleImage(roi_front=(61,52,30,25), roi_back=(45,33,65,64), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_de_gold.png")
 
 
 
 
 	# Image Rule Assets
 	# Image Rule Assets

binární
tasks/Component/GeneralBattle/gb/gb_de_gold.png


+ 10 - 1
tasks/Component/GeneralBattle/gb/image.json

@@ -192,7 +192,7 @@
     "itemName": "de_win",
     "itemName": "de_win",
     "imageName": "gb_de_win.png",
     "imageName": "gb_de_win.png",
     "roiFront": "472,49,100,100",
     "roiFront": "472,49,100,100",
-    "roiBack": "447,36,191,133",
+    "roiBack": "239,36,399,133",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "针对封魔的特殊"
     "description": "针对封魔的特殊"
@@ -205,5 +205,14 @@
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "description"
     "description": "description"
+  },
+  {
+    "itemName": "de_gold",
+    "imageName": "gb_de_gold.png",
+    "roiFront": "61,52,30,25",
+    "roiBack": "45,33,65,64",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "封魔的金币"
   }
   }
 ]
 ]

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

@@ -169,6 +169,8 @@ class GeneralBattle(GeneralBuff, GeneralBattleAssets):
             # 如果出现赢 就点击, 第二个是针对封魔的图片
             # 如果出现赢 就点击, 第二个是针对封魔的图片
             if self.appear(self.I_WIN, threshold=0.8) or self.appear(self.I_DE_WIN):
             if self.appear(self.I_WIN, threshold=0.8) or self.appear(self.I_DE_WIN):
                 logger.info("Battle result is win")
                 logger.info("Battle result is win")
+                if self.appear(self.I_DE_WIN):
+                    self.ui_click_until_disappear(self.I_DE_WIN)
                 win = True
                 win = True
                 break
                 break