runhey 3 лет назад
Родитель
Сommit
8ab2bec7cc

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

@@ -117,7 +117,7 @@ class GeneralBattleAssets:
 
 	# Image Rule Assets
 	# description 
-	I_GREED_GHOST = RuleImage(roi_front=(49,29,56,65), roi_back=(49,29,56,65), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_greed_ghost.png")
+	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")
 
 
 	# Swipe Rule Assets

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


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

@@ -2,8 +2,8 @@
   {
     "itemName": "greed_ghost",
     "imageName": "gb_greed_ghost.png",
-    "roiFront": "49,29,56,65",
-    "roiBack": "49,29,56,65",
+    "roiFront": "56,40,45,45",
+    "roiBack": "56,40,45,45",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"

+ 2 - 3
tasks/Orochi/assets.py

@@ -16,12 +16,11 @@ class OrochiAssets:
 	# 组队 
 	I_FORM_TEAM = RuleImage(roi_front=(937,591,100,100), roi_back=(937,591,100,100), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_form_team.png")
 	# description 
-	I_OROCHI_LOCK = RuleImage(roi_front=(573,559,31,32), roi_back=(548,554,65,54), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_orochi_lock.png")
+	I_OROCHI_LOCK = RuleImage(roi_front=(557,563,31,32), roi_back=(548,554,101,54), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_orochi_lock.png")
 	# description 
-	I_OROCHI_UNLOCK = RuleImage(roi_front=(575,558,26,29), roi_back=(560,553,56,40), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_orochi_unlock.png")
+	I_OROCHI_UNLOCK = RuleImage(roi_front=(562,564,26,29), roi_back=(550,553,100,51), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_orochi_unlock.png")
 	# 点击挑战 
 	I_OROCHI_FIRE = RuleImage(roi_front=(1095,577,131,124), roi_back=(1095,577,131,124), threshold=0.6, method="Template matching", file="./tasks/Orochi/o/o_orochi_fire.png")
-	I_OROCHI_WILD_FIRE = RuleImage(roi_front=(1179,602,81,87), roi_back=(1179,602,81,87), threshold=0.6, method="Template matching", file="./tasks/Orochi/o/o_orochi_wild_fire.png")
 	# 式神录 
 	I_SHI_RECORDS = RuleImage(roi_front=(821,638,48,45), roi_back=(821,638,48,45), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_shi_records.png")
 	# description 

+ 38 - 7
tasks/Orochi/script_task.py

@@ -1,6 +1,7 @@
 # This Python file uses the following encoding: utf-8
 # @author runhey
 # github https://github.com/runhey
+import random
 from time import sleep
 from datetime import time, datetime, timedelta
 
@@ -121,11 +122,6 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
 
 
 
-
-
-
-
-
     def run_leader(self):
         logger.info('Start run leader')
         self.ui_get_current_page()
@@ -326,8 +322,6 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
         self.ui_current = page_soul_zones
         self.ui_goto(page_main)
 
-
-
     def run_wild(self):
         logger.info('Start run wild')
 
@@ -416,7 +410,44 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
         return True
 
 
+    def battle_wait(self, random_click_swipt_enable: bool) -> bool:
+        """
+        重写战斗等待
+        :param random_click_swipt_enable:
+        :return:
+        """
+        # 重写
+        self.device.stuck_record_add('BATTLE_STATUS_S')
+        self.device.click_record_clear()
+        # 战斗过程 随机点击和滑动 防封
+        logger.info("Start battle process")
+        while 1:
+            self.screenshot()
+            action_click = random.choice([self.C_WIN_1, self.C_WIN_2, self.C_WIN_3])
+            if self.appear_then_click(self.I_WIN, action=action_click ,interval=0.8):
+                # 赢的那个鼓
+                continue
+            if self.appear(self.I_GREED_GHOST):
+                # 贪吃鬼
+                logger.info('Win battle')
+                self.wait_until_appear(self.I_REWARD, wait_time=1.5)
+                while 1:
+                    self.screenshot()
+                    action_click = random.choice([self.C_REWARD_1, self.C_REWARD_2, self.C_REWARD_3])
+                    if self.appear_then_click(self.I_GREED_GHOST, action=action_click, interval=1.5):
+                        continue
+                    if not self.appear(self.I_GREED_GHOST):
+                        break
+                return True
+
+            if self.appear(self.I_FALSE):
+                logger.warning('False battle')
+                self.ui_click_until_disappear(self.I_FALSE)
+                return False
 
+            # 如果开启战斗过程随机滑动
+            if random_click_swipt_enable:
+                self.random_click_swipt()
 
 
 

+ 1 - 1
tasks/RealmRaid/assets.py

@@ -24,7 +24,7 @@ class RealmRaidAssets:
 	# description 
 	I_MEDAL_1 = RuleImage(roi_front=(570,206,199,52), roi_back=(237,198,892,336), threshold=0.8, method="Template matching", file="./tasks/RealmRaid/res/res_medal_1.png")
 	# 没有勋章的 
-	I_MEDAL_0 = RuleImage(roi_front=(510,336,202,51), roi_back=(231,200,898,336), threshold=0.8, method="Template matching", file="./tasks/RealmRaid/res/res_medal_0.png")
+	I_MEDAL_0 = RuleImage(roi_front=(536,336,176,51), roi_back=(231,200,898,336), threshold=0.8, method="Template matching", file="./tasks/RealmRaid/res/res_medal_0.png")
 	# 右上角红色的关闭 
 	I_BACK_RED = RuleImage(roi_front=(1178,101,57,64), roi_back=(1178,101,57,64), threshold=0.7, method="Template matching", file="./tasks/RealmRaid/res/res_back_red.png")
 	# 没有锁的状态图标