Explorar o código

fix: page switch and optimize climb act

Azure hai 1 ano
pai
achega
2dbc8c7e7e

+ 1 - 0
module/base/timer.py

@@ -153,6 +153,7 @@ class Timer:
         diff = self._current + self.limit - time.time()
         diff = self._current + self.limit - time.time()
         if diff > 0:
         if diff > 0:
             time.sleep(diff)
             time.sleep(diff)
+        return self
 
 
     def show(self):
     def show(self):
         from module.logger import logger
         from module.logger import logger

+ 1 - 1
tasks/ActivityShikigami/assets.py

@@ -118,7 +118,7 @@ class ActivityShikigamiAssets:
 	I_ACT_MAP_SWITCH = RuleImage(roi_front=(1196,303,59,48), roi_back=(1174,263,104,118), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_act_map_switch.png")
 	I_ACT_MAP_SWITCH = RuleImage(roi_front=(1196,303,59,48), roi_back=(1174,263,104,118), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_act_map_switch.png")
 	# 门票活动定位 
 	# 门票活动定位 
 	I_PASS_ACT_LOCAT = RuleImage(roi_front=(1214,395,29,31), roi_back=(1179,373,100,86), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_pass_act_locat.png")
 	I_PASS_ACT_LOCAT = RuleImage(roi_front=(1214,395,29,31), roi_back=(1179,373,100,86), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_pass_act_locat.png")
-	# 100体爬塔活动标识
+	# 100体爬塔标识 
 	I_CHECK_AP100 = RuleImage(roi_front=(971,575,96,100), roi_back=(934,537,166,167), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_check_ap100.png")
 	I_CHECK_AP100 = RuleImage(roi_front=(971,575,96,100), roi_back=(934,537,166,167), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_check_ap100.png")
 
 
 
 

+ 12 - 8
tasks/ActivityShikigami/script_task.py

@@ -109,16 +109,14 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
                 continue
                 continue
             # 获取当前页面
             # 获取当前页面
             current_page = self.ui_get_current_page(False)
             current_page = self.ui_get_current_page(False)
-            # 检查是否已经切换御魂
-            if not self.check(Status.ALREADY_SWITCH_SOUL):
-                self.switch_soul(self.conf.switch_soul_config)
-                continue
             match current_page:
             match current_page:
                 # 庭院, 进入活动主界面
                 # 庭院, 进入活动主界面
                 case game.page_main:
                 case game.page_main:
+                    self.switch_soul(self.conf.switch_soul_config)
                     self.home_main()
                     self.home_main()
                 # 活动主界面或副界面, 进入最终爬塔界面
                 # 活动主界面或副界面, 进入最终爬塔界面
                 case game.page_climb_act | game.page_climb_act_2:
                 case game.page_climb_act | game.page_climb_act_2:
+                    self.switch_soul(self.conf.switch_soul_config)
                     # self.ui_goto(game.page_climb_act_buff)
                     # self.ui_goto(game.page_climb_act_buff)
                     self.goto_act()
                     self.goto_act()
                 # buff界面, 进入最终爬塔界面
                 # buff界面, 进入最终爬塔界面
@@ -127,9 +125,15 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
                     self.goto_act()
                     self.goto_act()
                 # 最终爬塔界面
                 # 最终爬塔界面
                 case game.page_climb_act_pass | game.page_climb_act_ap | game.page_climb_act_ap100 | game.page_climb_act_boss:
                 case game.page_climb_act_pass | game.page_climb_act_ap | game.page_climb_act_ap100 | game.page_climb_act_boss:
+                    self.switch_soul(self.conf.switch_soul_config)
                     self.lock_team(self.conf.general_battle)
                     self.lock_team(self.conf.general_battle)
                     self.check_tickets_enough()
                     self.check_tickets_enough()
                     self.start_battle()
                     self.start_battle()
+                case game.page_battle_auto:
+                    self.battle_wait(getattr(self.conf.general_battle, f'enable_{self.climb_type}_anti_detect',
+                                             False))
+                case game.page_battle_hand:
+                    self.ui_click_until_disappear(game.page_battle_hand.check_button)
                 case _:
                 case _:
                     if self.check(Status.GOTO_ACT_FAILED):
                     if self.check(Status.GOTO_ACT_FAILED):
                         logger.warning(f'Climb type[{self.climb_type}] goto failed')
                         logger.warning(f'Climb type[{self.climb_type}] goto failed')
@@ -137,7 +141,7 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
                         continue
                         continue
                     self.put_check(Status.GOTO_ACT_FAILED, True)
                     self.put_check(Status.GOTO_ACT_FAILED, True)
                     # 任何活动界面都没有识别到, 尝试主动前往爬塔活动
                     # 任何活动界面都没有识别到, 尝试主动前往爬塔活动
-                    self.goto_act(timeout=15)
+                    self.goto_act(timeout=25)
         # 返回庭院
         # 返回庭院
         self.main_home()
         self.main_home()
         if self.conf.general_climb.active_souls_clean:
         if self.conf.general_climb.active_souls_clean:
@@ -154,7 +158,7 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
         if self.conf.general_climb.random_sleep:
         if self.conf.general_climb.random_sleep:
             random_sleep(probability=0.2)
             random_sleep(probability=0.2)
         logger.info("Click battle")
         logger.info("Click battle")
-        click_times, max_times = 0, 3
+        click_times, max_times = 0, random.randint(2, 4)
         while 1:
         while 1:
             self.screenshot()
             self.screenshot()
             if self.is_in_battle(False):
             if self.is_in_battle(False):
@@ -198,7 +202,7 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
             btn.name = "BATTLE_RANDOM"
             btn.name = "BATTLE_RANDOM"
         ok_cnt, max_retry = 0, 5
         ok_cnt, max_retry = 0, 5
         while 1:
         while 1:
-            sleep(random.uniform(0.6, 1.2))
+            sleep(random.uniform(1, 1.5))
             self.screenshot()
             self.screenshot()
             # 达到最大重试次数则直接交给上层处理
             # 达到最大重试次数则直接交给上层处理
             if ok_cnt > max_retry:
             if ok_cnt > max_retry:
@@ -422,7 +426,7 @@ class ScriptTask(GameUi, BaseActivity, SwitchSoul, ActivityShikigamiAssets):
         self.ui_get_current_page(False)
         self.ui_get_current_page(False)
         self.ui_goto(game.page_main)
         self.ui_goto(game.page_main)
 
 
-    def goto_act(self, timeout: int = 25):
+    def goto_act(self, timeout: int = 45):
         self.ui_goto(self.page_map[self.climb_type], timeout=timeout)
         self.ui_goto(self.page_map[self.climb_type], timeout=timeout)
 
 
     def random_reward_click(self, exclude_click: list = None, click_now: bool = True) -> RuleClick:
     def random_reward_click(self, exclude_click: list = None, click_now: bool = True) -> RuleClick:

+ 103 - 57
tasks/GameUi/game_ui.py

@@ -2,10 +2,12 @@
 # @author runhey
 # @author runhey
 # github https://github.com/runhey
 # github https://github.com/runhey
 import time
 import time
+from datetime import datetime
 from time import sleep
 from time import sleep
 
 
 import random
 import random
 from collections import deque
 from collections import deque
+from module.atom.gif import RuleGif
 from module.atom.image import RuleImage
 from module.atom.image import RuleImage
 from module.atom.list import RuleList
 from module.atom.list import RuleList
 from module.atom.ocr import RuleOcr
 from module.atom.ocr import RuleOcr
@@ -48,7 +50,8 @@ class GameUi(BaseTask, GameUiAssets):
                 GameUiAssets.I_BACK_FRIENDS, GameUiAssets.I_BACK_DAILY,
                 GameUiAssets.I_BACK_FRIENDS, GameUiAssets.I_BACK_DAILY,
                 GameUiAssets.I_REALM_RAID_GOTO_EXPLORATION,
                 GameUiAssets.I_REALM_RAID_GOTO_EXPLORATION,
                 GameUiAssets.I_SIX_GATES_GOTO_EXPLORATION, SixRealmsAssets.I_EXIT_SIXREALMS,
                 GameUiAssets.I_SIX_GATES_GOTO_EXPLORATION, SixRealmsAssets.I_EXIT_SIXREALMS,
-                ActivityShikigamiAssets.I_SKIP_BUTTON, ActivityShikigamiAssets.I_RED_EXIT, ActivityShikigamiAssets.I_RED_EXIT_2]
+                ActivityShikigamiAssets.I_SKIP_BUTTON, ActivityShikigamiAssets.I_RED_EXIT,
+                ActivityShikigamiAssets.I_RED_EXIT_2]
 
 
     def home_explore(self) -> bool:
     def home_explore(self) -> bool:
         """
         """
@@ -78,10 +81,15 @@ class GameUi(BaseTask, GameUiAssets):
         logger.info(f'Click {self.I_HOME_SHIKIKAMI.name}')
         logger.info(f'Click {self.I_HOME_SHIKIKAMI.name}')
         return True
         return True
 
 
-    def ui_page_appear(self, page):
+    def ui_page_appear(self, page: Page, skip_first_screenshot: bool = True, interval: float = random.uniform(0.5, 1)):
         """
         """
         判断当前页面是否为page
         判断当前页面是否为page
         """
         """
+        if interval:
+            interval_timer = Timer(interval).start()
+            interval_timer.wait()
+        if not skip_first_screenshot:
+            self.screenshot()
         if isinstance(page.check_button, list):
         if isinstance(page.check_button, list):
             for button in page.check_button:
             for button in page.check_button:
                 if self.appear(button):
                 if self.appear(button):
@@ -89,17 +97,19 @@ class GameUi(BaseTask, GameUiAssets):
             return False
             return False
         return self.appear(page.check_button)
         return self.appear(page.check_button)
 
 
-    def ui_wait_until_appear(self, page: Page, timeout: int = 3, interval: float = 0.5) -> bool:
+    def ui_wait_until_appear(self, page: Page, timeout: float = 3, interval: float = 0.5,
+                             skip_first_screenshot: bool = True) -> bool:
         """
         """
         等待页面出现
         等待页面出现
         """
         """
         logger.info(f'Waiting for {page}')
         logger.info(f'Waiting for {page}')
         timeout_timer = Timer(timeout).start()
         timeout_timer = Timer(timeout).start()
+        interval_timer = Timer(interval).start()
         while not timeout_timer.reached():
         while not timeout_timer.reached():
-            self.screenshot()
-            if self.ui_page_appear(page):
+            if self.ui_page_appear(page, skip_first_screenshot):
                 return True
                 return True
-            sleep(interval)
+            skip_first_screenshot = False
+            interval_timer.wait().reset()
         return False
         return False
 
 
     def ensure_scroll_open(self):
     def ensure_scroll_open(self):
@@ -156,7 +166,7 @@ class GameUi(BaseTask, GameUiAssets):
             for page in self.ui_pages:
             for page in self.ui_pages:
                 if not page.check_button:
                 if not page.check_button:
                     continue
                     continue
-                if self.ui_page_appear(page=page):
+                if self.ui_page_appear(page=page, interval=None):
                     logger.attr("UI", page.name)
                     logger.attr("UI", page.name)
                     self.ui_current = page
                     self.ui_current = page
                     if page == page_main and self.ensure_scroll_open():
                     if page == page_main and self.ensure_scroll_open():
@@ -187,15 +197,15 @@ class GameUi(BaseTask, GameUiAssets):
         Args:
         Args:
             button (Button):
             button (Button):
         """
         """
-        pass
+        if getattr(button, 'name', None) and button.name in self.interval_timer:
+            self.interval_timer[button.name].reset()
 
 
-    def build_reverse_paths(self, destination: Page) -> list[tuple[Page, list[Page]]]:
+    def build_reverse_path_dict(self, destination: Page) -> dict[Page, list[Page]]:
         """
         """
         构建从每个页面到目标页面的最短路径(反向 BFS)
         构建从每个页面到目标页面的最短路径(反向 BFS)
-        并按路径长度从短到长排序返回。
 
 
         Returns:
         Returns:
-            list[tuple[Page, list[Page]]] -> [(start_page, [path...destinationPage]), ...]
+            dict[Page, list[Page]] -> {start_page: [page1, ...destinationPage], ...}
         """
         """
         paths = {destination: [destination]}
         paths = {destination: [destination]}
         queue = deque([destination])
         queue = deque([destination])
@@ -206,11 +216,22 @@ class GameUi(BaseTask, GameUiAssets):
                     # page -> cur
                     # page -> cur
                     paths[page] = [page] + paths[cur]
                     paths[page] = [page] + paths[cur]
                     queue.append(page)
                     queue.append(page)
+        return paths
+
+    def build_reverse_paths(self, destination: Page) -> list[tuple[Page, list[Page]]]:
+        """
+        构建从每个页面到目标页面的最短路径(反向 BFS)
+        路径从短到长排序
+
+        Returns:
+            [(start_page, [page1, ...destinationPage]), ...]
+        """
+        paths = self.build_reverse_path_dict(destination)
         # 转换成列表并按路径长度排序, 短到长
         # 转换成列表并按路径长度排序, 短到长
         sorted_paths = sorted(paths.items(), key=lambda kv: len(kv[1]))
         sorted_paths = sorted(paths.items(), key=lambda kv: len(kv[1]))
         return sorted_paths
         return sorted_paths
 
 
-    def ui_goto(self, destination: Page, confirm_wait=0, skip_first_screenshot=True, timeout: int = 45):
+    def ui_goto(self, destination: Page, confirm_wait=0, skip_first_screenshot=True, timeout: int = 60):
         """
         """
         Args:
         Args:
             destination (Page):
             destination (Page):
@@ -222,83 +243,108 @@ class GameUi(BaseTask, GameUiAssets):
         # 初始化
         # 初始化
         timeout_timer = Timer(timeout).start()
         timeout_timer = Timer(timeout).start()
         confirm_timer = Timer(confirm_wait, count=int(confirm_wait // 0.5)).start()
         confirm_timer = Timer(confirm_wait, count=int(confirm_wait // 0.5)).start()
-        try_close_unknown_timer = Timer(3).start()
-        # 构建路径映射并排序
-        paths = self.build_reverse_paths(destination)
+        close_unknown_timer = Timer(3).start()
+        # 构建路径映射
+        path_dict = self.build_reverse_path_dict(destination)
 
 
         while not timeout_timer.reached():
         while not timeout_timer.reached():
-            if not skip_first_screenshot:
-                self.screenshot()
-            skip_first_screenshot = False
             # 已经在目标页面
             # 已经在目标页面
-            if self.ui_page_appear(destination):
+            if self.ui_page_appear(destination, skip_first_screenshot):
                 if confirm_timer.reached():
                 if confirm_timer.reached():
                     logger.info(f'Page arrive: {destination}')
                     logger.info(f'Page arrive: {destination}')
                     return True
                     return True
-                confirm_timer.reset()
                 continue
                 continue
+            skip_first_screenshot = False
             # 尝试关闭未知页面
             # 尝试关闭未知页面
-            if try_close_unknown_timer.reached():
+            if close_unknown_timer.reached_and_reset():
+                logger.warning('Trying to switch to supported page')
                 for close in self.ui_close:
                 for close in self.ui_close:
                     if self.appear_then_click(close, interval=1.5):
                     if self.appear_then_click(close, interval=1.5):
-                        logger.warning('Trying to switch to supported page')
-                try_close_unknown_timer.reset()
-            # 遍历所有路径,优先尝试最短路径
-            for page, path in paths:
-                if not self.ui_page_appear(page):
-                    continue
-                logger.info(f"Current page: {page}. Following shortest path:")
-                show_paths: str = ' -> '.join([p.name for p in path])
-                logger.info(f" {show_paths}")
-                if self._execute_path(path, confirm_timer, timeout_timer):
-                    return True
-            sleep(0.3)
+                        logger.info(f'[{close_unknown_timer.current():.1f}s]Click {close} on {self.ui_current} success')
+            confirm_timer.reset()
+            path = path_dict.get(self.ui_current, None)
+            # 找不到路径则重新获取页面重试
+            if not path:
+                self.ui_get_current_page(skip_first_screenshot)
+                continue
+            logger.info(f"Current page: {self.ui_current}. Following shortest path:")
+            show_paths: str = ' -> '.join([p.name for p in path])
+            logger.info(f"{show_paths}")
+            # 遍历路径
+            if self._execute_path(path, timeout_timer) and confirm_timer.reached():
+                return True
         else:
         else:
             logger.error(f'Cannot goto page[{destination}], timeout[{timeout}s] reached')
             logger.error(f'Cannot goto page[{destination}], timeout[{timeout}s] reached')
         return False
         return False
 
 
-    def _execute_path(self, path: list, confirm_timer, timeout_timer):
+    def _execute_path(self, path: list, timeout_timer):
         """
         """
         执行路径
         执行路径
         :param path: currentPage,page1,page2,...,destinationPage
         :param path: currentPage,page1,page2,...,destinationPage
-        :param confirm_timer: 确认定时器
         :param timeout_timer: 超时定时器
         :param timeout_timer: 超时定时器
         :return: currentPage==destinationPage
         :return: currentPage==destinationPage
         """
         """
         for i in range(len(path) - 1):
         for i in range(len(path) - 1):
             current_page, next_page = path[i], path[i + 1]
             current_page, next_page = path[i], path[i + 1]
-            # 已超时则不再遍历
             if timeout_timer.reached():
             if timeout_timer.reached():
                 return False
                 return False
-            # 等待当前页面出现
-            self.ui_wait_until_appear(current_page, interval=random.uniform(0.6, 1.2))
-            logger.info(f'Page switch: {current_page} -> {next_page}')
+            # 当前页不等于路径中对应页, 尝试下一页
+            if self.ui_current != current_page:
+                continue
             # 执行附加操作
             # 执行附加操作
             if current_page.additional:
             if current_page.additional:
                 for button in current_page.additional:
                 for button in current_page.additional:
-                    if ((isinstance(button, RuleClick) and self.click(button)) or
-                            self.appear_then_click(button, interval=0.6) or
-                            (isinstance(button, RuleOcr) and self.ocr_appear_click(button, interval=2))):
+                    if self.appear_then_operate(button, skip_first_screenshot=False, interval=random.uniform(0.4, 0.6)):
                         logger.info(f'Page {current_page} additional {button} clicked')
                         logger.info(f'Page {current_page} additional {button} clicked')
-                    # 每次都随机延迟, 等待响应
-                    sleep(random.uniform(0.4, 0.8))
-            # 执行页面跳转
+            logger.info(f'Page switch: {current_page} -> {next_page}')
+            # 获取页面跳转操作
             button = current_page.links.get(next_page)
             button = current_page.links.get(next_page)
             if not button:
             if not button:
                 logger.warning(f"No link from {current_page} to {next_page}")
                 logger.warning(f"No link from {current_page} to {next_page}")
-                return False
-            # 执行对应操作
-            if ((isinstance(button, RuleList) and self.list_appear_click(button)) or
-                    (isinstance(button, RuleClick) and self.click(button)) or
-                    self.appear_then_click(button, interval=2) or
-                    (isinstance(button, RuleOcr) and self.ocr_appear_click(button, interval=2))):
-                self.ui_button_interval_reset(button)
-                confirm_timer.reset()
+                continue
+            # 跳转页面
+            max_wait_timer = Timer(5).start()
+            while not max_wait_timer.reached():
+                if timeout_timer.reached():
+                    return False
+                if self.appear_then_operate(button, skip_first_screenshot=False):
+                    break
+                logger.warning(f"[{max_wait_timer.current():.1f}s]Failed click {button} on {current_page}, retry...")
+                sleep(0.3)
             else:
             else:
-                logger.warning(f"Failed to click {button} on {current_page}")
-                return False
-        # 最后确认目标页面
-        return self.ui_page_appear(path[-1])
+                self.ui_get_current_page(skip_first_screenshot=False)
+                # 当前页面不是对应路径的页面, 则尝试下一个页面
+                if self.ui_current != current_page:
+                    continue
+            max_wait_timer.reset()
+            while not max_wait_timer.reached():
+                if timeout_timer.reached():
+                    return False
+                if self.ui_wait_until_appear(next_page, timeout=1.5, interval=random.uniform(0.4, 0.8),
+                                             skip_first_screenshot=False):
+                    logger.info(f'[{max_wait_timer.current():.1f}s]Page arrived {next_page}')
+                    self.ui_current = next_page
+                    break
+            else:
+                # 重新获取当前页
+                self.ui_get_current_page(skip_first_screenshot=False)
+        return self.ui_current == path[-1]
+
+    def appear_then_operate(self, target: RuleList | RuleImage | RuleGif | RuleOcr | RuleClick,
+                            interval: float = random.uniform(0.6, 1.2), skip_first_screenshot: bool = True):
+        self.ui_button_interval_reset(target)
+        interval_timer = Timer(interval).start()
+        interval_timer.wait()
+        if not skip_first_screenshot:
+            self.screenshot()
+        if isinstance(target, RuleList):
+            return self.list_appear_click(target)
+        if isinstance(target, (RuleImage, RuleGif)):
+            return self.appear_then_click(target)
+        if isinstance(target, RuleOcr):
+            return self.ocr_appear_click(target)
+        if isinstance(target, RuleClick):
+            return self.click(target)
 
 
     # ------------------------------------------------------------------------------------------------------------------
     # ------------------------------------------------------------------------------------------------------------------
     # 下面的这些是一些特殊的页面,需要额外处理
     # 下面的这些是一些特殊的页面,需要额外处理

+ 9 - 4
tasks/GameUi/page.py

@@ -150,8 +150,10 @@ page_daily = Page(G.I_CHECK_DAILY)
 # page_daily.additional = [G.O_CLICK_CLOSE_1, G.O_CLICK_CLOSE_2]
 # page_daily.additional = [G.O_CLICK_CLOSE_1, G.O_CLICK_CLOSE_2]
 page_daily.link(button=G.I_BACK_Y, destination=page_main)
 page_daily.link(button=G.I_BACK_Y, destination=page_main)
 page_main.link(button=G.I_MAIN_GOTO_DAILY, destination=page_daily)
 page_main.link(button=G.I_MAIN_GOTO_DAILY, destination=page_daily)
+from tasks.DailyTrifles.assets import DailyTriflesAssets
+
 # 商店 mall
 # 商店 mall
-page_mall = Page(G.I_CHECK_MALL)
+page_mall = Page(check_button=[G.I_CHECK_MALL, DailyTriflesAssets.I_ROOM_GIFT])
 page_mall.additional = [G.I_AD_CLOSE_RED, G.I_BACK_Y, G.I_DLC_CLOSE]
 page_mall.additional = [G.I_AD_CLOSE_RED, G.I_BACK_Y, G.I_DLC_CLOSE]
 page_mall.link(button=G.I_BACK_BLUE, destination=page_main)
 page_mall.link(button=G.I_BACK_BLUE, destination=page_main)
 page_main.link(button=G.I_MAIN_GOTO_MALL, destination=page_mall)
 page_main.link(button=G.I_MAIN_GOTO_MALL, destination=page_mall)
@@ -200,7 +202,8 @@ page_climb_act.link(button=G.I_BACK_Y, destination=page_main)
 page_act_list_climb_act.link(button=G.I_ACT_LIST_GOTO_ACT, destination=page_climb_act)
 page_act_list_climb_act.link(button=G.I_ACT_LIST_GOTO_ACT, destination=page_climb_act)
 # 爬塔活动副界面
 # 爬塔活动副界面
 page_climb_act_2 = Page(asa.I_CHECK_BATTLE_2)
 page_climb_act_2 = Page(asa.I_CHECK_BATTLE_2)
-page_climb_act_2.additional = [asa.I_ACT_MAP_SWITCH, asa.I_PASS_ACT_LOCAT, asa.I_SKIP_BUTTON, asa.I_RED_EXIT, asa.I_RED_EXIT_2]
+page_climb_act_2.additional = [asa.I_ACT_MAP_SWITCH, asa.I_PASS_ACT_LOCAT, asa.I_SKIP_BUTTON, asa.I_RED_EXIT,
+                               asa.I_RED_EXIT_2]
 page_climb_act_2.link(button=G.I_BACK_BATTLE, destination=page_climb_act)
 page_climb_act_2.link(button=G.I_BACK_BATTLE, destination=page_climb_act)
 page_climb_act.link(button=asa.I_BATTLE, destination=page_climb_act_2)
 page_climb_act.link(button=asa.I_BATTLE, destination=page_climb_act_2)
 # 门票爬塔活动界面
 # 门票爬塔活动界面
@@ -246,6 +249,7 @@ def random_click(low: int = None, high: int = None) -> RuleClick | list[RuleClic
     :return: RuleClick或者RuleClick的数组
     :return: RuleClick或者RuleClick的数组
     """
     """
     click = random.choice([asa.C_RANDOM_LEFT, asa.C_RANDOM_RIGHT, asa.C_RANDOM_TOP])
     click = random.choice([asa.C_RANDOM_LEFT, asa.C_RANDOM_RIGHT, asa.C_RANDOM_TOP])
+    click.name = "BATTLE_RANDOM"
     if low is None or high is None:
     if low is None or high is None:
         return click
         return click
     return [click for _ in range(random.randint(low, high))]
     return [click for _ in range(random.randint(low, high))]
@@ -256,11 +260,12 @@ page_reward = Page(check_button=[GeneralBattleAssets.I_REWARD_PURPLE_SNAKE_SKIN,
                                  GeneralBattleAssets.I_REWARD_EXP_SOUL_4, GeneralBattleAssets.I_WIN,
                                  GeneralBattleAssets.I_REWARD_EXP_SOUL_4, GeneralBattleAssets.I_WIN,
                                  GeneralBattleAssets.I_REWARD_GOLD, GeneralBattleAssets.I_REWARD_GOLD_SNAKE_SKIN,
                                  GeneralBattleAssets.I_REWARD_GOLD, GeneralBattleAssets.I_REWARD_GOLD_SNAKE_SKIN,
                                  GeneralBattleAssets.I_REWARD_SOUL_5, GeneralBattleAssets.I_REWARD_SOUL_6,
                                  GeneralBattleAssets.I_REWARD_SOUL_5, GeneralBattleAssets.I_REWARD_SOUL_6,
-                                 gga.I_UI_REWARD,],
+                                 gga.I_UI_REWARD, ],
                    links={page_climb_act_pass: random_click(), page_climb_act_ap: random_click(),
                    links={page_climb_act_pass: random_click(), page_climb_act_ap: random_click(),
                           page_area_boss: random_click()})
                           page_area_boss: random_click()})
-page_reward.additional = random_click(1, 3)
+page_reward.additional = [random_click()]
 # 失败界面
 # 失败界面
 page_failed = Page(check_button=GeneralBattleAssets.I_FALSE,
 page_failed = Page(check_button=GeneralBattleAssets.I_FALSE,
                    links={page_climb_act_pass: random_click(), page_climb_act_ap: random_click(),
                    links={page_climb_act_pass: random_click(), page_climb_act_ap: random_click(),
                           page_area_boss: random_click()})
                           page_area_boss: random_click()})
+page_failed.additional = [random_click()]