Bladeren bron

fix(task): Gold Youkai in version 66

runhey 3 jaren geleden
bovenliggende
commit
a6f49956f8

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

@@ -80,7 +80,7 @@ class GeneralBattleAssets:
 	# 确认预设的队伍 
 	I_PRESET_ENSURE = RuleImage(roi_front=(354,641,141,50), roi_back=(354,641,141,50), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_preset_ensure.png")
 	# 选择buff 
-	I_BUFF = RuleImage(roi_front=(113,653,44,62), roi_back=(113,653,44,62), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_buff.png")
+	I_BUFF = RuleImage(roi_front=(115,657,42,50), roi_back=(106,641,67,77), threshold=0.7, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_buff.png")
 	# 觉醒加成 
 	I_BUFF_AWAKEN = RuleImage(roi_front=(373,126,383,53), roi_back=(373,126,383,53), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_buff_awaken.png")
 	# 御魂加成 
@@ -108,7 +108,7 @@ 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_DE_WIN = RuleImage(roi_front=(481,47,100,100), roi_back=(481,47,100,100), 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=(447,36,191,133), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_de_win.png")
 	# 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")
 

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


+ 5 - 5
tasks/Component/GeneralBattle/gb/image.json

@@ -65,10 +65,10 @@
   {
     "itemName": "buff",
     "imageName": "gb_buff.png",
-    "roiFront": "113,653,44,62",
-    "roiBack": "113,653,44,62",
+    "roiFront": "115,657,42,50",
+    "roiBack": "106,641,67,77",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.7,
     "description": "选择buff"
   },
   {
@@ -191,8 +191,8 @@
   {
     "itemName": "de_win",
     "imageName": "gb_de_win.png",
-    "roiFront": "481,47,100,100",
-    "roiBack": "481,47,100,100",
+    "roiFront": "472,49,100,100",
+    "roiBack": "447,36,191,133",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "针对封魔的特殊"

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

@@ -45,12 +45,13 @@ class GeneralBattle(GeneralBuff, GeneralBattleAssets):
 
             # 点击准备按钮
             self.wait_until_appear(self.I_PREPARE_HIGHLIGHT)
+            self.wait_until_appear(self.I_BUFF)
             while 1:
                 self.screenshot()
-                if self.appear_then_click(self.I_PREPARE_HIGHLIGHT, interval=1.5):
-                    continue
                 if not self.appear(self.I_BUFF):
                     break
+                if self.appear_then_click(self.I_PREPARE_HIGHLIGHT, interval=1.5):
+                    continue
             logger.info("Click prepare ensure button")
 
             # 照顾一下某些模拟器慢的

+ 6 - 1
tasks/GoldYoukai/assets.py

@@ -8,5 +8,10 @@ from module.atom.list import RuleList
 # This file was automatically generated by ./dev_tools/assets_extract.py.
 # Don't modify it manually.
 class GoldYoukaiAssets: 
-	pass
+
+
+	# Image Rule Assets
+	# 金币妖怪的赢 
+	I_GOLD_WIN = RuleImage(roi_front=(380,44,100,100), roi_back=(380,44,100,100), threshold=0.8, method="Template matching", file="./tasks/GoldYoukai/gy/gy_gold_win.png")
+
 

BIN
tasks/GoldYoukai/gy/gy_gold_win.png


+ 11 - 0
tasks/GoldYoukai/gy/image.json

@@ -0,0 +1,11 @@
+[
+  {
+    "itemName": "gold_win",
+    "imageName": "gy_gold_win.png",
+    "roiFront": "380,44,100,100",
+    "roiBack": "380,44,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "金币妖怪的赢"
+  }
+]

+ 4 - 0
tasks/GoldYoukai/script_task.py

@@ -86,6 +86,10 @@ class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul,
                 logger.info('Win battle')
                 self.ui_click_until_disappear(self.I_DE_WIN)
                 return True
+            if self.appear(self.I_GOLD_WIN):
+                logger.info('Win battle')
+                self.ui_click_until_disappear(self.I_GOLD_WIN)
+                return True
 
             if self.appear(self.I_FALSE):
                 logger.warning('False battle')