Ver código fonte

feat(tasks): Update MetaDemon

ryland 1 ano atrás
pai
commit
9f7fccb0f1

+ 3 - 1
assets/i18n/zh-CN.json

@@ -1,5 +1,7 @@
 {
 {
-  "boss_limit_time": "单局Boss限制时间"
+  "boss_limit_time": "单局Boss限制时间",
+  "kirin_battle_config": "麒麟战斗配置",
+  "netherworld_battle_config": "阴界之门战斗配置"
 }
 }
 
 
 
 

+ 3 - 3
dev_tools/assets_test.py

@@ -34,10 +34,10 @@ def detect_ocr(file: str, target: RuleOcr):
 
 
 
 
 # 图片文件路径 可以是相对路径
 # 图片文件路径 可以是相对路径
-IMAGE_FILE = r"C:\Users\Ryland\Desktop\QQ20251014-103056.png"
+IMAGE_FILE = r"C:\Users\Ryland\Desktop\ScreenShot_2025-11-20_175902_458.png"
 if __name__ == '__main__':
 if __name__ == '__main__':
-    from tasks.KekkaiActivation.script_task import ScriptTask
-    targe = ScriptTask.I_UI_CONFIRM_SAMLL
+    from tasks.MetaDemon.script_task import ScriptTask
+    targe = ScriptTask.I_FIND_DEMON
     print(detect_image(IMAGE_FILE, targe))
     print(detect_image(IMAGE_FILE, targe))
 
 
     # ocr demo
     # ocr demo

+ 0 - 1
tasks/Component/RightActivity/right_activity.py

@@ -24,4 +24,3 @@ class RightActivity(GameUi, RightActivityAssets):
     def right_close(self):
     def right_close(self):
         self.ui_click(self.I_RA_OPEN, self.I_RA_CLOSE, interval=2)
         self.ui_click(self.I_RA_OPEN, self.I_RA_CLOSE, interval=2)
 
 
-

+ 2 - 0
tasks/GlobalGame/assets.py

@@ -61,5 +61,7 @@ class GlobalGameAssets:
 	I_UI_UNCHECK = RuleImage(roi_front=(567,343,33,36), roi_back=(497,303,216,100), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_uncheck.png")
 	I_UI_UNCHECK = RuleImage(roi_front=(567,343,33,36), roi_back=(497,303,216,100), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_uncheck.png")
 	# 勾选 
 	# 勾选 
 	I_UI_CHECK = RuleImage(roi_front=(564,341,40,38), roi_back=(512,329,164,78), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_check.png")
 	I_UI_CHECK = RuleImage(roi_front=(564,341,40,38), roi_back=(512,329,164,78), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_check.png")
+	# 知道了 
+	I_UI_GOTIT_SMALL = RuleImage(roi_front=(678,396,127,60), roi_back=(622,371,242,100), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_gotit_small.png")
 
 
 
 

+ 9 - 0
tasks/GlobalGame/ui/image.json

@@ -97,5 +97,14 @@
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "勾选"
     "description": "勾选"
+  },
+  {
+    "itemName": "ui_gotit_small",
+    "imageName": "ui_ui_gotit_small.png",
+    "roiFront": "678,396,127,60",
+    "roiBack": "622,371,242,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "知道了"
   }
   }
 ]
 ]

BIN
tasks/GlobalGame/ui/ui_ui_gotit_small.png


+ 30 - 1
tasks/MetaDemon/assets.py

@@ -47,12 +47,41 @@ class MetaDemonAssets:
 	I_RED_BACK = RuleImage(roi_front=(925,181,47,48), roi_back=(925,181,47,48), threshold=0.8, method="Template matching", file="./tasks/MetaDemon/md/md_red_back.png")
 	I_RED_BACK = RuleImage(roi_front=(925,181,47,48), roi_back=(925,181,47,48), threshold=0.8, method="Template matching", file="./tasks/MetaDemon/md/md_red_back.png")
 
 
 
 
+	# Image Rule Assets
+	# 右侧进去 
+	I_RIGHT_ENTER = RuleImage(roi_front=(1183,314,46,42), roi_back=(1150,131,100,360), threshold=0.75, method="Template matching", file="./tasks/MetaDemon/md/md_right_enter.png")
+	# description 
+	I_ENTER2 = RuleImage(roi_front=(461,265,44,156), roi_back=(428,220,100,258), threshold=0.8, method="Template matching", file="./tasks/MetaDemon/md/md_enter2.png")
+	# 寻找鬼王 
+	I_FIND_DEMON = RuleImage(roi_front=(1140,582,86,81), roi_back=(1102,546,132,133), threshold=0.8, method="Template matching", file="./tasks/MetaDemon/md/md_find_demon.png")
+	# 点击战斗 
+	I_BATTLE_DEMON = RuleImage(roi_front=(1131,573,100,100), roi_back=(1085,536,165,161), threshold=0.7, method="Template matching", file="./tasks/MetaDemon/md/md_battle_demon.png")
+	# description 
+	I_BOSS_EMPTY = RuleImage(roi_front=(44,134,88,85), roi_back=(44,134,88,85), threshold=0.8, method="Template matching", file="./tasks/MetaDemon/md/md_boss_empty.png")
+	# description 
+	I_BOSS_EMPTY_1 = RuleImage(roi_front=(46,372,87,90), roi_back=(46,372,87,90), threshold=0.8, method="Template matching", file="./tasks/MetaDemon/md/md_boss_empty_1.png")
+	# description 
+	I_BOSS_EMPTY_2 = RuleImage(roi_front=(46,501,88,88), roi_back=(46,501,88,88), threshold=0.8, method="Template matching", file="./tasks/MetaDemon/md/md_boss_empty_2.png")
+	# 合成 
+	I_CRAFTING_1 = RuleImage(roi_front=(1202,222,36,45), roi_back=(1167,199,100,100), threshold=0.8, method="Template matching", file="./tasks/MetaDemon/md/md_crafting_1.png")
+	# 空 
+	I_CRAFTING_EMPTY = RuleImage(roi_front=(939,460,75,81), roi_back=(922,447,108,111), threshold=0.8, method="Template matching", file="./tasks/MetaDemon/md/md_crafting_empty.png")
+	# 一星卡片 
+	I_CRAFTING_CARD_STAR_1 = RuleImage(roi_front=(217,156,87,92), roi_back=(191,127,140,137), threshold=0.8, method="Template matching", file="./tasks/MetaDemon/md/md_crafting_card_star_1.png")
+	# 开始合成 
+	I_CRAFTING_START = RuleImage(roi_front=(889,561,140,39), roi_back=(840,521,231,100), threshold=0.75, method="Template matching", file="./tasks/MetaDemon/md/md_crafting_start.png")
+	# description 
+	I_CRAFTING_EMPTY_NEW = RuleImage(roi_front=(787,307,100,100), roi_back=(772,299,128,117), threshold=0.8, method="Template matching", file="./tasks/MetaDemon/md/md_crafting_empty_new.png")
+
+
 	# Ocr Rule Assets
 	# Ocr Rule Assets
 	# Ocr-description 
 	# Ocr-description 
-	O_MD_EXHAUSTION = RuleOcr(roi=(1096,18,89,31), area=(1096,18,89,31), mode="DigitCounter", method="Default", keyword="", name="md_exhaustion")
+	O_MD_EXHAUSTION = RuleOcr(roi=(1114,24,94,31), area=(1114,24,94,31), mode="DigitCounter", method="Default", keyword="", name="md_exhaustion")
 	# Ocr-description 
 	# Ocr-description 
 	O_MD_TICKET = RuleOcr(roi=(923,18,82,30), area=(923,18,82,30), mode="DigitCounter", method="Default", keyword="", name="md_ticket")
 	O_MD_TICKET = RuleOcr(roi=(923,18,82,30), area=(923,18,82,30), mode="DigitCounter", method="Default", keyword="", name="md_ticket")
 	# Ocr-description 
 	# Ocr-description 
 	O_MD_COUNT_INFO = RuleOcr(roi=(94,314,161,37), area=(94,314,161,37), mode="Single", method="Default", keyword="击败奖励结算中", name="md_count_info")
 	O_MD_COUNT_INFO = RuleOcr(roi=(94,314,161,37), area=(94,314,161,37), mode="Single", method="Default", keyword="击败奖励结算中", name="md_count_info")
+	# 一星卡 
+	O_CRAFTING_CARD_1 = RuleOcr(roi=(303,158,161,33), area=(303,158,161,33), mode="Single", method="Default", keyword="一星梦告铃鼓", name="crafting_card_1")
 
 
 
 

+ 1 - 0
tasks/MetaDemon/config.py

@@ -11,6 +11,7 @@ from tasks.Component.SwitchSoul.switch_soul_config import SwitchSoulConfig
 
 
 
 
 class MetaDemonConfig(ConfigBase):
 class MetaDemonConfig(ConfigBase):
+    meta_crafting_card: bool = Field(default=True, description='craft_essence_help')
     auto_tea: bool = Field(default=False, description='auto_tea_help')
     auto_tea: bool = Field(default=False, description='auto_tea_help')
     extreme_notify: bool = Field(default=False, description='extreme_notify_help')
     extreme_notify: bool = Field(default=False, description='extreme_notify_help')
 
 

+ 110 - 0
tasks/MetaDemon/md/image_2025.json

@@ -0,0 +1,110 @@
+[
+  {
+    "itemName": "right_enter",
+    "imageName": "md_right_enter.png",
+    "roiFront": "1183,314,46,42",
+    "roiBack": "1150,131,100,360",
+    "method": "Template matching",
+    "threshold": 0.75,
+    "description": "右侧进去"
+  },
+  {
+    "itemName": "enter2",
+    "imageName": "md_enter2.png",
+    "roiFront": "461,265,44,156",
+    "roiBack": "428,220,100,258",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "find_demon",
+    "imageName": "md_find_demon.png",
+    "roiFront": "1140,582,86,81",
+    "roiBack": "1102,546,132,133",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "寻找鬼王"
+  },
+  {
+    "itemName": "battle_demon",
+    "imageName": "md_battle_demon.png",
+    "roiFront": "1131,573,100,100",
+    "roiBack": "1085,536,165,161",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "点击战斗"
+  },
+  {
+    "itemName": "boss_empty",
+    "imageName": "md_boss_empty.png",
+    "roiFront": "44,134,88,85",
+    "roiBack": "44,134,88,85",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "boss_empty_1",
+    "imageName": "md_boss_empty_1.png",
+    "roiFront": "46,372,87,90",
+    "roiBack": "46,372,87,90",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "boss_empty_2",
+    "imageName": "md_boss_empty_2.png",
+    "roiFront": "46,501,88,88",
+    "roiBack": "46,501,88,88",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "crafting_1",
+    "imageName": "md_crafting_1.png",
+    "roiFront": "1202,222,36,45",
+    "roiBack": "1167,199,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "合成"
+  },
+  {
+    "itemName": "crafting_empty",
+    "imageName": "md_crafting_empty.png",
+    "roiFront": "939,460,75,81",
+    "roiBack": "922,447,108,111",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "空"
+  },
+  {
+    "itemName": "crafting_card_star_1",
+    "imageName": "md_crafting_card_star_1.png",
+    "roiFront": "217,156,87,92",
+    "roiBack": "191,127,140,137",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "一星卡片"
+  },
+  {
+    "itemName": "crafting_start",
+    "imageName": "md_crafting_start.png",
+    "roiFront": "889,561,140,39",
+    "roiBack": "840,521,231,100",
+    "method": "Template matching",
+    "threshold": 0.75,
+    "description": "开始合成"
+  },
+  {
+    "itemName": "crafting_empty_new",
+    "imageName": "md_crafting_empty_new.png",
+    "roiFront": "787,307,100,100",
+    "roiBack": "772,299,128,117",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/MetaDemon/md/md_battle_demon.png


BIN
tasks/MetaDemon/md/md_boss_empty.png


BIN
tasks/MetaDemon/md/md_boss_empty_1.png


BIN
tasks/MetaDemon/md/md_boss_empty_2.png


BIN
tasks/MetaDemon/md/md_crafting_1.png


BIN
tasks/MetaDemon/md/md_crafting_card_star_1.png


BIN
tasks/MetaDemon/md/md_crafting_empty.png


BIN
tasks/MetaDemon/md/md_crafting_empty_new.png


BIN
tasks/MetaDemon/md/md_crafting_start.png


BIN
tasks/MetaDemon/md/md_enter2.png


BIN
tasks/MetaDemon/md/md_find_demon.png


BIN
tasks/MetaDemon/md/md_right_enter.png


+ 11 - 2
tasks/MetaDemon/md/ocr.json

@@ -1,8 +1,8 @@
 [
 [
   {
   {
     "itemName": "md_exhaustion",
     "itemName": "md_exhaustion",
-    "roiFront": "1096,18,89,31",
-    "roiBack": "1096,18,89,31",
+    "roiFront": "1114,24,94,31",
+    "roiBack": "1114,24,94,31",
     "mode": "DigitCounter",
     "mode": "DigitCounter",
     "method": "Default",
     "method": "Default",
     "keyword": "",
     "keyword": "",
@@ -25,5 +25,14 @@
     "method": "Default",
     "method": "Default",
     "keyword": "击败奖励结算中",
     "keyword": "击败奖励结算中",
     "description": "Ocr-description"
     "description": "Ocr-description"
+  },
+  {
+    "itemName": "crafting_card_1",
+    "roiFront": "303,158,161,33",
+    "roiBack": "303,158,161,33",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "一星梦告铃鼓",
+    "description": "一星卡"
   }
   }
 ]
 ]

+ 106 - 77
tasks/MetaDemon/script_task.py

@@ -5,7 +5,13 @@ from cached_property import cached_property
 from datetime import datetime
 from datetime import datetime
 from time import sleep
 from time import sleep
 
 
-from tasks.Component.config_base import ConfigBase, TimeDelta, DateTime, Time
+
+from module.base.timer import Timer
+from module.logger import logger
+from module.exception import TaskEnd
+
+
+from tasks.Component.RightActivity.right_activity import RightActivity
 from tasks.Component.GeneralBattle.general_battle import GeneralBattle
 from tasks.Component.GeneralBattle.general_battle import GeneralBattle
 from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
 from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
 from tasks.Component.SwitchSoul.switch_soul import SwitchSoul
 from tasks.Component.SwitchSoul.switch_soul import SwitchSoul
@@ -13,21 +19,13 @@ from tasks.GameUi.game_ui import GameUi
 from tasks.GameUi.page import page_main, page_shikigami_records
 from tasks.GameUi.page import page_main, page_shikigami_records
 from tasks.MetaDemon.config import MetaDemon
 from tasks.MetaDemon.config import MetaDemon
 from tasks.MetaDemon.assets import MetaDemonAssets
 from tasks.MetaDemon.assets import MetaDemonAssets
-
-from module.logger import logger
-from module.exception import TaskEnd
 from tasks.Restart.assets import RestartAssets
 from tasks.Restart.assets import RestartAssets
 from tasks.ActivityShikigami.assets import ActivityShikigamiAssets
 from tasks.ActivityShikigami.assets import ActivityShikigamiAssets
-from module.base.timer import Timer
 
 
-"""超鬼王"""
 
 
-
-class ScriptTask(GeneralBattle, SwitchSoul, GameUi, MetaDemonAssets):
+class ScriptTask(RightActivity, GeneralBattle, SwitchSoul, GameUi, MetaDemonAssets):
 
 
     def run(self):
     def run(self):
-
-
         if self.config.meta_demon.switch_soul.enable:
         if self.config.meta_demon.switch_soul.enable:
             self.ui_get_current_page()
             self.ui_get_current_page()
             self.ui_goto(page_shikigami_records)
             self.ui_goto(page_shikigami_records)
@@ -38,96 +36,125 @@ class ScriptTask(GeneralBattle, SwitchSoul, GameUi, MetaDemonAssets):
             self.ui_goto(page_shikigami_records)
             self.ui_goto(page_shikigami_records)
             self.run_switch_soul_by_name(self.config.meta_demon.switch_soul.group_name,
             self.run_switch_soul_by_name(self.config.meta_demon.switch_soul.group_name,
                                          self.config.meta_demon.switch_soul.team_name)
                                          self.config.meta_demon.switch_soul.team_name)
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
 
 
-        boss_timer = Timer(200)
-        boss_timer.start()
+        self.enter(self.I_RIGHT_ENTER)
         while 1:
         while 1:
             self.screenshot()
             self.screenshot()
-            sleep(0.1)
-            if boss_timer.reached():
-                self.config.notifier.push(title='超鬼王', message='识别超时退出')
-                break
-            if self.appear(self.I_BACK_CHECK):
-                self.click(self.I_RED_BACK, interval=1.5)
+            if self.appear(self.I_FIND_DEMON) or self.appear(self.I_BATTLE_DEMON):
                 break
                 break
-            if self.appear_then_click(RestartAssets.I_HARVEST_CHAT_CLOSE):
-                boss_timer.reset()
-                continue
-            if self.appear_then_click(ActivityShikigamiAssets.I_SHI, interval=1):
-                boss_timer.reset()
-                continue
-            if self.appear_then_click(self.I_A2):
-                boss_timer.reset()
-                continue
-            if self.appear_then_click(self.I_A3, interval=1):
-                boss_timer.reset()
+            if self.appear_then_click(self.I_ENTER2, interval=1):
                 continue
                 continue
-            if self.appear_then_click(self.I_A4, interval=1):
-                boss_timer.reset()
+        if self.config.meta_demon.meta_demon_config.meta_crafting_card:
+            self.crafting()
+
+        boss_timer = Timer(120)
+        boss_timer.start()
+        while 1:
+            battle_processing = False
+            self.screenshot()
+            if not (self.appear(self.I_FIND_DEMON) or self.appear(self.I_BATTLE_DEMON)):
                 continue
                 continue
-            if self.appear_then_click(self.I_A5, interval=1):
-                self.device.stuck_record_clear()
-                self.device.stuck_record_add('BATTLE_STATUS_S')
+
+            # 先看自己有没有鬼王要打
+            if not self.appear(self.I_BOSS_EMPTY):
+                self.click(self.I_BOSS_EMPTY, interval=1.5)
+                battle_processing = True
+            # 看别人的是否给我共享鬼王
+            if not battle_processing:
+                if not self.appear(self.I_BOSS_EMPTY_1):
+                    self.click(self.I_BOSS_EMPTY_1, interval=1.5)
+                    battle_processing = True
+                elif not self.appear(self.I_BOSS_EMPTY_2):
+                    self.click(self.I_BOSS_EMPTY_2, interval=1.5)
+                    battle_processing = True
+            # 是否喝茶 疲劳满了就不打了
+            current_exhaustion = self.current_exhaustion()
+            if current_exhaustion > 99:
+                if self.config.meta_demon.meta_demon_config.auto_tea:
+                    logger.info('Exhaustion is full, buy tea')
+                    boss_timer.reset()
+                    self.buy_tea()
+                else:
+                    logger.info('Exhaustion is full, exit')
+                    break
+            # 正式战斗
+            if battle_processing and self.appear(self.I_BATTLE_DEMON):
                 boss_timer.reset()
                 boss_timer.reset()
+                self.battle_boss()
                 continue
                 continue
-            if self.appear_then_click(self.I_A6, interval=1):
+
+            # 自己召唤鬼王
+            if self.find_demon():
                 boss_timer.reset()
                 boss_timer.reset()
                 continue
                 continue
 
 
-        config: MetaDemon = self.config.model.meta_demon
-        # 主循环
-        while 1:
-            self.screenshot()
-            if self.appear(self.I_CHECK_MAIN):
-                logger.info('Exit MetaDemon')
-                break
-            if self.appear_then_click(self.I_UI_BACK_YELLOW, interval=1):
-                continue
+        # 退出
+        self.ui_click(self.I_UI_BACK_YELLOW, self.I_CHECK_MAIN, interval=1.4)
+        logger.info('Exit MetaDemon')
         self.set_next_run(task="MetaDemon", success=True)
         self.set_next_run(task="MetaDemon", success=True)
         raise TaskEnd
         raise TaskEnd
 
 
-    @cached_property
-    def battle_config(self):
-        config = GeneralBattleConfig()
-        config.lock_team_enable = False
-        return config
-
-    def ensure_ticket(self, screenshot: bool = False) -> bool:
-        if screenshot:
-            self.screenshot()
-        cu, res, total = self.O_MD_TICKET.ocr(self.device.image)
-        if cu <= 0:
-            return False
-        return True
-
-    def check_exhaustion(self, screenshot: bool = False) -> bool:
-        # EXHAUSTION
-        if screenshot:
-            self.screenshot()
-        cu, res, total = self.O_MD_EXHAUSTION.ocr(self.device.image)
-        if cu >= 100:
-            return False
-        return True
-
     def current_exhaustion(self) -> int:
     def current_exhaustion(self) -> int:
         self.screenshot()
         self.screenshot()
         cu, res, total = self.O_MD_EXHAUSTION.ocr(self.device.image)
         cu, res, total = self.O_MD_EXHAUSTION.ocr(self.device.image)
         return int(cu)
         return int(cu)
 
 
-    def click_fire(self):
+    def buy_tea(self):
+        pass
+
+    def crafting(self):
+        """
+        把一星合成二星
+        @return:
+        """
+        logger.info('Star crafting 1 star to 2 star')
+        self.ui_click(self.I_CRAFTING_1, self.I_CRAFTING_START, interval=1.5)
+        timer = Timer(3).start()
+        count = 0
         while 1:
         while 1:
             self.screenshot()
             self.screenshot()
-            if not self.appear(self.I_MD_FIRE):
-                self.screenshot()
-                if not self.appear(self.I_MD_FIRE):
-                    break
-            if self.appear_then_click(self.I_MD_FIRE, interval=2):
+            if self.ui_reward_appear_click():
+                timer.reset()
+                continue
+            if timer.reached() or count > 3:
+                break
+            if not self.ocr_appear(self.O_CRAFTING_CARD_1):
+                break
+            if self.appear(self.I_CRAFTING_EMPTY) or self.appear(self.I_CRAFTING_EMPTY_NEW):
+                if self.appear_then_click(self.I_CRAFTING_CARD_STAR_1, interval=1):
+                    timer.reset()
+                continue
+            else:
+                self.appear_then_click(self.I_CRAFTING_START, interval=3)
+                count += 1
+                timer.reset()
+                continue
+        logger.info('Finish star crafting')
+        self.ui_click_until_disappear(self.I_UI_BACK_RED, interval=1)
+
+    def find_demon(self) -> bool:
+        """
+        召唤鬼王
+        @return:
+        """
+        logger.info('Find demon')
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_BATTLE_DEMON) and not self.appear(self.I_BOSS_EMPTY):
+                break
+            if self.appear_then_click(self.I_FIND_DEMON, interval=3.5):
                 continue
                 continue
+        self.screenshot()
+        return True
 
 
-    def buy_tea(self):
-        pass
+    def battle_boss(self) -> bool:
+        logger.info('Battle boss')
+        self.ui_click_until_disappear(self.I_BATTLE_DEMON, interval=1.8)
+        battle_config = GeneralBattleConfig()
+        battle_config.lock_team_enable = False
+        if self.run_general_battle(battle_config):
+            return True
+        return False
 
 
     def battle_wait(self, random_click_swipt_enable: bool) -> bool:
     def battle_wait(self, random_click_swipt_enable: bool) -> bool:
         # 重写
         # 重写
@@ -158,3 +185,5 @@ if __name__ == '__main__':
     t = ScriptTask(c, d)
     t = ScriptTask(c, d)
 
 
     t.run()
     t.run()
+    # t.screenshot()
+    # print(t.current_exhaustion())

+ 2 - 2
tasks/Utils/post_diagnotor.py

@@ -16,8 +16,8 @@ class AnalyzeType(str, Enum):
 
 
 class PostDiagnotor(GlobalGameAssets, SoulsTidyAssets):
 class PostDiagnotor(GlobalGameAssets, SoulsTidyAssets):
     def handle(self, e: Exception, command: str, image: np.ndarray) -> AnalyzeType:
     def handle(self, e: Exception, command: str, image: np.ndarray) -> AnalyzeType:
-        if self.I_UI_CONFIRM_SAMLL.match(image) and \
-                self.I_ST_SOUL_OVERFLOW.match(image):
+        if self.I_ST_SOUL_OVERFLOW.match(image) and \
+                (self.I_UI_CONFIRM_SAMLL.match(image) or self.I_UI_GOTIT_SMALL.match(image)):
             logger.warning(f"Detect soul overflow, command: {command}")
             logger.warning(f"Detect soul overflow, command: {command}")
             return AnalyzeType.SoulOverflow
             return AnalyzeType.SoulOverflow