Просмотр исходного кода

Merge pull request #1854 from runhey/dev

Automated PR 2026.10.02
github-actions[bot] 1 месяц назад
Родитель
Сommit
73275edbea
100 измененных файлов с 3271 добавлено и 1831 удалено
  1. 4 8
      tasks/AbyssShadows/script_task.py
  2. 3 3
      tasks/ActivityShikigami/page.py
  3. 2 4
      tasks/ActivityShikigami/script_task.py
  4. 1 2
      tasks/ActivityShikigami/script_test.py
  5. 3 6
      tasks/AreaBoss/script_task.py
  6. 12 22
      tasks/BondlingFairyland/script_task.py
  7. 2 4
      tasks/BudokaiTournament/script_task.py
  8. 1 2
      tasks/CollectiveMissions/script_task.py
  9. 3 2
      tasks/Component/Buy/buy.py
  10. 4 8
      tasks/Component/Costume/costume_test_shikigami.py
  11. 1 2
      tasks/Component/CostumeBattle/costume_test_battle.py
  12. 13 0
      tasks/Component/GeneralBattle/assets.py
  13. BIN
      tasks/Component/GeneralBattle/gb/gb_battle_state_info.png
  14. BIN
      tasks/Component/GeneralBattle/gb/gb_gb_check_team_exit.png
  15. BIN
      tasks/Component/GeneralBattle/gb/gb_gb_skin_confirm.png
  16. BIN
      tasks/Component/GeneralBattle/gb/gb_over_ghost.png
  17. 37 1
      tasks/Component/GeneralBattle/gb/image.json
  18. 1 2
      tasks/Component/RightActivity/right_activity.py
  19. 3 3
      tasks/Component/SwitchAccount/switch_account.py
  20. 3 3
      tasks/DailyTrifles/page.py
  21. 8 15
      tasks/DailyTrifles/script_task.py
  22. 1 2
      tasks/Delegation/script_task.py
  23. 2 3
      tasks/DemonEncounter/script_task.py
  24. 4 8
      tasks/DemonRetreat/script_task.py
  25. 1 2
      tasks/Dokan/script_task.py
  26. 9 11
      tasks/Duel/script_task.py
  27. 4 8
      tasks/DyeTrials/script_task.py
  28. 7 14
      tasks/EternitySea/script_task.py
  29. 8 17
      tasks/EvoZone/script_task.py
  30. 5 10
      tasks/ExperienceYoukai/script_task.py
  31. 3 1
      tasks/Exploration/assets.py
  32. 6 11
      tasks/Exploration/base.py
  33. 10 1
      tasks/Exploration/res/image.json
  34. BIN
      tasks/Exploration/res/res_e_open_folder.png
  35. 4 17
      tasks/FallenSun/script_task.py
  36. 1 2
      tasks/FloatParade/script_task.py
  37. 347 0
      tasks/GameUi/USAGE.md
  38. 68 0
      tasks/GameUi/action.py
  39. 3 3
      tasks/GameUi/additional/act.json
  40. BIN
      tasks/GameUi/additional/additional_act_list_expand.png
  41. BIN
      tasks/GameUi/additional/additional_close_chat_window.png
  42. 0 20
      tasks/GameUi/additional/daily.json
  43. 0 11
      tasks/GameUi/additional/guild.json
  44. 0 20
      tasks/GameUi/additional/records.json
  45. 149 202
      tasks/GameUi/assets.py
  46. 148 0
      tasks/GameUi/common.py
  47. 362 0
      tasks/GameUi/default_pages.py
  48. 12 368
      tasks/GameUi/game_ui.py
  49. 180 0
      tasks/GameUi/matcher.py
  50. 888 0
      tasks/GameUi/navigator.py
  51. 123 247
      tasks/GameUi/page.py
  52. 20 0
      tasks/GameUi/page/image_act_list.json
  53. 335 0
      tasks/GameUi/page/image_exploration.json
  54. 283 0
      tasks/GameUi/page/image_main.json
  55. 174 0
      tasks/GameUi/page/image_town.json
  56. 0 0
      tasks/GameUi/page/list_image_act_list.json
  57. 13 0
      tasks/GameUi/page/list_ocr_act_list.json
  58. BIN
      tasks/GameUi/page/page_act_list_goto_act.png
  59. BIN
      tasks/GameUi/page/page_check_act_list.png
  60. BIN
      tasks/GameUi/page/page_check_awake.png
  61. BIN
      tasks/GameUi/page/page_check_demon_encounter.png
  62. BIN
      tasks/GameUi/page/page_check_demon_encounter_2.png
  63. BIN
      tasks/GameUi/page/page_check_entertainment.png
  64. BIN
      tasks/GameUi/page/page_check_exploration.png
  65. BIN
      tasks/GameUi/page/page_check_goryou.png
  66. BIN
      tasks/GameUi/page/page_check_hyakkisen.png
  67. BIN
      tasks/GameUi/page/page_check_incense_realm.png
  68. BIN
      tasks/GameUi/page/page_check_kyakkiyakou.png
  69. BIN
      tasks/GameUi/page/page_check_mall.png
  70. BIN
      tasks/GameUi/page/page_check_mall_recommend.png
  71. BIN
      tasks/GameUi/page/page_check_mantra_tower.png
  72. BIN
      tasks/GameUi/page/page_check_moon_sea.png
  73. BIN
      tasks/GameUi/page/page_check_peacock_kingdom.png
  74. BIN
      tasks/GameUi/page/page_check_pure_buddha_realm.png
  75. BIN
      tasks/GameUi/page/page_check_seasonrift_forest.png
  76. BIN
      tasks/GameUi/page/page_check_shrin.png
  77. BIN
      tasks/GameUi/page/page_check_soul_zones.png
  78. BIN
      tasks/GameUi/page/page_check_team.png
  79. BIN
      tasks/GameUi/page/page_exploration_goto_area_boss.png
  80. BIN
      tasks/GameUi/page/page_exploration_goto_awake_zone.png
  81. BIN
      tasks/GameUi/page/page_exploration_goto_bondling_fairyland.png
  82. BIN
      tasks/GameUi/page/page_exploration_goto_delegation.png
  83. BIN
      tasks/GameUi/page/page_exploration_goto_goryou_realm.png
  84. BIN
      tasks/GameUi/page/page_exploration_goto_hero_test.png
  85. BIN
      tasks/GameUi/page/page_exploration_goto_realm_raid.png
  86. BIN
      tasks/GameUi/page/page_exploration_goto_secret_zones.png
  87. BIN
      tasks/GameUi/page/page_exploration_goto_six_gates.png
  88. BIN
      tasks/GameUi/page/page_exploration_goto_soul_zone.png
  89. BIN
      tasks/GameUi/page/page_exploration_to_incense_realm.png
  90. BIN
      tasks/GameUi/page/page_exploration_to_mantra_tower.png
  91. BIN
      tasks/GameUi/page/page_exploration_to_moon_sea.png
  92. BIN
      tasks/GameUi/page/page_exploration_to_peacock_kingdom.png
  93. BIN
      tasks/GameUi/page/page_exploration_to_pure_buddha_realm.png
  94. BIN
      tasks/GameUi/page/page_exploration_to_seasonrift_forest.png
  95. BIN
      tasks/GameUi/page/page_guild_to_shrin.png
  96. 0 254
      tasks/GameUi/page/page_img.json
  97. 0 191
      tasks/GameUi/page/page_img_2.json
  98. 0 218
      tasks/GameUi/page/page_img_3.json
  99. 0 11
      tasks/GameUi/page/page_img_login.json
  100. 0 92
      tasks/GameUi/page/page_img_supplement.json

+ 4 - 8
tasks/AbyssShadows/script_task.py

@@ -96,12 +96,10 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, AbyssShadowsAssets):
         cfg: AbyssShadows = self.config.abyss_shadows
 
         if cfg.switch_soul_config.enable:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul(cfg.switch_soul_config.switch_group_team)
         if cfg.switch_soul_config.enable_switch_by_name:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul_by_name(cfg.switch_soul_config.group_name, cfg.switch_soul_config.team_name)
         today = datetime.now().weekday()
         if today not in [4, 5, 6]:
@@ -303,17 +301,15 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, AbyssShadowsAssets):
     def goto_main(self):
         ''' 保持好习惯,一个任务结束了就返回庭院,方便下一任务的开始或者是出错重启
         '''
-        self.ui_get_current_page()
         logger.info("Exiting abyss_shadows")
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
 
     def goto_abyss_shadows(self) -> bool:
         ''' 进入狭间
         :return bool
         '''
-        self.ui_get_current_page()
         logger.info("Entering abyss_shadows")
-        self.ui_goto(page_guild)
+        self.goto_page(page_guild)
         
         while 1:
             self.screenshot()

+ 3 - 3
tasks/ActivityShikigami/page.py

@@ -19,9 +19,9 @@ from tasks.base_task import BaseTask as BT
 
 # 爬塔活动主要界面
 page_climb_act = Page(asa.I_TO_BATTLE_MAIN)
-page_climb_act.additional = [gga.I_UI_REWARD, asa.I_SKIP_BUTTON, asa.I_CONFIRM_SKIP, asa.I_RED_EXIT]
-page_climb_act.link(button=G.I_BACK_Y, destination=page_main)
-page_main.link(button=[asa.I_SHI, RAA.I_TOGGLE_BUTTON], destination=page_climb_act)
+page_climb_act.add_enter_success_hooks(gga.I_UI_REWARD, asa.I_SKIP_BUTTON, asa.I_CONFIRM_SKIP, asa.I_RED_EXIT)
+page_climb_act.connect(page_main, G.I_BACK_Y, key="page_climb_act->page_main")
+page_main.connect(page_climb_act, [asa.I_SHI, RAA.I_TOGGLE_BUTTON], key="page_main->page_climb_act")
 
 # page_act_list_climb_act.link(button=G.I_ACT_LIST_GOTO_ACT, destination=page_climb_act)
 # # 爬塔活动副界面

+ 2 - 4
tasks/ActivityShikigami/script_task.py

@@ -153,8 +153,7 @@ class ScriptTask(StateMachine, GameUi, Battle, BaseActivity, SwitchSoul, Activit
         #
         for climb_type in self.conf.general_climb.run_sequence_v:
             # 进入到活动的主页面,不是具体的战斗页面
-            self.ui_get_current_page()
-            self.ui_goto(game.page_climb_act)
+            self.goto_page(game.page_climb_act)
             try:
                 method_func = getattr(self, f'_run_{climb_type}')
                 method_func()
@@ -168,8 +167,7 @@ class ScriptTask(StateMachine, GameUi, Battle, BaseActivity, SwitchSoul, Activit
 
         # 返回庭院
         logger.hr("Exit Shikigami", 2)
-        self.ui_get_current_page(False)
-        self.ui_goto(game.page_main)
+        self.goto_page(game.page_main)
         if self.conf.general_climb.active_souls_clean:
             self.set_next_run(task='SoulsTidy', success=False, finish=False, target=datetime.now())
         self.set_next_run(task="ActivityShikigami", success=True)

+ 1 - 2
tasks/ActivityShikigami/script_test.py

@@ -13,8 +13,7 @@ from tasks.ActivityShikigami.script_task import ScriptTask
 class ImplScriptTask(ScriptTask, ABC):
     def test_battle_main(self) -> bool:
         # 从别的地方到活动主页面
-        self.ui_get_current_page()
-        self.ui_goto(page_climb_act)
+        self.goto_page(page_climb_act)
         # 从活动主页面到默认战斗页面
         self.ui_click(self.I_TO_BATTLE_MAIN, stop=self.I_CHECK_BATTLE_MAIN, interval=1)
         # 从默认战斗页面到式神录 再返回

+ 3 - 6
tasks/AreaBoss/script_task.py

@@ -48,18 +48,15 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, AreaBossAssets):
         con = self.config.area_boss.boss
 
         if self.config.area_boss.switch_soul.enable:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul(self.config.area_boss.switch_soul.switch_group_team)
 
         if self.config.area_boss.switch_soul.enable_switch_by_name:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul_by_name(self.config.area_boss.switch_soul.group_name,
                                          self.config.area_boss.switch_soul.team_name)
 
-        self.ui_get_current_page()
-        self.ui_goto(page_area_boss)
+        self.goto_page(page_area_boss)
 
         # 已挑战鬼王数量
         boss_fought = 0

+ 12 - 22
tasks/BondlingFairyland/script_task.py

@@ -41,23 +41,21 @@ class ScriptTask(GameUi, GeneralInvite, GeneralRoom, BondlingBattle, SwitchSoul,
 
         if cong.bondling_config.check_enable:
             logger.hr('第一步, 检查契忆数量', 2)
-            self.ui_get_current_page()
-            self.ui_goto(page_mall, confirm_wait=2.5)
+            self.goto_page(page_mall, confirm_wait=2.5)
             self.ui_click(self.I_MALL_SCCALES, self.I_MALL_SCCALES_CHECK)
             self.ui_click(self.I_MALL_BONDLINGS_SURE, self.I_MALL_BONDLINGS_ON)
             MAX_COUNT = cong.bondling_config.limit_num
             cu, re, total = self.O_BL_CHECK_MONEY.ocr(self.device.image)
             if cu >= MAX_COUNT:
                 logger.info(f'契忆数量: {cu} 大于 {MAX_COUNT}')
-                self.ui_get_current_page()
-                self.ui_goto(page_main)
+                self.goto_page(page_main)
                 self.set_next_run(task='BondlingFairyland', finish=True, success=True)
                 raise TaskEnd
             logger.info(f'契忆数量: {cu} 小于 {MAX_COUNT}, 继续任务')
         logger.hr('第二步, 切换御魂', 2)
         self.switch_soul()
         logger.hr('第三步, 前往契灵主界面', 2)
-        self.ui_goto_page(page_bondling_fairyland)
+        self.goto_page(page_bondling_fairyland)
         logger.hr('第四步, 开始战斗准备', 2)
         self.current_count = 0
         self.limit_count = cong.bondling_config.limit_count  # 默认limit_count值
@@ -68,7 +66,7 @@ class ScriptTask(GameUi, GeneralInvite, GeneralRoom, BondlingBattle, SwitchSoul,
             if cong.bondling_config.user_status != UserStatus.ALONE:
                 raise ValueError(f'Now is model1, but user status is not alone, current: {cong.bondling_config.user_status.value}')
             self.run_search(cong.bondling_config)
-            self.ui_goto_page(page_main)
+            self.goto_page(page_main)
             self.set_next_run(task='BondlingFairyland', finish=True, success=True)
             raise TaskEnd
         match cong.bondling_config.user_status:
@@ -79,8 +77,7 @@ class ScriptTask(GameUi, GeneralInvite, GeneralRoom, BondlingBattle, SwitchSoul,
                 self.limit_count //= 2
                 self.run_member()
                 self.current_count = 0
-                self.ui_get_current_page()
-                self.ui_goto(page_bondling_fairyland)
+                self.goto_page(page_bondling_fairyland)
                 self.switch_ball()
             case UserStatus.LEADER | UserStatus.ALONE:
                 self.switch_ball()
@@ -191,20 +188,17 @@ class ScriptTask(GameUi, GeneralInvite, GeneralRoom, BondlingBattle, SwitchSoul,
         if self.exit_team():
             pass
 
-        self.ui_get_current_page()
-        self.ui_goto(page_bondling_fairyland)
+        self.goto_page(page_bondling_fairyland)
         # 引用配置
         if UserStatus.handoff1 == self.config.bondling_fairyland.bondling_config.user_status:
             self.current_count = 0
             self.run_member()
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
         self.set_next_run(task='BondlingFairyland', finish=True, success=True)
         raise TaskEnd
 
     def run_member(self):
         logger.hr('Start run member', 2)
-        self.ui_get_current_page()
         # 开始等待队长拉人
         wait_time = self.config.bondling_fairyland.invite_config.wait_time
         wait_timer = Timer(wait_time.minute * 60)
@@ -260,8 +254,7 @@ class ScriptTask(GameUi, GeneralInvite, GeneralRoom, BondlingBattle, SwitchSoul,
                 pass
                 # 引用配置
         if UserStatus.MEMBER == self.config.bondling_fairyland.bondling_config.user_status:
-            self.ui_get_current_page()
-            self.ui_goto(page_main)
+            self.goto_page(page_main)
             self.set_next_run(task='BondlingFairyland', finish=True, success=True)
             raise TaskEnd
 
@@ -278,8 +271,7 @@ class ScriptTask(GameUi, GeneralInvite, GeneralRoom, BondlingBattle, SwitchSoul,
         capture_setting_checked = False
         while 1:
             if not self.in_search_ui(screenshot=True):
-                self.ui_get_current_page()
-                self.ui_goto(page_bondling_fairyland)
+                self.goto_page(page_bondling_fairyland)
                 continue
             if bondling_config.bondling_mode != BondlingMode.MODE1:
                 if self.ball_click(current_ball_index):
@@ -324,8 +316,7 @@ class ScriptTask(GameUi, GeneralInvite, GeneralRoom, BondlingBattle, SwitchSoul,
                 self.appear_then_click(self.I_BACK_Y, interval=1)
         logger.info('BondlingFairyland task finished')
 
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
         self.set_next_run(task='BondlingFairyland', finish=True, success=True)
         raise TaskEnd
 
@@ -810,7 +801,7 @@ class ScriptTask(GameUi, GeneralInvite, GeneralRoom, BondlingBattle, SwitchSoul,
             return
         bondling_config = cong.bondling_config
         bondling_switch_soul = cong.bondling_switch_soul
-        self.ui_goto_page(page_shikigami_records)
+        self.goto_page(page_shikigami_records)
         # 单刷探查配置
         if bondling_config.bondling_mode == BondlingMode.MODE1:
             type_str, (group, team) = bondling_switch_soul.get_switch_by_name('search_switch')
@@ -864,8 +855,7 @@ if __name__ == '__main__':
     device = Device(config)
     t = ScriptTask(config, device)
     t.run()
-    t.ui_get_current_page()
-    t.ui_goto(page_bondling_fairyland)
+    t.goto_page(page_bondling_fairyland)
     # image = task.screenshot()
 
     # con = config.bondling_fairyland

+ 2 - 4
tasks/BudokaiTournament/script_task.py

@@ -238,8 +238,7 @@ class ScriptTask(Foot):
         #
         for climb_type in self.conf.run_sequence():
             # 进入到活动的主页面,不是具体的战斗页面
-            self.ui_get_current_page()
-            self.ui_goto(game.page_climb_act)
+            self.goto_page(game.page_climb_act)
             try:
                 if getattr(self.conf.daily_training, f'limit_{self.climb_type}') > 0:
                     method_func = getattr(self, f'_run_{climb_type}')
@@ -254,8 +253,7 @@ class ScriptTask(Foot):
 
         # 返回庭院
         logger.hr("Exit BudokaiTournament", 2)
-        self.ui_get_current_page(False)
-        self.ui_goto(game.page_main)
+        self.goto_page(game.page_main)
         if self.conf.daily_training.active_souls_clean:
             self.set_next_run(task='SoulsTidy', success=False, finish=False, target=datetime.now())
         self.set_next_run(task="BudokaiTournament", success=True)

+ 1 - 2
tasks/CollectiveMissions/script_task.py

@@ -46,8 +46,7 @@ class ScriptTask(GameUi, CollectiveMissionsAssets):
         return rule
 
     def run(self):
-        self.ui_get_current_page()
-        self.ui_goto(page_guild)
+        self.goto_page(page_guild)
         rule = self.config.collective_missions.missions_config.missions_rule
         self.ui_click(self.I_CM_SHRINE, self.I_CM_CM)
         self.ui_click(self.I_CM_CM, self.I_CM_RECORDS)

+ 3 - 2
tasks/Component/Buy/buy.py

@@ -77,7 +77,7 @@ class Buy(BaseTask, BuyAssets):
         return True
 
     def buy_more(self, start_click: Union[RuleImage, RuleOcr, RuleClick],
-                 number: int = None):
+                 number: int = None) -> bool:
         """
         购买多个物品
         :param start_click:
@@ -93,7 +93,7 @@ class Buy(BaseTask, BuyAssets):
             if try_click_count >= 5:
                 logger.warning(f'Buy_more failed, try_click_count: {try_click_count}')
                 logger.warning('Close the purchase')
-                return
+                return False
 
             if isinstance(start_click, RuleImage):
                 if self.appear_then_click(start_click, interval=1):
@@ -162,6 +162,7 @@ class Buy(BaseTask, BuyAssets):
 
             if self.click(self.C_BUY_MORE, interval=2):
                 continue
+        return True
 
     def buy_check_money(self, target: RuleOcr, minimum: int):
         """

+ 4 - 8
tasks/Component/Costume/costume_test_shikigami.py

@@ -22,8 +22,7 @@ class ScriptTask(GameUi, SwitchSoul, SwitchSoulAssets, SoulsTidyAssets):
 
     def run(self):
         # 定位并进入式神录
-        self.ui_get_current_page()
-        self.ui_goto(page_shikigami_records)
+        self.goto_page(page_shikigami_records)
 
         # 关键识别点统计
         images_count = [
@@ -84,8 +83,7 @@ class ScriptTask(GameUi, SwitchSoul, SwitchSoulAssets, SoulsTidyAssets):
         logger.hr('Switch Soul Test - All Groups')
         
         # 进入式神录
-        self.ui_get_current_page()
-        self.ui_goto(page_shikigami_records)
+        self.goto_page(page_shikigami_records)
         
         # 点击预设按钮
         self.click_preset()
@@ -111,8 +109,7 @@ class ScriptTask(GameUi, SwitchSoul, SwitchSoulAssets, SoulsTidyAssets):
         logger.hr('Souls Tidy Donation Test')
         
         # 进入式神录
-        self.ui_get_current_page()
-        self.ui_goto(page_shikigami_records)
+        self.goto_page(page_shikigami_records)
         
         # 进入御魂界面
         souls_tidy_task = SoulsTidyTask(self.config, self.device)
@@ -150,8 +147,7 @@ class ScriptTask(GameUi, SwitchSoul, SwitchSoulAssets, SoulsTidyAssets):
         souls_tidy_task.back_records()
         
         # 退出式神录
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
         logger.info('Souls Tidy Donation Test completed')
 
 

+ 1 - 2
tasks/Component/CostumeBattle/costume_test_battle.py

@@ -13,8 +13,7 @@ from tasks.Component.Costume.config import BattleType
 class ScriptTask(ScriptTaskBase):
 
     def run(self):
-        self.ui_get_current_page()
-        self.ui_goto(page_kekkai_toppa)
+        self.goto_page(page_kekkai_toppa)
 
         self.attack()
 

+ 13 - 0
tasks/Component/GeneralBattle/assets.py

@@ -64,6 +64,11 @@ class GeneralBattleAssets:
 	C_GREEN_MARK_AREA = RuleClick(roi_front=(0,0,1280,720), roi_back=(0,0,1280,720), name="green_mark_area")
 	# 战斗的时候有一定的概率随机点击 
 	C_RANDOM_CLICK = RuleClick(roi_front=(104,79,1050,507), roi_back=(255,65,100,100), name="random_click")
+	# 结算安全随机点击区域(移植自mine) 
+	C_RANDOM_LEFT = RuleClick(roi_front=(17,104,55,370), roi_back=(17,104,55,370), name="random_left")
+	C_RANDOM_RIGHT = RuleClick(roi_front=(1185,115,79,388), roi_back=(1185,115,79,388), name="random_right")
+	C_RANDOM_TOP = RuleClick(roi_front=(250,58,868,68), roi_back=(250,58,868,68), name="random_top")
+	C_RANDOM_BOTTOM = RuleClick(roi_front=(462,599,492,78), roi_back=(462,599,492,78), name="random_bottom")
 
 
 	# Image Rule Assets
@@ -135,6 +140,14 @@ class GeneralBattleAssets:
 	I_PRESET_WIT_NUMBER = RuleImage(roi_front=(40,655,37,37), roi_back=(9,636,100,74), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_preset_wit_number.png")
 	# 战斗信息标识 
 	I_BATTLE_INFO = RuleImage(roi_front=(230,12,37,39), roi_back=(210,1,147,72), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_battle_info.png")
+	# 战斗状态信息(移植自mine) 
+	I_BATTLE_STATE_INFO = RuleImage(roi_front=(725,51,67,31), roi_back=(483,18,337,102), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_battle_state_info.png")
+	# 皮肤确认弹窗(移植自mine) 
+	I_GB_SKIN_CONFIRM = RuleImage(roi_front=(594,447,90,55), roi_back=(594,447,90,55), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_gb_skin_confirm.png")
+	# 队伍退出确认弹窗(移植自mine) 
+	I_GB_CHECK_TEAM_EXIT = RuleImage(roi_front=(507,288,270,54), roi_back=(411,233,452,247), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_gb_check_team_exit.png")
+	# 契灵结算弹窗(移植自mine) 
+	I_OVER_GHOST = RuleImage(roi_front=(697,409,89,32), roi_back=(697,409,89,32), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralBattle/gb/gb_over_ghost.png")
 
 
 	# Image Rule Assets

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


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


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


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


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

@@ -304,5 +304,41 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "战斗信息标识"
+  },
+  {
+    "itemName": "battle_state_info",
+    "imageName": "gb_battle_state_info.png",
+    "roiFront": "725,51,67,31",
+    "roiBack": "483,18,337,102",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "战斗状态信息(移植自mine)"
+  },
+  {
+    "itemName": "gb_skin_confirm",
+    "imageName": "gb_gb_skin_confirm.png",
+    "roiFront": "594,447,90,55",
+    "roiBack": "594,447,90,55",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "皮肤确认弹窗(移植自mine)"
+  },
+  {
+    "itemName": "gb_check_team_exit",
+    "imageName": "gb_gb_check_team_exit.png",
+    "roiFront": "507,288,270,54",
+    "roiBack": "411,233,452,247",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "队伍退出确认弹窗(移植自mine)"
+  },
+  {
+    "itemName": "over_ghost",
+    "imageName": "gb_over_ghost.png",
+    "roiFront": "697,409,89,32",
+    "roiBack": "697,409,89,32",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "契灵结算弹窗(移植自mine)"
   }
-]
+]

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

@@ -12,8 +12,7 @@ from tasks.Component.RightActivity.assets import RightActivityAssets
 
 class RightActivity(GameUi, RightActivityAssets):
     def enter(self, target: RuleImage):
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
 
         self.ui_click(self.I_TOGGLE_BUTTON, target, interval=2)
         self.ui_click_until_disappear(target, interval=3)

+ 3 - 3
tasks/Component/SwitchAccount/switch_account.py

@@ -35,11 +35,11 @@ class SwitchAccount(LoginAccount, ExitGame, GameUi, SwitchAccountAssets):
     def switchAccount(self):
         logger.info("start switchAccount %s-%s", self.to_account_info.character, self.to_account_info.svr)
         # 判断所处界面
-        curPage = self.ui_get_current_page()
+        curPage = self.get_current_page()
 
         if curPage != page_login and curPage != page_main:
-            self.ui_goto(page_main)
-            curPage = self.ui_get_current_page()
+            self.goto_page(page_main)
+            curPage = self.get_current_page()
         if curPage == page_main:
             self.exitGame()
 

+ 3 - 3
tasks/DailyTrifles/page.py

@@ -1,8 +1,8 @@
 from tasks.DailyTrifles.assets import DailyTriflesAssets
-from tasks.GameUi.assets import GameUiAssets
 from tasks.GameUi.page import Page, page_mall
+from tasks.GlobalGame.assets import GlobalGameAssets
 
 # 商店礼包屋页面
 page_store_gift_room = Page(DailyTriflesAssets.I_GIFT_RECOMMEND)
-page_store_gift_room.link(button=GameUiAssets.I_BACK_Y, destination=page_mall)
-page_mall.link(button=DailyTriflesAssets.I_ROOM_GIFT, destination=page_store_gift_room)
+page_store_gift_room.connect(page_mall, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_store_gift_room->page_mall")
+page_mall.connect(page_store_gift_room, DailyTriflesAssets.I_ROOM_GIFT, key="page_mall->page_store_gift_room")

+ 8 - 15
tasks/DailyTrifles/script_task.py

@@ -43,8 +43,7 @@ class ScriptTask(GameUi, Summon, DailyTriflesAssets):
         raise TaskEnd('DailyTrifles')
 
     def run_one_summon(self):
-        self.ui_get_current_page()
-        self.ui_goto(page_summon)
+        self.goto_page(page_summon)
         config=self.config.daily_trifles.trifles_config
         if config.summon_type == SummonType.default:
             self.summon_one(draw_mystery_pattern=config.draw_mystery_pattern)
@@ -82,10 +81,8 @@ class ScriptTask(GameUi, Summon, DailyTriflesAssets):
 
             for i in range(len(list)):
                 sleep(1)
-                self.ui_get_current_page()
-                self.ui_goto(page_main)
-                self.ui_get_current_page()
-                self.ui_goto(page_summon)
+                self.goto_page(page_main)
+                self.goto_page(page_summon)
                 self.appear_then_click(self.I_UI_BACK_RED, interval=1)
                 x, y = list[i].coord()
                 self.device.click(x, y)
@@ -154,8 +151,7 @@ class ScriptTask(GameUi, Summon, DailyTriflesAssets):
         pass
 
     def run_luck_msg(self):
-        self.ui_get_current_page()
-        self.ui_goto(page_friends)
+        self.goto_page(page_friends)
         while 1:
             self.screenshot()
             if self.appear(self.I_LUCK_TITLE):
@@ -184,8 +180,7 @@ class ScriptTask(GameUi, Summon, DailyTriflesAssets):
         self.ui_click(self.I_UI_BACK_RED, self.I_CHECK_MAIN)
 
     def run_friend_love(self):
-        self.ui_get_current_page()
-        self.ui_goto(page_friends)
+        self.goto_page(page_friends)
         while 1:
             self.screenshot()
             if self.appear(self.I_L_LOVE):
@@ -214,8 +209,7 @@ class ScriptTask(GameUi, Summon, DailyTriflesAssets):
         self.ui_click(self.I_UI_BACK_RED, self.I_CHECK_MAIN)
 
     def run_store(self):
-        self.ui_get_current_page()
-        self.ui_goto(page_mall, confirm_wait=3)
+        self.goto_page(page_mall, confirm_wait=3)
 
         if self.config.daily_trifles.trifles_config.store_sign:
             self.run_store_sign()
@@ -223,12 +217,11 @@ class ScriptTask(GameUi, Summon, DailyTriflesAssets):
             self.run_buy_sushi()
 
         self.ui_click(self.I_UI_BACK_YELLOW, self.I_CHECK_MALL, interval=2.4, timeout=8)
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
 
     def run_store_sign(self):
 
-        self.ui_goto_page(page_store_gift_room)
+        self.goto_page(page_store_gift_room)
         self.screenshot()
         self.appear_then_click(self.I_GIFT_RECOMMEND, interval=1)
         logger.info('Enter store sign')

+ 1 - 2
tasks/Delegation/script_task.py

@@ -17,8 +17,7 @@ from tasks.Delegation.assets import DelegationAssets
 class ScriptTask(GameUi, DelegationAssets):
 
     def run(self):
-        self.ui_get_current_page()
-        self.ui_goto(page_delegation)
+        self.goto_page(page_delegation)
         self.check_reward()
         con: DelegationConfig = self.config.delegation.delegation_config
         if con.miyoshino_painting:

+ 2 - 3
tasks/DemonEncounter/script_task.py

@@ -41,14 +41,13 @@ class ScriptTask(GameUi, GeneralBattle, DemonEncounterAssets, SwitchSoul):
         if not self.check_time():
             logger.warning('Time is not right')
             raise TaskEnd('DemonEncounter')
-        self.ui_get_current_page()
         # 切换御魂
         soul_config = self.config.demon_encounter.demon_soul_config
         best_soul_config = self.config.demon_encounter.best_demon_soul_config
         if soul_config.enable or best_soul_config.enable:
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.checkout_soul()
-        self.ui_goto(page_demon_encounter_realworld)
+        self.goto_page(page_demon_encounter_realworld)
         # 顶部"今日挑战次数:X/1"检测, 0/1表示今日已打过, 直接结束
         if self.check_challenge_done():
             logger.info('Challenge count 0/1, already challenged today')

+ 4 - 8
tasks/DemonRetreat/script_task.py

@@ -49,12 +49,10 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, DemonRetreatAssets, AbyssSha
             raise TaskEnd
 
         if cfg.switch_soul_config.enable:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul(cfg.switch_soul_config.switch_group_team)
         if cfg.switch_soul_config.enable_switch_by_name:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul_by_name(cfg.switch_soul_config.group_name, cfg.switch_soul_config.team_name)
 
         # 进入妖怪退治
@@ -105,9 +103,8 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, DemonRetreatAssets, AbyssSha
         进入首领退治
         """
         cfg: DemonRetreat = self.config.demon_retreat
-        self.ui_get_current_page()
         logger.info("Entering demon_retreat")
-        self.ui_goto(page_guild)
+        self.goto_page(page_guild)
 
         goto_demon_retreat_num = 0
         while 1:
@@ -262,9 +259,8 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, DemonRetreatAssets, AbyssSha
     def goto_main(self):
         ''' 保持好习惯,一个任务结束了就返回庭院,方便下一任务的开始或者是出错重启
         '''
-        self.ui_get_current_page()
         logger.info("Exiting DemonRetreat")
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
 
 
 

+ 1 - 2
tasks/Dokan/script_task.py

@@ -533,8 +533,7 @@ class ScriptTask(ExtendGreenMark, GameUi, SwitchSoul, DokanSceneDetector):
                 self.ui_click_until_disappear(self.I_RYOU_DOKAN, interval=1)
                 continue
             if not in_dokan:
-                self.ui_get_current_page()
-                self.ui_goto(page_guild)
+                self.goto_page(page_guild)
                 continue
         self.device.screenshot_interval_set()
         return True

+ 9 - 11
tasks/Duel/script_task.py

@@ -45,26 +45,26 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, DuelAssets, SwitchOnmyoji):
             self.screenshot()
             self.check_and_get_reward()
             if not self.duel_main():
-                self.ui_goto_page(page_duel)
+                self.goto_page(page_duel)
                 continue
             if not self.can_start_duel():
                 break
             self.start_duel()
         logger.info('Duel battle end')
         self.set_next_run(task='Duel', success=True, finish=True)
-        self.ui_goto_page(page_main)
+        self.goto_page(page_main)
         # 调起花合战
         self.set_next_run(task='TalismanPass', target=datetime.now())
         raise TaskEnd('Duel')
 
     def prepare_duel(self):
         """斗技准备工作(切换御魂or阴阳师...), 最后回到斗技主界面"""
-        self.ui_goto_page(page_main)
+        self.goto_page(page_main)
         self.switch_soul()
         if self.conf.duel_config.switch_enabled:
-            self.ui_goto_page(page_onmyodo)
+            self.goto_page(page_onmyodo)
             self.switch_onmyoji(self.conf.duel_config.switch_onmyoji)
-        self.ui_goto_page(page_duel)
+        self.goto_page(page_duel)
         self.switch_all_soul()
         self.current_score = self.conf.duel_celeb_config.initial_score
 
@@ -108,7 +108,7 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, DuelAssets, SwitchOnmyoji):
         logger.info(f'battle result: {battle_ret}')
         logger.info(f'battle count:{self.current_count} | win:{self.battle_win_count} failure:{self.battle_lose_count}')
         logger.info(f'battle time: {task_run_time_seconds} / {self.limit_time}')
-        self.ui_goto_page(page_duel)
+        self.goto_page(page_duel)
 
     def enter_battle(self):
         """点击开始战斗(一直到出现战斗准备界面)"""
@@ -174,7 +174,7 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, DuelAssets, SwitchOnmyoji):
                 ret_timer.reset()
                 continue
             if ret_timer.started() and ret_timer.reached():  # 兜底逻辑, 已经结算了但是还没有到斗技主界面
-                self.ui_goto_page(page_duel)
+                self.goto_page(page_duel)
                 break
             if self.is_battle_win():
                 ret = True
@@ -255,12 +255,10 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, DuelAssets, SwitchOnmyoji):
     def switch_soul(self):
         """从式神录界面切换御魂"""
         if self.conf.switch_soul.enable:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul(self.conf.switch_soul.switch_group_team)
         if self.conf.switch_soul.enable_switch_by_name:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul_by_name(self.conf.switch_soul.group_name, self.conf.switch_soul.team_name)
 
     def duel_main(self, screenshot=False) -> bool:

+ 4 - 8
tasks/DyeTrials/script_task.py

@@ -24,21 +24,17 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, DyeTrialsAssets):
 
         # 自动换御魂
         if cfg.switch_soul_config.enable:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul(cfg.switch_soul_config.switch_group_team)
         if cfg.switch_soul_config.enable_switch_by_name:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul_by_name(cfg.switch_soul_config.group_name, cfg.switch_soul_config.team_name)
 
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
 
         self.get_all()
 
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
 
         self.set_next_run(task='DyeTrials', success=True, finish=True)
         raise TaskEnd('DyeTrials')

+ 7 - 14
tasks/EternitySea/script_task.py

@@ -29,13 +29,11 @@ class ScriptTask(
 
     def _two_teams_switch_sous(self, config):
         if config.enable:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul(config.switch_group_team)
 
         if config.enable_switch_by_name:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul_by_name(config.group_name, config.team_name)
 
     def run(self) -> None:
@@ -135,8 +133,7 @@ class ScriptTask(
         # 永生之海选层界面无HOME按钮且页面系统识别不了, 点返回箭头回到御魂副本选择界面
         self._back_to_soul_zones()
 
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
 
         if not success:
             return False
@@ -166,7 +163,7 @@ class ScriptTask(
         timer = Timer(15).start()
         while not timer.reached():
             self.screenshot()
-            if self.ui_page_appear(page_soul_zones):
+            if self.match_page_once(page_soul_zones):
                 return
             if self.appear_then_click(self.I_GI_SURE, interval=1):
                 continue
@@ -180,7 +177,6 @@ class ScriptTask(
 
     def run_member(self):
         logger.info('Start run member')
-        self.ui_get_current_page()
         # self.ui_goto(page_soul_zones)
         # self.orochi_enter()
         # self.check_lock(self.config.orochi.general_battle_config.lock_team_enable)
@@ -222,8 +218,7 @@ class ScriptTask(
             if self.exit_battle():
                 pass
 
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
         return True
 
 
@@ -305,12 +300,10 @@ class ScriptTask(
                 continue
 
     def _navigate_to_soul_zones(self) -> None:
-        self.ui_get_current_page()
-        self.ui_goto(page_soul_zones)
+        self.goto_page(page_soul_zones)
 
     def _navigate_to_game_page(self, destination: Page) -> None:
-        self.ui_get_current_page()
-        self.ui_goto(destination)
+        self.goto_page(destination)
 
     @property
     def _task_config(self) -> EternitySea:

+ 8 - 17
tasks/EvoZone/script_task.py

@@ -31,16 +31,13 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
                                                seconds=limit_time.second)
         con = self.config.evo_zone
         if con.switch_soul_config.enable:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul(con.switch_soul_config.switch_group_team)
         if con.switch_soul_config.enable_switch_by_name:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul_by_name(con.switch_soul_config.group_name, con.switch_soul_config.team_name)
 
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
         config: EvoZone = self.config.evo_zone
         if config.evo_zone_config.soul_buff_enable:
             self.open_buff()
@@ -126,9 +123,8 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
 
     def run_leader(self):
         logger.info('Start run leader')
-        self.ui_get_current_page()
         # self.ui_goto(page_soul_zones)
-        self.ui_goto(page_awake_zones)
+        self.goto_page(page_awake_zones)
         self.evozone_enter()
         layer = self.config.evo_zone.evo_zone_config.layer
         logger.info("test0")
@@ -215,8 +211,7 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
         if self.exit_team():
             pass
 
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
 
         if not success:
             return False
@@ -224,7 +219,6 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
 
     def run_member(self):
         logger.info('Start run member')
-        self.ui_get_current_page()
         # self.ui_goto(page_soul_zones)
         # self.evozone_enter()
         # self.check_lock(self.config.evo_zone.general_battle_config.lock_team_enable)
@@ -269,14 +263,12 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
             if self.exit_battle():
                 pass
 
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
         return True
 
     def run_alone(self):
         logger.info('Start run alone')
-        self.ui_get_current_page()
-        self.ui_goto(page_awake_zones)
+        self.goto_page(page_awake_zones)
         self.evozone_enter()
         layer = self.config.evo_zone.evo_zone_config.layer
         self.check_layer(layer)
@@ -322,8 +314,7 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
             if self.appear_then_click(self.I_BACK_Y, interval=1):
                 continue
 
-        self.ui_current = page_awake_zones
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
 
     def run_wild(self):
         logger.error('Wild mode is not implemented')

+ 5 - 10
tasks/ExperienceYoukai/script_task.py

@@ -23,21 +23,18 @@ class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul,
     def run(self):
         # 切换御魂
         if self.config.experience_youkai.switch_soul.enable:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul(self.config.experience_youkai.switch_soul.switch_group_team)
 
         if self.config.experience_youkai.switch_soul.enable_switch_by_name:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul_by_name(self.config.experience_youkai.switch_soul.group_name,
                                          self.config.experience_youkai.switch_soul.team_name)
 
         # 开启加成
         con = self.config.experience_youkai.experience_youkai
         if con.buff_exp_50_click or con.buff_exp_100_click:
-            self.ui_get_current_page()
-            self.ui_goto(page_main)
+            self.goto_page(page_main)
             self.open_buff()
             if con.buff_exp_50_click:
                 self.exp_50()
@@ -46,8 +43,7 @@ class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul,
             self.close_buff()
         count = 0
         while count < 2:
-            self.ui_get_current_page()
-            self.ui_goto(page_team)
+            self.goto_page(page_team)
             self.check_zones('经验妖怪')
             # 开始
             if not self.create_room():
@@ -104,8 +100,7 @@ class ScriptTask(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, SwitchSoul,
                 return False
 
     def experience_exit(self, con):
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
         if con.buff_exp_50_click or con.buff_exp_100_click:
             self.open_buff()
             if con.buff_exp_50_click:

+ 3 - 1
tasks/Exploration/assets.py

@@ -107,8 +107,10 @@ class ExplorationAssets:
 	I_GET_REWARD = RuleImage(roi_front=(464,231,339,44), roi_back=(464,231,339,44), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_get_reward.png")
 	# description 
 	I_RED_CLOSE = RuleImage(roi_front=(1027,129,41,42), roi_back=(1021,121,54,55), threshold=0.6, method="Template matching", file="./tasks/Exploration/res/res_red_close.png")
-	# description 
+	# description
 	I_E_EXIT_CONFIRM = RuleImage(roi_front=(694,380,163,49), roi_back=(694,380,163,49), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_e_exit_confirm.png")
+	# 探索章节切换文件夹图标(移植自mine)
+	I_E_OPEN_FOLDER = RuleImage(roi_front=(1241,114,22,28), roi_back=(1212,88,68,123), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_e_open_folder.png")
 	# 宝箱 
 	I_TREASURE_BOX_CLICK = RuleImage(roi_front=(31,543,27,24), roi_back=(11,520,378,65), threshold=0.65, method="Template matching", file="./tasks/Exploration/res/res_treasure_box_click.png")
 	# 困28滚动到最后 

+ 6 - 11
tasks/Exploration/base.py

@@ -89,21 +89,18 @@ class BaseExploration(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, Replace
     def pre_process(self):
         explorationConfig = self._config
         if explorationConfig.switch_soul_config.enable:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul(explorationConfig.switch_soul_config.switch_group_team)
 
         if explorationConfig.switch_soul_config.enable_switch_by_name:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul_by_name(explorationConfig.switch_soul_config.group_name,
                                          explorationConfig.switch_soul_config.team_name)
 
         # 开启加成
         con = self.config.exploration.exploration_config
         if con.buff_gold_50_click or con.buff_gold_100_click or con.buff_exp_50_click or con.buff_exp_100_click:
-            self.ui_get_current_page()
-            self.ui_goto(page_main)
+            self.goto_page(page_main)
             self.open_buff()
             if con.buff_gold_50_click:
                 self.gold_50()
@@ -115,16 +112,14 @@ class BaseExploration(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, Replace
                 self.exp_100()
             self.close_buff()
 
-        self.ui_get_current_page()
         # 探索页面
-        self.ui_goto(page_exploration)
+        self.goto_page(page_exploration)
 
     def post_process(self):
         self.wait_until_stable(self.I_UI_BACK_RED)
         if self.appear(self.I_UI_BACK_RED):
             self.ui_click_until_disappear(self.I_UI_BACK_RED)
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
         con = self._config.exploration_config
         if con.buff_gold_50_click or con.buff_gold_100_click or con.buff_exp_50_click or con.buff_exp_100_click:
             self.open_buff()
@@ -356,7 +351,7 @@ class BaseExploration(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, Replace
             self.ui_click_until_disappear(self.I_UI_CANCEL)
         if self.appear(self.I_UI_CANCEL_SAMLL):
             self.ui_click_until_disappear(self.I_UI_CANCEL_SAMLL)
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
         if con.buff_gold_50_click or con.buff_gold_100_click or con.buff_exp_50_click or con.buff_exp_100_click:
             self.open_buff()
             self.gold_50(is_open=False)

+ 10 - 1
tasks/Exploration/res/image.json

@@ -241,5 +241,14 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "战斗中的队友标识"
+  },
+  {
+    "itemName": "e_open_folder",
+    "imageName": "res_e_open_folder.png",
+    "roiFront": "1241,114,22,28",
+    "roiBack": "1212,88,68,123",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索章节切换文件夹图标(移植自mine)"
   }
-]
+]

BIN
tasks/Exploration/res/res_e_open_folder.png


+ 4 - 17
tasks/FallenSun/script_task.py

@@ -25,14 +25,12 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
     def run(self) -> bool:
         # 御魂切换方式一
         if self.config.fallen_sun.switch_soul.enable:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul(self.config.fallen_sun.switch_soul.switch_group_team)
 
         # 御魂切换方式二
         if self.config.fallen_sun.switch_soul.enable_switch_by_name:
-            self.ui_get_current_page()
-            self.ui_goto(page_shikigami_records)
+            self.goto_page(page_shikigami_records)
             self.run_switch_soul_by_name(self.config.fallen_sun.switch_soul.group_name,
                                          self.config.fallen_sun.switch_soul.team_name)
 
@@ -42,8 +40,6 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
         self.limit_count: int = limit_count
         self.limit_time: timedelta = timedelta(hours=limit_time.hour, minutes=limit_time.minute, seconds=limit_time.second)
 
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
         config: FallenSun = self.config.fallen_sun
 
         success = True
@@ -105,8 +101,7 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
 
     def run_leader(self):
         logger.info('Start run leader')
-        self.ui_get_current_page()
-        self.ui_goto(page_soul_zones)
+        self.goto_page(page_soul_zones)
         self.fallen_sun_enter()
         layer = self.config.fallen_sun.fallen_sun_config.layer
         self.check_layer(layer)
@@ -190,8 +185,6 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
         if self.exit_team():
             pass
 
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
 
         if not success:
             return False
@@ -199,7 +192,6 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
 
     def run_member(self):
         logger.info('Start run member')
-        self.ui_get_current_page()
         # self.ui_goto(page_soul_zones)
         # self.fallen_sun_enter()
         # self.check_lock(self.config.fallen_sun.general_battle_config.lock_team_enable)
@@ -245,14 +237,11 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
                 pass
 
 
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
         return True
 
     def run_alone(self):
         logger.info('Start run alone')
-        self.ui_get_current_page()
-        self.ui_goto(page_soul_zones)
+        self.goto_page(page_soul_zones)
         self.fallen_sun_enter()
         layer = self.config.fallen_sun.fallen_sun_config.layer
         self.check_layer(layer)
@@ -300,8 +289,6 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
             if self.appear_then_click(self.I_UI_BACK_YELLOW, interval=2):
                 continue
 
-        self.ui_current = page_soul_zones
-        self.ui_goto(page_main)
 
     def run_wild(self):
         logger.error('Wild mode is not implemented')

+ 1 - 2
tasks/FloatParade/script_task.py

@@ -41,8 +41,7 @@ class ScriptTask(RightActivity, FloatParadeAssets, TalismanPassAssets):
         self.get_flower(con.level_reward1, con.level_reward2) # 第一种
 
         # main page
-        self.ui_get_current_page()
-        self.ui_goto(page_main)
+        self.goto_page(page_main)
 
         self.set_next_run(task='FloatParade', success=True, finish=True)
         raise TaskEnd('FloatParade')

+ 347 - 0
tasks/GameUi/USAGE.md

@@ -0,0 +1,347 @@
+# GameUi 使用说明
+
+## 模块结构
+
+- `game_ui.py`
+  公开导出 `GameUi`、`NavigatorSession`、`Page`,供任务继续按旧导入路径使用。
+- `page.py`
+  公开导出 `Page`、`Transition`、组合 matcher、组合 action,以及所有全局页面定义。
+- `common.py`
+  共享类型与内部工具函数。
+- `matcher.py`
+  页面识别条件组合器。
+- `action.py`
+  页面跳转动作与 hook 动作组合器。
+- `page_definition.py`
+  `Page` 与 `Transition` 的核心定义。
+- `registry.py`
+  进程级静态页面注册表。
+- `session.py`
+  任务级导航 session,保存页面快照、边惩罚、局部未知页关闭规则。
+- `navigator.py`
+  `GameUi` 导航引擎实现。
+- `default_pages.py`
+  全局页面定义。
+
+## 新版 Page 怎么定义
+
+### 1. 最基础的页面
+
+```python
+from tasks.GameUi.page import Page
+from tasks.SomeTask.assets import SomeTaskAssets
+
+page_some_main = Page(SomeTaskAssets.I_CHECK_MAIN)
+```
+
+说明:
+
+- 第一个参数是页面识别条件 `recognizer`
+- 可以直接传 `RuleImage`、`RuleGif`、`RuleOcr`
+- 不显式传 `category` 时,会根据文件路径自动推断
+- `priority` 默认是 `50`,范围 `1-100`,值越大在多页面同时命中时越优先返回
+- `tasks/GameUi` 下定义的页面默认分类为 `global`
+
+### 1.1 页面优先级
+
+```python
+page_result = Page(
+    SomeAssets.I_CHECK_RESULT,
+    priority=70,
+)
+```
+
+说明:
+
+- `priority` 仅影响“多个页面在同一帧同时命中”时的返回顺序
+- 系统会按 `priority` 降序判定;同优先级保持 session 注册顺序稳定
+- 超出 `1-100` 时会自动 clamp,并输出 warning 日志
+- 运行时修改 `session` 页面副本的 `priority`,不会污染全局注册表
+
+### 2. 识别条件可以组合
+
+```python
+from tasks.GameUi.page import Page, any_of, all_of, not_
+
+page_reward = Page(
+    any_of(
+        SomeAssets.I_REWARD_A,
+        SomeAssets.I_REWARD_B,
+    )
+)
+```
+
+可用组合器:
+
+- `any_of(...)`
+  任一条件命中即可
+- `all_of(...)`
+  所有条件都命中才成功
+- `not_(...)`
+  对条件取反
+
+### 3. 识别条件可以使用自定义函数
+
+```python
+def check_custom(task) -> bool:
+    return task.appear(SomeAssets.I_CHECK_MAIN) and not task.appear(SomeAssets.I_DIALOG)
+
+
+page_custom = Page(check_custom)
+```
+
+说明:
+
+- 自定义函数会收到当前运行时的 `task`
+- 可以直接调用当前任务对象上的所有公开方法
+- 返回值必须是布尔值
+
+### 4. 页面 hook
+
+```python
+page_main.add_enter_success_hooks(
+    SomeAssets.I_CLOSE_DIALOG,
+    lambda task: task.click(SomeAssets.C_SAFE_AREA, interval=0.5),
+)
+```
+
+页面支持 4 个阶段:
+
+- `on_enter_success`
+  成功进入该页面后触发
+- `on_enter_failure`
+  尝试进入该页面失败后触发
+- `on_leave_success`
+  成功离开该页面后触发
+- `on_leave_failure`
+  尝试离开该页面失败后触发
+
+可用写法:
+
+- `page.add_enter_success_hooks(...)`
+- `page.add_enter_failure_hooks(...)`
+- `page.add_leave_success_hooks(...)`
+- `page.add_leave_failure_hooks(...)`
+
+旧版 `additional` 的语义,等价于新版 `on_enter_success`。
+
+### 5. 页面跳转边
+
+```python
+page_main.connect(page_shop, SomeAssets.I_GOTO_SHOP, key="page_main->page_shop")
+page_shop.connect(page_main, SomeAssets.I_BACK_Y, key="page_shop->page_main")
+```
+
+说明:
+
+- `connect(destination, action, ...)` 用来声明一条有向边
+- `action` 是执行跳转时的动作
+- 推荐为边显式提供稳定的 `key`
+- 可以为边单独定义四阶段 hook
+
+### 6. 动作组合
+
+```python
+from tasks.GameUi.page import sequence, conditional_action
+
+page_main.connect(
+    page_event,
+    sequence(SomeAssets.I_OPEN_PANEL, SomeAssets.I_GOTO_EVENT),
+    key="page_main->page_event",
+)
+
+page_event.add_enter_success_hooks(
+    conditional_action(SomeAssets.I_POPUP, SomeAssets.I_CLOSE_POPUP)
+)
+```
+
+可用组合器:
+
+- `sequence(...)`
+  顺序执行多个动作
+- `conditional_action(condition, action)`
+  只有条件命中时才执行动作
+
+## 页面分类规则
+
+- `tasks/GameUi` 内定义的页面默认属于 `global`
+- 其他任务的 `page.py` / `inner_page.py` 页面默认按任务目录名归类
+- 导航到目标页面时:
+  构图使用 `当前页面分类 + 目标页面分类 + global`
+- 当前页面未知时:
+  构图回退为 `目标页面分类 + global`
+- 识别当前页时:
+  使用 `当前任务分类 + 目标页面分类 + global`
+
+这意味着:
+
+- 全局页面可作为所有任务的公共中转页
+- 不同任务页面不会在同一轮导航中互相污染
+
+## 新公共方法
+
+### `pages_in_category(category)`
+
+```python
+battle_pages = self.pages_in_category("battle")
+```
+
+说明:
+
+- 返回当前 task session 内指定分类的页面副本列表
+- 不会触发截图、识别或任何点击
+- 调用方可以安全修改返回页面的 `priority` / `recognizer`
+
+### `detect_page_in(*targets, include_global=True)`
+
+```python
+self.detect_page_in("battle")
+self.detect_page_in("battle", "exploration")
+self.detect_page_in("battle", include_global=False)
+self.detect_page_in(page_battle_prepare, page_battle_result, include_global=False)
+```
+
+说明:
+
+- `targets` 可以传分类字符串,也可以直接传 `Page`
+- 使用与 `get_current_page()` 相同的“两帧稳定识别”逻辑
+- 默认自动把 `global` 加入识别范围,便于识别意外弹回主页等全局页面
+- 只传 `Page` 时,仅在这些显式页面副本中识别
+- 传 `include_global=False` 时,只在显式给定分类内识别
+- 多个候选同时命中时,同样按 `priority` 降序返回
+
+## 动态页面怎么写
+
+动态页面不要直接注册到全局表,必须只放在当前任务 session 中。
+
+```python
+from tasks.GameUi.page import Page
+
+page_dynamic = self.navigator.add_page(
+    Page(
+        self.I_CHECK_DYNAMIC,
+        key="page_dynamic",
+        name="page_dynamic",
+        register=False,
+    )
+)
+```
+
+说明:
+
+- `register=False`
+  表示不要进入全局 `PageRegistry`
+- `self.navigator.add_page(...)`
+  表示把该页面加入当前任务 session
+- 动态页的跳转边也应该只连接到 session 页面对象
+
+## 运行时改链怎么做
+
+如果任务需要临时修改页面图,不要改全局定义,必须改当前 session 副本。
+
+```python
+page_main = self.navigator.resolve_page(pages.page_main)
+page_records = self.navigator.resolve_page(pages.page_shikigami_records)
+
+page_main.remove_transition(key="page_main->page_shikigami_records")
+page_records.clear_transitions()
+page_records.connect(page_main, self.I_BACK_Y, key="page_shikigami_records->page_main")
+```
+
+说明:
+
+- `resolve_page(...)` 会把静态页面定义解析成当前任务 session 中的页面副本
+- 所有运行时改链都只改 session,不会污染别的任务
+
+## 未知页关闭规则怎么加
+
+```python
+self.navigator.add_unknown_closer(self.I_CUSTOM_CLOSE)
+```
+
+说明:
+
+- 任务级规则会优先于全局默认规则执行
+- 只在当前任务 session 生效
+- 任务结束后自动失效
+
+## goto_page 的流程是什么
+
+`goto_page(destination)` 的执行流程如下:
+
+1. 先把 `destination` 解析成当前任务 session 中的页面对象
+2. 优先确认缓存的 `current_page` 是否仍然成立
+3. 如果缓存页失效,则在允许分类集合里做两帧稳定识别
+4. 如果当前页未知:
+   - 先尝试 `close_unknown_pages()`
+   - 成功则重置无进展超时计时器
+   - 失败且超过超时则抛 `GamePageUnknownError`
+5. 如果当前页就是目标页:
+   - 再做一次两帧稳定确认
+   - 成功后触发进入成功 hook,并打印到达日志
+6. 如果当前页不是目标页:
+   - 在 `当前页分类 + 目标分类 + global` 图中运行 Dijkstra
+   - 计算代价 = 页面 cost + 边 cost + 边失败惩罚
+7. 如果能构建路径:
+   - 按最小总代价路径执行每一条边
+   - 每次成功推进到下一页,都重置无进展超时
+8. 如果某条边执行失败:
+   - 触发页面/边的失败 hook
+   - 给该边增加惩罚
+   - 重新识别当前页并重新规划路径
+   - 如果同一条边连续失败 3 次,则额外主动尝试一次 `close_unknown_pages()`
+   - 主动关闭成功才重置无进展超时;关闭 miss 仍沿用原有惩罚、重规划和超时链路
+9. 如果连续 `timeout` 秒没有任何有效进展:
+   - 输出当前页、目标页、候选页命中结果、重复失败边、连续失败次数、边惩罚、未知页关闭历史等诊断日志
+   - 抛出 `GamePageUnknownError`
+
+## 页面判定规则
+
+- 当前页识别:
+  连续 2 帧命中才算成功
+- 页面进入成功:
+  连续 2 帧识别到目标页面才算成功
+- 页面离开成功:
+  以识别到下一页面为准,不是以“动作已经点击”为准
+
+## 推荐写法
+
+### 静态任务页面
+
+```python
+from tasks.GameUi.page import Page, page_main
+
+page_my_task = Page(MyAssets.I_CHECK_MAIN)
+page_main.connect(page_my_task, MyAssets.I_ENTER, key="page_main->page_my_task")
+page_my_task.connect(page_main, MyAssets.I_BACK, key="page_my_task->page_main")
+```
+
+### 任务运行
+
+```python
+class ScriptTask(GameUi, MyAssets):
+    def run(self):
+        self.goto_page(page_my_task)
+```
+
+### 动态页 + 运行时改链
+
+```python
+class ScriptTask(GameUi, MyAssets):
+    def before_run(self):
+        self.page_dynamic = self.navigator.add_page(
+            Page(self.I_CHECK_DYNAMIC, key="page_dynamic", name="page_dynamic", register=False)
+        )
+        page_main = self.navigator.resolve_page(pages.page_main)
+        page_main.connect(self.page_dynamic, self.I_ENTER_DYNAMIC, key="page_main->page_dynamic")
+```
+
+## 注意事项
+
+- 不要再使用旧接口:
+  `ui_goto`、`ui_goto_page`、`ui_get_current_page`、`try_close_unknown_page`、`run_additional`
+- 不要再直接操作旧运行时字段:
+  `ui_current`、`ui_close`、`links`
+- 动态页一定要使用 `register=False`
+- 任务级改链一定要通过 `self.navigator.resolve_page(...)` 获取 session 页面后再修改
+- 如果页面是临时弹层,优先写成进入成功 hook 或未知页关闭规则,不要把它误建成主导航页面

+ 68 - 0
tasks/GameUi/action.py

@@ -0,0 +1,68 @@
+from __future__ import annotations
+
+"""页面动作与 hook 动作的组合器。"""
+
+from dataclasses import dataclass
+
+from tasks.GameUi.common import ActionLike, RecognizerLike
+from tasks.GameUi.matcher import Matcher, ensure_matcher
+
+
+@dataclass(frozen=True)
+class ActionSequence:
+    """顺序执行的一组动作。
+
+    Attributes:
+        actions: 按顺序执行的动作集合。
+        success_index: 使用哪个动作的执行结果作为整个序列的成功判定。
+    """
+
+    actions: tuple[ActionLike, ...]
+    success_index: int = 0
+
+
+@dataclass(frozen=True)
+class ConditionalAction:
+    """带前置条件的动作包装器。
+
+    Attributes:
+        condition: 需要先命中的识别条件。
+        action: 条件满足后执行的动作。
+    """
+
+    condition: Matcher
+    action: ActionLike
+
+
+def sequence(*actions: ActionLike, success_index: int = 0) -> ActionSequence:
+    """创建一个顺序动作序列。
+
+    Args:
+        *actions: 需要顺序执行的动作。
+        success_index: 作为整体成功判定的动作索引。
+
+    Returns:
+        `ActionSequence` 实例。
+    """
+
+    return ActionSequence(tuple(actions), success_index=success_index)
+
+
+def conditional_action(condition: RecognizerLike | Matcher, action: ActionLike) -> ConditionalAction:
+    """创建带条件的动作。
+
+    Args:
+        condition: 前置识别条件。
+        action: 条件满足后执行的动作。
+
+    Returns:
+        `ConditionalAction` 实例。
+
+    Raises:
+        ValueError: 当条件为空时抛出。
+    """
+
+    matcher = ensure_matcher(condition)
+    if matcher is None:
+        raise ValueError("conditional_action requires a valid condition")
+    return ConditionalAction(matcher, action)

+ 3 - 3
tasks/GameUi/additional/act.json

@@ -11,10 +11,10 @@
   {
     "itemName": "act_list_expand",
     "imageName": "additional_act_list_expand.png",
-    "roiFront": "1191,508,30,25",
-    "roiBack": "1160,456,92,103",
+    "roiFront": "1186,141,40,41",
+    "roiBack": "1162,110,92,103",
     "method": "Template matching",
     "threshold": 0.8,
-    "description": "description"
+    "description": "庭院进入活动标志"
   }
 ]

BIN
tasks/GameUi/additional/additional_act_list_expand.png


BIN
tasks/GameUi/additional/additional_close_chat_window.png


+ 0 - 20
tasks/GameUi/additional/daily.json

@@ -1,20 +0,0 @@
-[
-  {
-    "itemName": "click_close_1",
-    "roiFront": "521,659,232,32",
-    "roiBack": "521,659,232,32",
-    "mode": "Single",
-    "method": "Default",
-    "keyword": "点击空白处关闭此界面",
-    "description": "点击空白处关闭此界面"
-  },
-  {
-    "itemName": "click_close_2",
-    "roiFront": "508,584,214,40",
-    "roiBack": "508,584,214,40",
-    "mode": "Single",
-    "method": "Default",
-    "keyword": "点击空白处关闭弹窗",
-    "description": "点击空白处关闭弹窗"
-  }
-]

+ 0 - 11
tasks/GameUi/additional/guild.json

@@ -1,11 +0,0 @@
-[
-  {
-    "itemName": "close_chat_window",
-    "imageName": "additional_close_chat_window.png",
-    "roiFront": "653,397,18,18",
-    "roiBack": "653,397,18,18",
-    "method": "Template matching",
-    "threshold": 0.91,
-    "description": "关闭聊天窗口"
-  }
-]

+ 0 - 20
tasks/GameUi/additional/records.json

@@ -1,20 +0,0 @@
-[
-  {
-    "itemName": "ad_disappear",
-    "imageName": "additional_ad_disappear.png",
-    "roiFront": "412,405,37,40",
-    "roiBack": "412,405,37,40",
-    "method": "Template matching",
-    "threshold": 0.75,
-    "description": "description"
-  },
-  {
-    "itemName": "records_close",
-    "imageName": "additional_records_close.png",
-    "roiFront": "914,143,30,30",
-    "roiBack": "914,143,30,30",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "description"
-  }
-]

+ 149 - 202
tasks/GameUi/assets.py

@@ -10,23 +10,13 @@ from module.atom.list import RuleList
 class GameUiAssets: 
 
 
-	# Image Rule Assets
-	# description 
-	I_PAPER_DOLL_CLOSE = RuleImage(roi_front=(1253,102,25,62), roi_back=(1238,58,40,153), threshold=0.8, method="Template matching", file="./tasks/GameUi/additional/additional_paper_doll_close.png")
-	# description 
-	I_ACT_LIST_EXPAND = RuleImage(roi_front=(1191,508,30,25), roi_back=(1160,456,92,103), threshold=0.8, method="Template matching", file="./tasks/GameUi/additional/additional_act_list_expand.png")
-
-
-	# Ocr Rule Assets
-	# 点击空白处关闭此界面 
-	O_CLICK_CLOSE_1 = RuleOcr(roi=(521,659,232,32), area=(521,659,232,32), mode="Single", method="Default", keyword="点击空白处关闭此界面", name="click_close_1")
-	# 点击空白处关闭弹窗 
-	O_CLICK_CLOSE_2 = RuleOcr(roi=(508,584,214,40), area=(508,584,214,40), mode="Single", method="Default", keyword="点击空白处关闭弹窗", name="click_close_2")
 
 
 	# Image Rule Assets
-	# 关闭聊天窗口 
-	I_CLOSE_CHAT_WINDOW = RuleImage(roi_front=(653,397,18,18), roi_back=(653,397,18,18), threshold=0.91, method="Template matching", file="./tasks/GameUi/additional/additional_close_chat_window.png")
+	# description 
+	I_PAPER_DOLL_CLOSE = RuleImage(roi_front=(1253,102,25,62), roi_back=(1238,58,40,153), threshold=0.8, method="Template matching", file="./tasks/GameUi/additional/additional_paper_doll_close.png")
+	# 庭院进入活动标志 
+	I_ACT_LIST_EXPAND = RuleImage(roi_front=(1186,141,40,41), roi_back=(1162,110,92,103), threshold=0.8, method="Template matching", file="./tasks/GameUi/additional/additional_act_list_expand.png")
 
 
 	# Image Rule Assets
@@ -35,78 +25,155 @@ class GameUiAssets:
 
 
 	# Image Rule Assets
-	# description 
-	I_AD_DISAPPEAR = RuleImage(roi_front=(412,405,37,40), roi_back=(412,405,37,40), threshold=0.75, method="Template matching", file="./tasks/GameUi/additional/additional_ad_disappear.png")
-	# description 
-	I_RECORDS_CLOSE = RuleImage(roi_front=(914,143,30,30), roi_back=(914,143,30,30), threshold=0.7, method="Template matching", file="./tasks/GameUi/additional/additional_records_close.png")
+	# 活动列表页前往活动 
+	I_ACT_LIST_GOTO_ACT = RuleImage(roi_front=(1063,627,156,60), roi_back=(1007,552,272,166), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_act_list_goto_act.png")
+	# 活动列表页标志 
+	I_CHECK_ACT_LIST = RuleImage(roi_front=(112,13,125,44), roi_back=(75,3,205,66), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_act_list.png")
 
 
 	# Image Rule Assets
-	# description 
-	I_CHECK_MAIN = RuleImage(roi_front=(807,108,76,45), roi_back=(49,98,1033,61), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_main.png")
-	# 庭院卷轴关闭标识 
-	I_MAIN_SCROLL_CLOSE = RuleImage(roi_front=(1181,634,28,39), roi_back=(1162,595,77,112), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_scroll_close.png")
-	# description 
-	I_MAIN_GOTO_EXPLORATION = RuleImage(roi_front=(493,116,45,75), roi_back=(243,100,933,211), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_exploration.png")
-	# description 
-	I_CHECK_EXPLORATION = RuleImage(roi_front=(681,12,27,36), roi_back=(661,0,70,61), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_check_exploration.png")
+	# 探索界面标识 
+	I_CHECK_EXPLORATION = RuleImage(roi_front=(1152,148,21,22), roi_back=(1152,148,21,22), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_exploration.png")
 	# 探索前往觉醒 
-	I_EXPLORATION_GOTO_AWAKE_ZONE = RuleImage(roi_front=(65,632,50,41), roi_back=(33,619,1125,98), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_awake_zone.png")
+	I_EXPLORATION_GOTO_AWAKE_ZONE = RuleImage(roi_front=(161,633,47,44), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_awake_zone.png")
 	# 探索前往御魂 
-	I_EXPLORATION_GOTO_SOUL_ZONE = RuleImage(roi_front=(165,639,44,36), roi_back=(38,621,1106,98), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_soul_zone.png")
+	I_EXPLORATION_GOTO_SOUL_ZONE = RuleImage(roi_front=(69,633,46,39), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_soul_zone.png")
 	# 探索前往结界突破 
-	I_EXPLORATION_GOTO_REALM_RAID = RuleImage(roi_front=(263,636,51,46), roi_back=(42,618,1103,100), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_realm_raid.png")
+	I_EXPLORATION_GOTO_REALM_RAID = RuleImage(roi_front=(354,636,49,38), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_realm_raid.png")
 	# 探索前往御灵 
-	I_EXPLORATION_GOTO_GORYOU_REALM = RuleImage(roi_front=(353,639,47,45), roi_back=(49,613,1107,105), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_goryou_realm.png")
+	I_EXPLORATION_GOTO_GORYOU_REALM = RuleImage(roi_front=(353,639,47,45), roi_back=(33,619,1150,99), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_goryou_realm.png")
 	# 探索前往式神委派 
-	I_EXPLORATION_GOTO_DELEGATION = RuleImage(roi_front=(453,639,53,37), roi_back=(43,609,1107,107), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_delegation.png")
+	I_EXPLORATION_GOTO_DELEGATION = RuleImage(roi_front=(448,634,54,39), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_delegation.png")
 	# 探索前往秘闻 
-	I_EXPLORATION_GOTO_SECRET_ZONES = RuleImage(roi_front=(549,633,53,40), roi_back=(44,617,1102,99), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_secret_zones.png")
+	I_EXPLORATION_GOTO_SECRET_ZONES = RuleImage(roi_front=(546,635,51,42), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_secret_zones.png")
+	# 探索前往英杰试炼 
+	I_EXPLORATION_GOTO_HERO_TEST = RuleImage(roi_front=(829,634,58,56), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_hero_test.png")
 	# 探索前往地域鬼王 
-	I_EXPLORATION_GOTO_AREA_BOSS = RuleImage(roi_front=(640,638,51,45), roi_back=(33,622,1103,90), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_area_boss.png")
+	I_EXPLORATION_GOTO_AREA_BOSS = RuleImage(roi_front=(642,638,50,38), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_area_boss.png")
 	# 探索前往平安奇谭 
-	I_EXPLORATION_GOTO_HEIAN_KITAN = RuleImage(roi_front=(739,643,52,44), roi_back=(35,615,1097,102), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_heian_kitan.png")
-	# 探索前往六道之门 
-	I_EXPLORATION_GOTO_SIX_GATES = RuleImage(roi_front=(529,679,93,30), roi_back=(46,618,1090,100), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_six_gates.png")
+	I_EXPLORATION_GOTO_HEIAN_KITAN = RuleImage(roi_front=(739,643,52,44), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_heian_kitan.png")
 	# 探索前往契灵之境 
-	I_EXPLORATION_GOTO_BONDLING_FAIRYLAND = RuleImage(roi_front=(1032,634,46,50), roi_back=(41,619,1104,96), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_bondling_fairyland.png")
-	# description 
-	I_BACK_BLUE = RuleImage(roi_front=(32,37,54,52), roi_back=(3,2,130,114), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_blue.png")
-	# description 
-	I_CHECK_AWAKE = RuleImage(roi_front=(164,534,42,41), roi_back=(124,524,197,119), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_awake.png")
-	# description 
-	I_CHECK_SOUL_ZONES = RuleImage(roi_front=(1193,636,40,40), roi_back=(1131,591,149,128), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_soul_zones.png")
-	# description 
+	I_EXPLORATION_GOTO_BONDLING_FAIRYLAND = RuleImage(roi_front=(1024,635,52,47), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_bondling_fairyland.png")
+	# 觉醒页面标志(必须在下方,觉醒页面有动画加载) 
+	I_CHECK_AWAKE = RuleImage(roi_front=(165,533,39,45), roi_back=(115,521,201,120), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_awake.png")
+	# 八岐大蛇页面标志(同觉醒逻辑back固定刚好等待加载动画) 
+	I_CHECK_SOUL_ZONES = RuleImage(roi_front=(1188,635,48,46), roi_back=(1158,616,103,93), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_soul_zones.png")
+	# 个人突破页面标志 
 	I_CHECK_REALM_RAID = RuleImage(roi_front=(129,632,52,48), roi_back=(66,526,233,188), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_check_realm_raid.png")
-	# description 
-	I_CHECK_GORYOU = RuleImage(roi_front=(881,17,30,39), roi_back=(881,17,30,39), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_goryou.png")
-	# description 
+	# 英杰试炼页面标志 
+	I_CHECK_HERO_TEST = RuleImage(roi_front=(148,10,133,48), roi_back=(137,0,157,71), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_hero_test.png")
+	# 御灵页面标志 
+	I_CHECK_GORYOU = RuleImage(roi_front=(880,8,30,39), roi_back=(880,8,30,39), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_goryou.png")
+	# 委派页面标志 
 	I_CHECK_DELEGATION = RuleImage(roi_front=(839,132,49,45), roi_back=(839,132,49,45), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_delegation.png")
-	# description 
+	# 秘闻页面标志 
 	I_CHECK_SECRET_ZONES = RuleImage(roi_front=(1145,592,110,119), roi_back=(1145,592,110,119), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_secret_zones.png")
-	# description 
+	# 地鬼页面标志 
 	I_CHECK_AREA_BOSS = RuleImage(roi_front=(20,320,150,130), roi_back=(20,320,150,130), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_area_boss.png")
-	# description 
+	# 平安奇谭页面标志 
 	I_CHECK_HEIAN_KITAN = RuleImage(roi_front=(27,48,47,39), roi_back=(27,48,47,39), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_heian_kitan.png")
-	# 六道之门检查 
-	I_CHECK_SIX_GATES = RuleImage(roi_front=(411,297,21,21), roi_back=(395,262,54,85), threshold=0.85, method="Template matching", file="./tasks/GameUi/page/page_check_six_gates.png")
-	# description 
-	I_CHECK_BONDLING_FAIRYLAND = RuleImage(roi_front=(614,660,56,49), roi_back=(614,660,56,49), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_bondling_fairyland.png")
-	# description 
-	I_SIX_GATES_GOTO_EXPLORATION = RuleImage(roi_front=(18,19,52,55), roi_back=(18,19,52,55), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_six_gates_goto_exploration.png")
-	# description 
-	I_BONDLING_GOTO_EXPLORATION = RuleImage(roi_front=(20,13,60,59), roi_back=(20,13,60,59), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_bondling_goto_exploration.png")
-	# description 
+	# 契灵页面标志 
+	I_CHECK_BONDLING_FAIRYLAND = RuleImage(roi_front=(614,660,56,49), roi_back=(582,630,130,90), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_bondling_fairyland.png")
+	# 寮突切换到个突按钮 
 	I_RYOUTOPPA_GOTO_REALMRAID = RuleImage(roi_front=(1201,234,62,105), roi_back=(1201,234,62,105), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_ryoutoppa_goto_realmraid.png")
+	# 寮突页面标志 
+	I_KEKKAI_TOPPA = RuleImage(roi_front=(1065,3,203,61), roi_back=(1065,3,203,61), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_kekkai_toppa.png")
+	# 突破进入式神录按钮 
+	I_REALM_RAID_GOTO_SHIKIGAMI_RECORDS = RuleImage(roi_front=(1208,610,45,44), roi_back=(1166,520,112,198), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_realm_raid_goto_shikigami_records.png")
+	# 探索前往月之海 
+	I_EXPLORATION_TO_MOON_SEA = RuleImage(roi_front=(930,635,49,44), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_to_moon_sea.png")
+	# 探索前往香行域 
+	I_EXPLORATION_TO_INCENSE_REALM = RuleImage(roi_front=(930,635,49,44), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_to_incense_realm.png")
+	# 探索前往错季森 
+	I_EXPLORATION_TO_SEASONRIFT_FOREST = RuleImage(roi_front=(930,635,49,44), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_to_seasonrift_forest.png")
+	# 探索前往净佛刹 
+	I_EXPLORATION_TO_PURE_BUDDHA_REALM = RuleImage(roi_front=(930,635,49,44), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_to_pure_buddha_realm.png")
+	# 探索前往真言塔 
+	I_EXPLORATION_TO_MANTRA_TOWER = RuleImage(roi_front=(930,635,49,44), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_to_mantra_tower.png")
+	# 探索前往孔雀国 
+	I_EXPLORATION_TO_PEACOCK_KINGDOM = RuleImage(roi_front=(930,635,49,44), roi_back=(33,619,1150,99), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_to_peacock_kingdom.png")
+	# 月之海标志 
+	I_CHECK_MOON_SEA = RuleImage(roi_front=(347,163,29,106), roi_back=(296,117,165,256), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_moon_sea.png")
+	# 香行域标志 
+	I_CHECK_INCENSE_REALM = RuleImage(roi_front=(347,163,29,106), roi_back=(296,117,165,256), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_incense_realm.png")
+	# 错季森标志 
+	I_CHECK_SEASONRIFT_FOREST = RuleImage(roi_front=(348,158,30,106), roi_back=(296,117,165,256), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_seasonrift_forest.png")
+	# 净佛刹标志 
+	I_CHECK_PURE_BUDDHA_REALM = RuleImage(roi_front=(348,158,30,106), roi_back=(296,117,165,256), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_pure_buddha_realm.png")
+	# 真言塔标志 
+	I_CHECK_MANTRA_TOWER = RuleImage(roi_front=(348,158,30,106), roi_back=(296,117,165,256), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_mantra_tower.png")
+	# 孔雀国标志 
+	I_CHECK_PEACOCK_KINGDOM = RuleImage(roi_front=(348,158,30,106), roi_back=(296,117,165,256), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_peacock_kingdom.png")
 
 
 	# Image Rule Assets
-	# description 
+	# 庭院标志 
+	I_CHECK_MAIN = RuleImage(roi_front=(807,108,76,45), roi_back=(49,98,1033,61), threshold=0.95, method="Template matching", file="./tasks/GameUi/page/page_check_main.png")
+	# 庭院卷轴关闭标识 
+	I_MAIN_SCROLL_CLOSE = RuleImage(roi_front=(1181,634,28,39), roi_back=(1162,595,77,112), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_scroll_close.png")
+	# 庭院探索标志 
+	I_MAIN_GOTO_EXPLORATION = RuleImage(roi_front=(493,116,45,75), roi_back=(243,100,933,211), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_exploration.png")
+	# 庭院町中标志 
 	I_MAIN_GOTO_TOWN = RuleImage(roi_front=(706,249,61,57), roi_back=(200,120,951,298), threshold=0.6, method="Template matching", file="./tasks/GameUi/page/page_main_goto_town.png")
+	# 庭院前往式神录 
+	I_MAIN_GOTO_SHIKIGAMI_RECORDS = RuleImage(roi_front=(1080,590,56,64), roi_back=(1080,590,120,100), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_shikigami_records.png")
+	# 庭院前往阴阳术 
+	I_MAIN_GOTO_ONMYODO = RuleImage(roi_front=(960,590,39,36), roi_back=(960,590,120,100), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_onmyodo.png")
+	# 庭院前往好友 
+	I_MAIN_GOTO_FRIENDS = RuleImage(roi_front=(845,590,55,55), roi_back=(845,590,120,100), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_friends.png")
+	# 进入花合战 
+	I_MAIN_GOTO_DAILY = RuleImage(roi_front=(790,618,49,40), roi_back=(735,590,120,100), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_daily.png")
+	# 庭院前往商店 
+	I_MAIN_GOTO_MALL = RuleImage(roi_front=(664,661,40,18), roi_back=(601,613,163,78), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_mall.png")
+	# 庭院前往阴阳寮 
+	I_MAIN_GOTO_GUILD = RuleImage(roi_front=(495,590,50,22), roi_back=(495,590,120,100), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_guild.png")
+	# 庭院前往组队 
+	I_MAIN_GOTO_TEAM = RuleImage(roi_front=(395,590,38,48), roi_back=(395,590,120,100), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_team.png")
+	# 庭院前往图鉴 
+	I_MAIN_GOTO_COLLECTION = RuleImage(roi_front=(70,590,36,41), roi_back=(70,590,120,100), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_collection.png")
+	# 庭院前往珍旅居 
+	I_MAIN_GOTO_TRAVEL = RuleImage(roi_front=(170,590,64,61), roi_back=(170,590,120,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_travel.png")
+	# 珍旅居页面标志 
+	I_CHECK_TRAVEL = RuleImage(roi_front=(1134,583,78,77), roi_back=(1134,583,78,77), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_travel.png")
+	# 式神录页面标志 
+	I_CHECK_RECORDS = RuleImage(roi_front=(269,71,55,50), roi_back=(269,71,55,50), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_records.png")
+	# 阴阳术页面标志 
+	I_CHECK_ONMYODO = RuleImage(roi_front=(1166,117,84,547), roi_back=(1166,117,84,547), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_onmyodo.png")
+	# 好友页面标志 
+	I_CHECK_FRIENDS = RuleImage(roi_front=(27,251,29,47), roi_back=(5,216,86,106), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_check_friends.png")
+	# 花合战页面标志 
+	I_CHECK_DAILY = RuleImage(roi_front=(28,515,58,62), roi_back=(1,487,154,145), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_daily.png")
+	# 商店页面标志 
+	I_CHECK_MALL = RuleImage(roi_front=(231,455,131,78), roi_back=(201,432,185,121), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_mall.png")
+	# 商店推荐页面标志 
+	I_CHECK_MALL_RECOMMEND = RuleImage(roi_front=(930,12,42,37), roi_back=(905,0,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_mall_recommend.png")
+	# 阴阳寮页面标志 
+	I_CHECK_GUILD = RuleImage(roi_front=(1072,630,49,46), roi_back=(1072,630,49,46), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_guild.png")
+	# 组队页面标志 
+	I_CHECK_TEAM = RuleImage(roi_front=(32,585,82,65), roi_back=(0,563,148,139), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_team.png")
+	# 图鉴页面标志 
+	I_CHECK_COLLECTION = RuleImage(roi_front=(380,620,100,100), roi_back=(371,608,880,112), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_collection.png")
+	# 花合战退出标志 
+	I_BACK_DAILY = RuleImage(roi_front=(33,13,39,50), roi_back=(33,13,39,50), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_daily.png")
+	# 庭院召唤标志 
+	I_MAIN_GOTO_SUMMON = RuleImage(roi_front=(1073,174,57,65), roi_back=(571,153,586,124), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_summon.png")
+	# 召唤页面标志 
+	I_CHECK_SUMMON = RuleImage(roi_front=(750,580,30,28), roi_back=(578,516,419,204), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_summon.png")
+	# 阴阳寮神社左上角 
+	I_CHECK_SHRIN = RuleImage(roi_front=(80,92,33,97), roi_back=(56,73,84,138), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_shrin.png")
+	# 阴阳寮前往神社 
+	I_GUILD_TO_SHRIN = RuleImage(roi_front=(877,629,49,53), roi_back=(840,602,302,113), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_guild_to_shrin.png")
+
+
+	# Image Rule Assets
 	# description 
 	I_CHECK_TOWN = RuleImage(roi_front=(1026,106,68,82), roi_back=(765,98,402,96), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_town.png")
 	# description 
 	I_TOWN_GOTO_MAIN = RuleImage(roi_front=(1017,231,78,73), roi_back=(302,216,868,127), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_town_goto_main.png")
+	# 町中前往娱乐区域
+	I_TOWN_GOTO_ENTERTAINMENT = RuleImage(roi_front=(201,144,35,26), roi_back=(201,144,35,26), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_town_goto_entertainment.png")
+	# 娱乐区域页面标志
+	I_CHECK_ENTERTAINMENT = RuleImage(roi_front=(151,18,102,40), roi_back=(151,18,102,40), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_entertainment.png")
 	# description 
 	I_TOWN_GOTO_DUEL = RuleImage(roi_front=(756,142,48,68), roi_back=(357,126,657,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_town_goto_duel.png")
 	# description 
@@ -119,114 +186,34 @@ class GameUiAssets:
 	I_TOWN_GOTO_HYAKKISEN = RuleImage(roi_front=(192,145,48,67), roi_back=(86,130,447,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_town_goto_hyakkisen.png")
 	# 斗技主界面左上角文字图像 
 	I_CHECK_DUEL = RuleImage(roi_front=(149,16,64,38), roi_back=(133,0,110,74), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_duel.png")
-	# description 
-	I_CHECK_DEMON_ENCOUNTER = RuleImage(roi_front=(153,16,129,38), roi_back=(153,16,129,38), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_demon_encounter.png")
-	# 检查逢魔之时现世逢魔界面 
-	I_CHECK_DEMON_ENCOUNTER_REALWORLD = RuleImage(roi_front=(26,658,42,43), roi_back=(2,619,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_demon_encounter_realworld.png")
-	# 逢魔之时进入现世逢魔 
-	I_DEMON_ENCOUNTER_REALWORLD_GOTO = RuleImage(roi_front=(994,485,106,30), roi_back=(994,485,106,30), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_demon_encounter_realworld.png")
+	# 现世逢魔页面标志 
+	I_CHECK_DEMON_ENCOUNTER = RuleImage(roi_front=(26,658,42,43), roi_back=(2,619,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_demon_encounter.png")
 	# 检查狩猎战界面 
 	I_CHECK_HUNT = RuleImage(roi_front=(575,30,46,25), roi_back=(553,1,81,68), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_check_hunt.png")
 	# 检查狩猎战麒麟界面 
 	I_CHECK_HUNT_KIRIN = RuleImage(roi_front=(353,240,30,54), roi_back=(328,234,81,68), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_check_hunt_kirin.png")
 	# description 
-	I_CHECK_HYAKKISEN = RuleImage(roi_front=(1014,607,53,55), roi_back=(986,587,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_hyakkisen.png")
-	# description 
 	I_CHECK_DRAFT_DUEL = RuleImage(roi_front=(1051,612,56,58), roi_back=(1029,594,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_draft_duel.png")
-	# description 
-	I_BACK_YOLLOW = RuleImage(roi_front=(24,16,48,55), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_yollow.png")
-	# description 
-	I_DEMON_ENCOUNTER_GOTO_TOWN = RuleImage(roi_front=(28,20,56,52), roi_back=(3,4,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_demon_encounter_goto_town.png")
-	# description 
+	# 町中进入百鬼标志 
 	I_TOWN_GOTO_HYAKKIYAKOU = RuleImage(roi_front=(880,165,53,69), roi_back=(827,149,148,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_town_goto_hyakkiyakou.png")
-	# description 
-	I_CHECK_KYAKKIYAKOU = RuleImage(roi_front=(305,567,56,64), roi_back=(280,545,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_kyakkiyakou.png")
-	# description 
-	I_HYAKKIYAKOU_CLOSE = RuleImage(roi_front=(1063,181,47,43), roi_back=(1063,181,47,43), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_hyakkiyakou_close.png")
-
-
-	# Image Rule Assets
-	# 式神录 
-	I_MAIN_GOTO_SHIKIGAMI_RECORDS = RuleImage(roi_front=(1080,590,56,64), roi_back=(1080,590,120,100), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_shikigami_records.png")
-	# description 
-	I_MAIN_GOTO_ONMYODO = RuleImage(roi_front=(960,590,39,36), roi_back=(960,590,120,100), threshold=0.5, method="Template matching", file="./tasks/GameUi/page/page_main_goto_onmyodo.png")
-	# description 
-	I_MAIN_GOTO_FRIENDS = RuleImage(roi_front=(845,590,55,55), roi_back=(845,590,120,100), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_friends.png")
-	# 进入花合战 
-	I_MAIN_GOTO_DAILY = RuleImage(roi_front=(779,612,51,67), roi_back=(754,595,89,97), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_daily.png")
-	# description 
-	I_MAIN_GOTO_MALL = RuleImage(roi_front=(663,661,41,22), roi_back=(644,613,81,78), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_mall.png")
-	# description 
-	I_MAIN_GOTO_GUILD = RuleImage(roi_front=(495,590,50,22), roi_back=(495,590,120,100), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_guild.png")
-	# description 
-	I_MAIN_GOTO_TEAM = RuleImage(roi_front=(395,590,38,48), roi_back=(395,590,120,100), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_team.png")
-	# description 
-	I_MAIN_GOTO_COLLECTION = RuleImage(roi_front=(70,590,36,41), roi_back=(70,590,120,100), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_collection.png")
-	# description 
-	I_CHECK_RECORDS = RuleImage(roi_front=(269,71,55,50), roi_back=(269,71,55,50), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_records.png")
-	# description 
-	I_CHECK_ONMYODO = RuleImage(roi_front=(1166,117,84,547), roi_back=(1166,117,84,547), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_onmyodo.png")
-	# description 
-	I_CHECK_FRIENDS = RuleImage(roi_front=(27,251,29,47), roi_back=(5,216,86,106), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_check_friends.png")
-	# description 
-	I_CHECK_DAILY = RuleImage(roi_front=(28,515,58,62), roi_back=(1,487,154,145), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_daily.png")
-	# description 
-	I_CHECK_MALL = RuleImage(roi_front=(147,527,82,82), roi_back=(147,527,82,82), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_mall.png")
-	# description 
-	I_CHECK_GUILD = RuleImage(roi_front=(1072,630,49,46), roi_back=(1072,630,49,46), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_guild.png")
-	# description 
-	I_CHECK_TEAM = RuleImage(roi_front=(32,585,82,90), roi_back=(32,585,82,90), threshold=0.63, method="Template matching", file="./tasks/GameUi/page/page_check_team.png")
-	# description 
-	I_CHECK_COLLECTION = RuleImage(roi_front=(579,639,63,65), roi_back=(118,626,1162,94), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_collection.png")
-	# description 
+	# 百鬼夜行标志 
+	I_CHECK_KYAKKIYAKOU = RuleImage(roi_front=(1062,564,84,73), roi_back=(68,519,1185,141), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_kyakkiyakou.png")
+	# 逢魔之时新页面标志
+	I_CHECK_DEMON_ENCOUNTER_2 = RuleImage(roi_front=(501,441,53,122), roi_back=(358,326,370,288), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_demon_encounter_2.png")
+	# 现世逢魔页面标志
+	I_CHECK_DEMON_ENCOUNTER_REALWORLD = RuleImage(roi_front=(26,658,42,43), roi_back=(2,619,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_demon_encounter_realworld.png")
+	# 现世逢魔入口
+	I_DEMON_ENCOUNTER_REALWORLD_GOTO = RuleImage(roi_front=(994,485,106,30), roi_back=(994,485,106,30), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_demon_encounter_realworld.png")
+	# description
+	I_BACK_YOLLOW = RuleImage(roi_front=(24,16,48,55), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_yollow.png")
+	# description
 	I_BACK_Y = RuleImage(roi_front=(15,4,57,52), roi_back=(1,2,100,91), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_y.png")
-	# description 
-	I_BACK_MALL = RuleImage(roi_front=(28,33,50,51), roi_back=(28,33,50,51), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_mall.png")
-	# description 
-	I_BACK_FRIENDS = RuleImage(roi_front=(1152,87,53,52), roi_back=(1152,87,53,52), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_friends.png")
-	# description 
-	I_BACK_DAILY = RuleImage(roi_front=(33,13,39,50), roi_back=(33,13,39,50), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_daily.png")
-	# 活动列表页返回庭院 
-	I_BACK_ACT_LIST = RuleImage(roi_front=(1165,65,51,47), roi_back=(1124,23,131,133), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_act_list.png")
-	# 下载拓展包弹窗 
-	I_DLC_CLOSE = RuleImage(roi_front=(916,147,24,25), roi_back=(916,147,24,25), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/store_dlc_close.png")
-	# 退出战斗按钮 
-	I_BACK_BATTLE = RuleImage(roi_front=(24,19,40,38), roi_back=(0,0,90,85), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_battle.png")
-	# 进入现世逢魔 
-	I_DEMON_ENCOUNTER_REALWORLD = RuleImage(roi_front=(994,485,106,30), roi_back=(994,485,106,30), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_demon_encounter_realworld.png")
-
-
-	# Image Rule Assets
-	# description 
-	I_CHECK_LOGIN_FORM = RuleImage(roi_front=(178,572,53,60), roi_back=(1,500,400,150), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_login_form.png")
-
-
-	# Image Rule Assets
-	# description 
-	I_MAIN_GOTO_SUMMON = RuleImage(roi_front=(1073,174,57,65), roi_back=(571,153,586,124), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_summon.png")
-	# description 
+	# description
+	I_CHECK_SIX_GATES = RuleImage(roi_front=(411,297,21,21), roi_back=(395,262,54,85), threshold=0.85, method="Template matching", file="./tasks/GameUi/page/page_check_six_gates.png")
+	# description
 	I_SUMMON_GOTO_MAIN = RuleImage(roi_front=(27,5,49,51), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_summon_goto_main.png")
-	# description 
-	I_CHECK_SUMMON = RuleImage(roi_front=(750,580,30,28), roi_back=(750,580,350,120), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_summon.png")
-	# 就是一个红叉 
-	I_REALM_RAID_GOTO_EXPLORATION = RuleImage(roi_front=(1192,107,36,43), roi_back=(1192,107,36,43), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_realm_raid_goto_exploration.png")
-	# description 
-	I_MAIN_GOTO_TRAVEL = RuleImage(roi_front=(170,590,64,61), roi_back=(170,590,120,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_travel.png")
-	# 珍旅居 
-	I_CHECK_TRAVEL = RuleImage(roi_front=(1134,583,78,77), roi_back=(1134,583,78,77), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_travel.png")
-	# 活动列表页前往活动 
-	I_ACT_LIST_GOTO_ACT = RuleImage(roi_front=(971,506,156,60), roi_back=(925,458,272,166), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_act_list_goto_act.png")
-	# 活动列表页标志 
-	I_CHECK_ACT_LIST = RuleImage(roi_front=(60,617,79,66), roi_back=(19,555,163,164), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_act_list.png")
-	# 英杰试炼左上角标志 
-	I_CHECK_HERO_TEST = RuleImage(roi_front=(148,10,133,48), roi_back=(137,0,157,71), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_hero_test.png")
-	# 探索前往英杰试炼 
-	I_EXPLORATION_GOTO_HERO_TEST = RuleImage(roi_front=(838,635,38,43), roi_back=(7,605,1272,113), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_hero_test.png")
-
-
-	# Image Rule Assets
-	# 寮结界突破右上角 
-	I_KEKKAI_TOPPA = RuleImage(roi_front=(1065,3,203,61), roi_back=(1065,3,203,61), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_kekkai_toppa.png")
+	# description
+	I_BACK_BL = RuleImage(roi_front=(32,31,50,53), roi_back=(1,2,139,120), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_back_blue.png")
 
 
 	# List Rule Assets
@@ -236,47 +223,7 @@ class GameUiAssets:
 
 
 	# List Rule Assets
-	# 活动列表页文字列表 
-	L_ACT_LIST_OCR = RuleList(folder="./tasks/GameUi/page", direction="vertical", mode="ocr", roi_back=(219,91,47,513), size=(42, 78), 
-					 array=["日之"])
-
-
-	# Ocr Rule Assets
-	# 战斗界面自动标识 
-	O_BATTLE_AUTO = RuleOcr(roi=(37,642,51,36), area=(0,589,133,128), mode="Single", method="Default", keyword="自动", name="battle_auto")
-	# 战斗页面手动标志 
-	O_BATTLE_HAND = RuleOcr(roi=(35,644,52,34), area=(0,589,136,129), mode="Single", method="Default", keyword="手动", name="battle_hand")
-
-
-	# Image Rule Assets
-	# 左上角蓝色的返回 
-	I_BACK_BL = RuleImage(roi_front=(32,31,50,53), roi_back=(1,2,139,120), threshold=0.8, method="Template matching", file="./tasks/GameUi/res/res_back_blue.png")
-	# 式神录 
-	I_HOME_SHIKIKAMI = RuleImage(roi_front=(1092,611,73,41), roi_back=(1092,611,73,41), threshold=0.8, method="Template matching", file="./tasks/GameUi/res/res_home_shikikami.png")
-	# 阴阳术 
-	I_HOME_OMNYOUJI = RuleImage(roi_front=(989,613,59,58), roi_back=(989,613,59,58), threshold=0.8, method="Template matching", file="./tasks/GameUi/res/res_home_omnyouji.png")
-	# description 
-	I_HOME_FRIEND = RuleImage(roi_front=(876,619,60,53), roi_back=(876,619,60,53), threshold=0.8, method="Template matching", file="./tasks/GameUi/res/res_home_friend.png")
-	# 花合战 
-	I_HOME_TSK = RuleImage(roi_front=(764,608,66,56), roi_back=(764,608,66,56), threshold=0.8, method="Template matching", file="./tasks/GameUi/res/res_home_tsk.png")
-	# 商店 
-	I_HOME_MALL = RuleImage(roi_front=(654,620,51,55), roi_back=(654,620,51,55), threshold=0.8, method="Template matching", file="./tasks/GameUi/res/res_home_mall.png")
-	# 阴阳寮 
-	I_HOME_GUILD = RuleImage(roi_front=(540,607,53,50), roi_back=(540,607,53,50), threshold=0.8, method="Template matching", file="./tasks/GameUi/res/res_home_guild.png")
-	# 组队 
-	I_HOME_TEAM = RuleImage(roi_front=(430,616,49,61), roi_back=(430,616,49,61), threshold=0.8, method="Template matching", file="./tasks/GameUi/res/res_home_team.png")
-	# 同心队 
-	I_HOME_CONCENTRIC_TEAM = RuleImage(roi_front=(310,618,67,60), roi_back=(310,618,67,60), threshold=0.8, method="Template matching", file="./tasks/GameUi/res/res_home_concentric_team.png")
-	# 珍旅居 
-	I_HOME_HELP = RuleImage(roi_front=(201,617,56,57), roi_back=(201,617,56,57), threshold=0.8, method="Template matching", file="./tasks/GameUi/res/res_home_help.png")
-	# 图鉴 
-	I_HOME_COLLECT = RuleImage(roi_front=(92,607,48,74), roi_back=(92,607,48,74), threshold=0.8, method="Template matching", file="./tasks/GameUi/res/res_home_collect.png")
-
-
-	# Ocr Rule Assets
-	# 庭院到探索 
-	O_HOME_EXPLORE = RuleOcr(roi=(310,105,858,194), area=(0,0,100,100), mode="Full", method="Default", keyword="探索", name="home_explore")
-	# Ocr-description 
-	O_NEW = RuleOcr(roi=(0,0,100,100), area=(0,0,100,100), mode="Single", method="Default", keyword="", name="new")
-
+	# 活动列表页爬塔活动文字 
+	L_ACT_LIST_OCR = RuleList(folder="./tasks/GameUi/page", direction="vertical", mode="ocr", roi_back=(50,123,49,553), size=(45, 69), 
+					 array=["版本"])
 

+ 148 - 0
tasks/GameUi/common.py

@@ -0,0 +1,148 @@
+from __future__ import annotations
+
+"""GameUi 运行时的共享类型与工具函数。"""
+
+import inspect
+import re
+import traceback
+from pathlib import Path
+from typing import TYPE_CHECKING, Any, Callable
+
+from module.atom.click import RuleClick
+from module.atom.gif import RuleGif
+from module.atom.image import RuleImage
+from module.atom.list import RuleList
+from module.atom.ocr import RuleOcr
+
+if TYPE_CHECKING:
+    from tasks.GameUi.action import ConditionalAction, ActionSequence
+else:
+    ConditionalAction = Any
+    ActionSequence = tuple[Any]
+
+# 页面识别条件允许直接使用现有 Rule 元对象或自定义函数。
+RecognizerLike = RuleImage | RuleGif | RuleOcr | Callable
+# 页面跳转动作和 hook 动作允许使用点击类元对象、自定义函数或组合动作。
+ActionLike = RuleImage | RuleGif | RuleOcr | RuleList | RuleClick | ActionSequence | ConditionalAction | Callable
+
+
+def camel_to_snake(value: str) -> str:
+    """将驼峰或混合命名转换为下划线命名。
+
+    Args:
+        value: 待转换的字符串。
+
+    Returns:
+        转换后的下划线命名字符串。
+    """
+
+    value = re.sub(r"(.)([A-Z][a-z]+)", r"\1_\2", value)
+    value = re.sub(r"([a-z0-9])([A-Z])", r"\1_\2", value)
+    return value.replace("-", "_").lower()
+
+
+def infer_stack_symbol(stack_depth: int = 3) -> str:
+    """根据调用栈推断页面变量名。
+
+    Args:
+        stack_depth: 需要读取的调用栈深度,默认与页面定义调用层一致。
+
+    Returns:
+        推断出的变量名;若无法解析则返回基于行号的兜底名称。
+    """
+
+    filename, line_number, function_name, text = traceback.extract_stack()[-stack_depth]
+    del filename, function_name
+    if text and "=" in text:
+        return text[: text.find("=")].strip()
+    return f"page_{line_number}"
+
+
+def infer_page_key_and_name(stack_depth: int = 4) -> tuple[str, str]:
+    """从调用栈中推断页面的 `key` 与 `name`。
+
+    Args:
+        stack_depth: 需要向上回溯的调用栈深度。`Page.__init__ -> infer_page_key_and_name
+            -> infer_stack_symbol` 这一层级下,默认值 4 才能落到真正的页面定义语句。
+
+    Returns:
+        一个 `(page_key, page_name)` 元组。
+    """
+
+    symbol = infer_stack_symbol(stack_depth=stack_depth)
+    name = symbol.split(".")[-1]
+    return symbol, name
+
+
+def infer_tasks_category_from_parts(parts: list[str], task_index: int, *, component_use_child: bool = False) -> str:
+    """根据包含 `tasks` 的路径片段推断分类。
+
+    Args:
+        parts: 已拆分的路径或模块名片段。
+        task_index: 片段列表中 `tasks` 所在的索引。
+        component_use_child: 当目标目录为 `Component` 时,是否继续使用下一层目录名作为分类。
+
+    Returns:
+        推断出的分类名。
+    """
+
+    if task_index + 1 >= len(parts):
+        return "global"
+
+    folder = parts[task_index + 1]
+    if folder == "GameUi":
+        return "global"
+    if component_use_child and folder == "Component" and task_index + 2 < len(parts):
+        return camel_to_snake(parts[task_index + 2])
+    return camel_to_snake(folder)
+
+
+def infer_tasks_category_from_path(path: str | Path, *, component_use_child: bool = False) -> str:
+    """根据绝对或相对路径推断任务分类。
+
+    Args:
+        path: 目标文件路径。
+        component_use_child: 当路径位于 `tasks/Component/*` 下时,是否继续使用下一层目录名作为分类。
+
+    Returns:
+        推断出的分类名;路径不在 `tasks` 目录下时返回 `global`。
+    """
+
+    parts = list(Path(path).resolve().parts)
+    if "tasks" not in parts:
+        return "global"
+    return infer_tasks_category_from_parts(parts, parts.index("tasks"), component_use_child=component_use_child)
+
+
+def infer_category(filename: str | None = None, stack_depth: int = 3) -> str:
+    """根据文件路径推断页面分类。
+
+    Args:
+        filename: 显式传入的文件路径;为空时从调用栈推断。
+        stack_depth: 当 `filename` 为空时,读取调用栈的深度。
+
+    Returns:
+        页面所属分类;`tasks/GameUi` 内的页面固定归为 `global`。
+    """
+
+    return infer_tasks_category_from_path(filename or traceback.extract_stack()[-stack_depth].filename)
+
+
+def invoke_task_callable(target: Callable, task):
+    """调用用户自定义识别函数或 hook 函数。
+
+    Args:
+        target: 用户传入的可调用对象。
+        task: 当前运行时任务对象。
+
+    Returns:
+        目标函数的返回值。
+    """
+
+    try:
+        signature = inspect.signature(target)
+    except (TypeError, ValueError):
+        return target(task)
+    if len(signature.parameters) <= 0:
+        return target()
+    return target(task)

+ 362 - 0
tasks/GameUi/default_pages.py

@@ -0,0 +1,362 @@
+from __future__ import annotations
+
+from tasks.ActivityShikigami.assets import ActivityShikigamiAssets
+from tasks.Component.GeneralInvite.assets import GeneralInviteAssets
+from tasks.Component.SwitchAccount.assets import SwitchAccountAssets
+from tasks.Exploration.assets import ExplorationAssets
+from tasks.GameUi.action import conditional_action, sequence
+from tasks.Pets.assets import PetsAssets
+from typing import Union
+
+"""GameUi 全局页面定义。"""
+
+import random
+
+from module.atom.click import RuleClick
+from tasks.Component.GeneralBattle.assets import GeneralBattleAssets
+from tasks.GlobalGame.assets import GlobalGameAssets
+from tasks.GameUi.assets import GameUiAssets
+from tasks.GameUi.matcher import any_of, all_of
+from tasks.GameUi.page_definition import Page
+from tasks.KekkaiUtilize.assets import KekkaiUtilizeAssets
+from tasks.Restart.assets import RestartAssets
+from tasks.RyouToppa.assets import RyouToppaAssets
+
+
+def random_click(
+    low: int | None = None,
+    high: int | None = None,
+    ltrb: tuple = (True, False, True, False),
+) -> Union[RuleClick | list[RuleClick]]:
+    """从常用结算点击区域中随机选择安全点击点。
+
+    Args:
+        low: 当需要返回点击序列时,序列长度的最小值。
+        high: 当需要返回点击序列时,序列长度的最大值。
+        ltrb: 允许参与随机的区域开关,依次对应左、上、右、下区域。
+
+    Returns:
+        单个 `RuleClick`,或一个由多个 `RuleClick` 组成的列表。
+    """
+
+    click_area_list = [GeneralBattleAssets.C_RANDOM_LEFT, GeneralBattleAssets.C_RANDOM_TOP,
+                       GeneralBattleAssets.C_RANDOM_RIGHT, GeneralBattleAssets.C_RANDOM_BOTTOM]
+    click = random.choice([item for item, enabled in zip(click_area_list, ltrb) if enabled])
+    click.name = "SAFE_RANDOM_CLICK"
+    if low is None or high is None:
+        return click
+    return [click for _ in range(random.randint(low, high))]
+
+
+def handle_login_page(task) -> bool:
+    from tasks.Restart.login import LoginHandler
+    return LoginHandler(config=task.config, device=task.device).app_handle_login()
+
+
+# 登录页。
+page_login = Page(SwitchAccountAssets.I_CHECK_LOGIN_FORM, category="global")
+page_login.add_enter_success_hooks(handle_login_page)
+
+# 庭院主页(此处通过提高阈值来处理部分探索章节会识别成原始庭院的问题, 后续有其他更好方法需改善)
+page_main = Page(GameUiAssets.I_CHECK_MAIN, category="global")
+page_main.add_enter_success_hooks(
+    GameUiAssets.I_AD_CLOSE_RED, GlobalGameAssets.I_UI_BACK_RED, RestartAssets.I_CANCEL_BATTLE,
+    conditional_action(RestartAssets.I_LOGIN_COURTYARD, RestartAssets.C_LOGIN_SCROLL_CLOSE_AREA),
+)
+
+# 庭院区域页面。
+page_shikigami_records = Page(GameUiAssets.I_CHECK_RECORDS, category="global")
+page_shikigami_records.add_enter_failure_hooks(conditional_action(condition=GameUiAssets.I_CHECK_MAIN,
+                                                                  action=RestartAssets.C_LOGIN_SCROLL_CLOSE_AREA))
+page_shikigami_records.add_enter_success_hooks(GlobalGameAssets.I_UI_CANCEL_SAMLL)
+page_shikigami_records.connect(page_main, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_shikigami_records->page_main")
+page_main.connect(page_shikigami_records, GameUiAssets.I_MAIN_GOTO_SHIKIGAMI_RECORDS, key="page_main->page_shikigami_records")
+
+page_onmyodo = Page(GameUiAssets.I_CHECK_ONMYODO, category="global")
+page_onmyodo.add_enter_failure_hooks(conditional_action(condition=GameUiAssets.I_CHECK_MAIN,
+                                                        action=RestartAssets.C_LOGIN_SCROLL_CLOSE_AREA))
+page_onmyodo.connect(page_main, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_onmyodo->page_main")
+page_main.connect(page_onmyodo, GameUiAssets.I_MAIN_GOTO_ONMYODO, key="page_main->page_onmyodo")
+
+page_friends = Page(GameUiAssets.I_CHECK_FRIENDS, category="global")
+page_friends.add_enter_failure_hooks(conditional_action(condition=GameUiAssets.I_CHECK_MAIN,
+                                                        action=RestartAssets.C_LOGIN_SCROLL_CLOSE_AREA))
+page_friends.connect(page_main, GlobalGameAssets.I_UI_BACK_RED, key="page_friends->page_main")
+page_friends.add_leave_failure_hooks(GlobalGameAssets.I_UI_BACK_RED)
+page_main.connect(page_friends, GameUiAssets.I_MAIN_GOTO_FRIENDS, key="page_main->page_friends")
+
+page_daily = Page(GameUiAssets.I_CHECK_DAILY, category="global")
+page_daily.add_enter_failure_hooks(
+    conditional_action(condition=GameUiAssets.I_CHECK_MAIN, action=RestartAssets.C_LOGIN_SCROLL_CLOSE_AREA),
+    conditional_action(condition=lambda task: not task.appear(GameUiAssets.I_CHECK_MAIN),
+                       action=lambda task: task.ui_click(click=random_click(ltrb=(False, False, False, True)),
+                                                         stop=GlobalGameAssets.I_UI_BACK_YELLOW)))
+page_daily.connect(page_main, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_daily->page_main")
+page_main.connect(page_daily, GameUiAssets.I_MAIN_GOTO_DAILY, key="page_main->page_daily")
+
+page_mall = Page(GameUiAssets.I_CHECK_MALL, category="global")
+page_mall.add_enter_failure_hooks(conditional_action(condition=GameUiAssets.I_CHECK_MAIN,
+                                                     action=RestartAssets.C_LOGIN_SCROLL_CLOSE_AREA))
+page_mall.add_enter_success_hooks(GameUiAssets.I_AD_CLOSE_RED, GlobalGameAssets.I_UI_BACK_RED, GlobalGameAssets.I_UI_CANCEL_SAMLL)
+page_mall.connect(page_main, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_mall->page_main")
+
+page_mall_recommend = Page(GameUiAssets.I_CHECK_MALL_RECOMMEND, category="global")
+page_mall_recommend.add_enter_success_hooks(GameUiAssets.I_AD_CLOSE_RED, GlobalGameAssets.I_UI_BACK_RED,
+                                            GlobalGameAssets.I_UI_CANCEL_SAMLL)
+page_mall_recommend.connect(page_mall, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_mall_recommend->page_mall")
+page_main.connect(page_mall_recommend, GameUiAssets.I_MAIN_GOTO_MALL, key="page_main->page_mall_recommend")
+
+page_guild = Page(GameUiAssets.I_CHECK_GUILD, category="global")
+page_guild.add_enter_success_hooks(KekkaiUtilizeAssets.I_PLANT_TREE_CLOSE)
+page_guild.add_enter_failure_hooks(conditional_action(condition=GameUiAssets.I_CHECK_MAIN,
+                                                      action=RestartAssets.C_LOGIN_SCROLL_CLOSE_AREA))
+page_guild.connect(page_main, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_guild->page_main")
+page_main.connect(page_guild, GameUiAssets.I_MAIN_GOTO_GUILD, key="page_main->page_guild")
+
+page_shirin = Page(GameUiAssets.I_CHECK_SHRIN, category="global")
+page_guild.connect(page_shirin, GameUiAssets.I_GUILD_TO_SHRIN, key="page_guild->page_shirin")
+page_shirin.connect(page_guild, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_shirin->page_guild")
+
+page_team = Page(GameUiAssets.I_CHECK_TEAM, category="global")
+page_team.add_enter_failure_hooks(conditional_action(condition=GameUiAssets.I_CHECK_MAIN,
+                                                     action=RestartAssets.C_LOGIN_SCROLL_CLOSE_AREA))
+page_team.connect(page_main, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_team->page_main")
+page_main.connect(page_team, GameUiAssets.I_MAIN_GOTO_TEAM, key="page_main->page_team")
+
+page_collection = Page(GameUiAssets.I_CHECK_COLLECTION, category="global")
+page_collection.add_enter_success_hooks(GlobalGameAssets.I_UI_CANCEL_SAMLL)
+page_collection.add_enter_failure_hooks(conditional_action(condition=GameUiAssets.I_CHECK_MAIN,
+                                                           action=RestartAssets.C_LOGIN_SCROLL_CLOSE_AREA))
+page_collection.connect(page_main, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_collection->page_main")
+page_main.connect(page_collection, GameUiAssets.I_MAIN_GOTO_COLLECTION, key="page_main->page_collection")
+
+page_travel = Page(GameUiAssets.I_CHECK_TRAVEL, category="global")
+page_travel.add_enter_failure_hooks(conditional_action(condition=GameUiAssets.I_CHECK_MAIN,
+                                                       action=RestartAssets.C_LOGIN_SCROLL_CLOSE_AREA))
+page_travel.connect(page_main, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_travel->page_main")
+page_main.connect(page_travel, GameUiAssets.I_MAIN_GOTO_TRAVEL, key="page_main->page_travel")
+
+page_pet = Page(any_of(PetsAssets.I_PET_CLAW, PetsAssets.I_PET_FEAST), category="global")
+page_pet.connect(page_main, GlobalGameAssets.I_UI_BACK_CIRCLE, key="page_pet->page_main")
+page_main.connect(page_pet, PetsAssets.I_PET_HOUSE, key="page_main->page_pet")
+page_pet.add_enter_success_hooks(conditional_action(condition=lambda task: not task.appear(PetsAssets.I_PET_FEAST),
+                                                    action=PetsAssets.I_PET_CLAW))
+
+# 活动列表页。
+page_act_list = Page(GameUiAssets.I_CHECK_ACT_LIST, category="global", priority=25)
+page_act_list.add_enter_success_hooks(GameUiAssets.I_PAPER_DOLL_CLOSE)
+page_main.connect(page_act_list, GameUiAssets.I_ACT_LIST_EXPAND, key="page_main->page_act_list")
+page_act_list.connect(page_main, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_act_list->page_main")
+
+# 召唤页。
+page_summon = Page(GameUiAssets.I_CHECK_SUMMON, category="global")
+page_summon.connect(page_main, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_summon->page_main")
+page_main.connect(page_summon, GameUiAssets.I_MAIN_GOTO_SUMMON, key="page_main->page_summon")
+
+# 町中主页。
+page_town = Page(GameUiAssets.I_CHECK_TOWN, category="global")
+page_town.connect(page_main, GameUiAssets.I_TOWN_GOTO_MAIN, key="page_town->page_main")
+page_main.connect(page_town, GameUiAssets.I_MAIN_GOTO_TOWN, key="page_main->page_town")
+
+# 町中区域页面。
+page_entertainment = Page(GameUiAssets.I_CHECK_ENTERTAINMENT, category="global")
+page_town.connect(
+    page_entertainment,
+    GameUiAssets.I_TOWN_GOTO_ENTERTAINMENT,
+    key="page_town->page_entertainment",
+)
+page_entertainment.connect(
+    page_town,
+    GlobalGameAssets.I_UI_BACK_YELLOW,
+    key="page_entertainment->page_town",
+)
+
+page_duel = Page(GameUiAssets.I_CHECK_DUEL, category="global")
+page_duel.connect(page_town, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_duel->page_town")
+page_town.connect(page_duel, GameUiAssets.I_TOWN_GOTO_DUEL, key="page_town->page_duel")
+
+page_demon_encounter = Page(GameUiAssets.I_CHECK_DEMON_ENCOUNTER_2, category="global")
+page_demon_encounter.connect(page_town, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_demon_encounter->page_town")
+page_town.connect(page_demon_encounter, GameUiAssets.I_TOWN_GOTO_DEMON_ENCOUNTER, key="page_town->page_demon_encounter")
+
+# 现世逢魔页面。
+page_demon_encounter_realworld = Page(GameUiAssets.I_CHECK_DEMON_ENCOUNTER_REALWORLD, category="global")
+page_demon_encounter_realworld.connect(page_demon_encounter, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_demon_encounter_realworld->page_demon_encounter")
+page_demon_encounter.connect(page_demon_encounter_realworld, GameUiAssets.I_DEMON_ENCOUNTER_REALWORLD_GOTO, key="page_demon_encounter->page_demon_encounter_realworld")
+
+page_hunt = Page(GameUiAssets.I_CHECK_HUNT, category="global")
+page_hunt.connect(page_town, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_hunt->page_town")
+page_town.connect(page_hunt, GameUiAssets.I_TOWN_GOTO_HUNT, key="page_town->page_hunt")
+
+page_hunt_kirin = Page(GameUiAssets.I_CHECK_HUNT_KIRIN, category="global")
+page_hunt_kirin.connect(page_town, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_hunt_kirin->page_town")
+page_town.connect(page_hunt_kirin, GameUiAssets.I_TOWN_GOTO_HUNT, key="page_town->page_hunt_kirin")
+
+page_draft_duel = Page(GameUiAssets.I_CHECK_DRAFT_DUEL, category="global")
+page_draft_duel.connect(page_town, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_draft_duel->page_town")
+page_town.connect(page_draft_duel, GameUiAssets.I_TOWN_GOTO_DRAFT_DUEL, key="page_town->page_draft_duel")
+
+page_hyakkiyakou = Page(GameUiAssets.I_CHECK_KYAKKIYAKOU, category="global")
+page_hyakkiyakou.connect(page_town, GlobalGameAssets.I_UI_BACK_RED, key="page_hyakkiyakou->page_town")
+page_town.connect(page_hyakkiyakou, GameUiAssets.I_TOWN_GOTO_HYAKKIYAKOU, key="page_town->page_hyakkiyakou")
+
+
+# 探索主页。
+page_exploration = Page(GameUiAssets.I_CHECK_EXPLORATION, category="global")
+page_exploration.connect(page_main, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_exploration->page_main")
+page_exploration.add_enter_failure_hooks(ExplorationAssets.I_E_OPEN_FOLDER)
+page_main.connect(page_exploration, GameUiAssets.I_MAIN_GOTO_EXPLORATION, key="page_main->page_exploration")
+
+# 探索区域页面。
+page_awake_zones = Page(GameUiAssets.I_CHECK_AWAKE, category="global")
+page_awake_zones.connect(page_exploration, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_awake_zones->page_exploration")
+page_exploration.connect(page_awake_zones, GameUiAssets.I_EXPLORATION_GOTO_AWAKE_ZONE, key="page_exploration->page_awake_zones")
+
+page_soul_zones = Page(GameUiAssets.I_CHECK_SOUL_ZONES, category="global")
+page_soul_zones.connect(page_exploration, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_soul_zones->page_exploration")
+page_exploration.connect(page_soul_zones, GameUiAssets.I_EXPLORATION_GOTO_SOUL_ZONE, key="page_exploration->page_soul_zones")
+
+page_realm_raid = Page(GameUiAssets.I_CHECK_REALM_RAID, category="global")
+page_realm_raid.connect(page_exploration, GlobalGameAssets.I_UI_BACK_RED, key="page_realm_raid->page_exploration")
+page_realm_raid.connect(page_shikigami_records, GameUiAssets.I_REALM_RAID_GOTO_SHIKIGAMI_RECORDS, key="page_realm_raid->page_shikigami_records")
+page_exploration.connect(page_realm_raid, GameUiAssets.I_EXPLORATION_GOTO_REALM_RAID, key="page_exploration->page_realm_raid")
+
+page_kekkai_toppa = Page(GameUiAssets.I_KEKKAI_TOPPA, category="global")
+page_kekkai_toppa.connect(page_exploration, GlobalGameAssets.I_UI_BACK_RED, key="page_kekkai_toppa->page_exploration")
+page_kekkai_toppa.connect(page_shikigami_records, GameUiAssets.I_REALM_RAID_GOTO_SHIKIGAMI_RECORDS, key="page_kekkai_toppa->page_shikigami_records")
+page_realm_raid.connect(page_kekkai_toppa, RyouToppaAssets.I_RYOU_TOPPA, key="page_realm_raid->page_kekkai_toppa")
+page_kekkai_toppa.connect(page_realm_raid, GameUiAssets.I_RYOUTOPPA_GOTO_REALMRAID, key="page_kekkai_toppa->page_realm_raid")
+
+page_goryou_realm = Page(GameUiAssets.I_CHECK_GORYOU, category="global")
+page_goryou_realm.connect(page_exploration, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_goryou_realm->page_exploration")
+page_exploration.connect(page_goryou_realm, GameUiAssets.I_EXPLORATION_GOTO_GORYOU_REALM, key="page_exploration->page_goryou_realm")
+
+page_delegation = Page(GameUiAssets.I_CHECK_DELEGATION, category="global")
+page_delegation.connect(page_exploration, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_delegation->page_exploration")
+page_exploration.connect(page_delegation, GameUiAssets.I_EXPLORATION_GOTO_DELEGATION, key="page_exploration->page_delegation")
+
+page_secret_zones = Page(GameUiAssets.I_CHECK_SECRET_ZONES, category="global")
+page_secret_zones.connect(page_exploration, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_secret_zones->page_exploration")
+page_exploration.connect(page_secret_zones, GameUiAssets.I_EXPLORATION_GOTO_SECRET_ZONES, key="page_exploration->page_secret_zones")
+
+page_area_boss = Page(GameUiAssets.I_CHECK_AREA_BOSS, category="global")
+page_area_boss.connect(page_exploration, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_area_boss->page_exploration")
+page_exploration.connect(page_area_boss, GameUiAssets.I_EXPLORATION_GOTO_AREA_BOSS, key="page_exploration->page_area_boss")
+
+page_heian_kitan = Page(GameUiAssets.I_CHECK_HEIAN_KITAN, category="global")
+page_heian_kitan.connect(page_exploration, GameUiAssets.I_CHECK_HEIAN_KITAN, key="page_heian_kitan->page_exploration")
+page_exploration.connect(page_heian_kitan, GameUiAssets.I_EXPLORATION_GOTO_HEIAN_KITAN, key="page_exploration->page_heian_kitan")
+
+
+def exploration_to_six_gates(task) -> bool:
+    """探索前往六道之门, 处理不同入口情况"""
+    if task.appear_then_click(GameUiAssets.I_EXPLORATION_TO_MOON_SEA) or \
+            task.appear_then_click(GameUiAssets.I_EXPLORATION_TO_INCENSE_REALM) or \
+            task.appear_then_click(GameUiAssets.I_EXPLORATION_TO_SEASONRIFT_FOREST) or \
+            task.appear_then_click(GameUiAssets.I_EXPLORATION_TO_PURE_BUDDHA_REALM) or \
+            task.appear_then_click(GameUiAssets.I_EXPLORATION_TO_MANTRA_TOWER) or \
+            task.appear_then_click(GameUiAssets.I_EXPLORATION_TO_PEACOCK_KINGDOM):
+        return True
+    return False
+
+page_six_gates = Page(any_of(GameUiAssets.I_CHECK_MOON_SEA, GameUiAssets.I_CHECK_INCENSE_REALM,
+                             GameUiAssets.I_CHECK_SEASONRIFT_FOREST, GameUiAssets.I_CHECK_PURE_BUDDHA_REALM,
+                             GameUiAssets.I_CHECK_MANTRA_TOWER, GameUiAssets.I_CHECK_PEACOCK_KINGDOM),
+                      category="global", priority=25)
+page_six_gates.connect(page_exploration, GlobalGameAssets.I_UI_BACK_BLUE, key="page_six_gates->page_exploration")
+page_exploration.connect(page_six_gates, action=exploration_to_six_gates, key="page_exploration->page_six_gates")
+
+page_bondling_fairyland = Page(GameUiAssets.I_CHECK_BONDLING_FAIRYLAND, category="global")
+page_bondling_fairyland.connect(page_exploration, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_bondling_fairyland->page_exploration")
+page_exploration.connect(
+    page_bondling_fairyland,
+    GameUiAssets.I_EXPLORATION_GOTO_BONDLING_FAIRYLAND,
+    key="page_exploration->page_bondling_fairyland",
+)
+
+page_hero_test = Page(GameUiAssets.I_CHECK_HERO_TEST, category="global")
+page_hero_test.connect(page_exploration, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_hero_test->page_exploration")
+page_exploration.connect(page_hero_test, GameUiAssets.I_EXPLORATION_GOTO_HERO_TEST, key="page_exploration->page_hero_test")
+
+
+def handle_battle_page(task) -> bool:
+    """处理进入战斗中页面后的默认 hook。
+
+    Args:
+        task: 当前触发页面 hook 的任务实例。
+
+    Returns:
+        bool: 通用战斗执行结果。
+    """
+    from tasks.Component.GeneralBattle.general_battle import run_task_or_default_general_battle
+    return run_task_or_default_general_battle(task)
+
+
+# 战斗相关页面
+page_battle_prepare = Page(
+    any_of(
+        GeneralBattleAssets.I_BUFF,
+        GeneralBattleAssets.I_PREPARE_HIGHLIGHT,
+        GeneralBattleAssets.I_PREPARE_DARK,
+        GeneralBattleAssets.I_PRESET,
+        GeneralBattleAssets.I_PRESET_WIT_NUMBER,
+    ),
+    category="global",
+    priority=25
+)
+page_battle_prepare.add_enter_success_hooks(handle_battle_page)
+
+page_battle = Page(GeneralBattleAssets.I_BATTLE_INFO, category="global", priority=25)
+page_battle.add_enter_success_hooks(handle_battle_page)
+
+page_battle_result = Page(
+    any_of(
+        GeneralBattleAssets.I_WIN,
+        GeneralBattleAssets.I_DE_WIN,
+        GeneralBattleAssets.I_FALSE,
+        GeneralBattleAssets.I_BATTLE_STATE_INFO
+    ),
+    category="global",
+    priority=25
+)
+page_battle_result.add_enter_success_hooks(lambda _task: random_click())
+
+page_reward = Page(
+    any_of(
+        GeneralBattleAssets.I_REWARD,
+        GeneralBattleAssets.I_GB_SKIN_CONFIRM,
+        GeneralBattleAssets.I_OVER_GHOST,
+        GeneralBattleAssets.I_REWARD_STATISTICS,
+        GeneralBattleAssets.I_REWARD_GOLD,
+        GeneralBattleAssets.I_REWARD_EXP_SOUL_4,
+        GeneralBattleAssets.I_REWARD_GOLD_SNAKE_SKIN,
+        GeneralBattleAssets.I_REWARD_PURPLE_SNAKE_SKIN,
+        GeneralBattleAssets.I_REWARD_SOUL_5,
+        GeneralBattleAssets.I_REWARD_SOUL_6,
+        GlobalGameAssets.I_UI_REWARD,
+    ),
+    category="global",
+    priority=25
+)
+
+def handle_battle_reward_page(task) -> bool:
+    """处理战斗奖励页面(页面跳转才会使用该逻辑)
+
+    Args:
+        task: 当前触发页面 hook 的任务实例。
+
+    Returns:
+        bool: 执行结果
+    """
+    if task.appear_then_click(GeneralBattleAssets.I_OVER_GHOST, interval=0.8):
+        return True
+    return task.click(random_click(), interval=0.8)
+
+page_reward.add_enter_success_hooks(handle_battle_reward_page)
+
+page_battle_team_exit = Page(GeneralBattleAssets.I_GB_CHECK_TEAM_EXIT, priority=75)
+page_battle_team = Page(any_of(GeneralInviteAssets.I_GI_EMOJI_1, GeneralInviteAssets.I_GI_EMOJI_2,
+                               GeneralInviteAssets.I_FIRE),
+                        category="global", priority=25)
+page_battle_team_exit.connect(page_battle_team, GlobalGameAssets.I_UI_CANCEL, key="page_battle_team_exit->page_battle_team")
+page_battle_team.connect(page_battle_team_exit, GlobalGameAssets.I_UI_BACK_YELLOW, key="page_battle_team->page_battle_team_exit")

+ 12 - 368
tasks/GameUi/game_ui.py

@@ -1,379 +1,23 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-import time
+from __future__ import annotations
 
-import importlib
-from pathlib import Path
+from tasks.GameUi.default_pages import page_friends
 
-from datetime import datetime
-from time import sleep
+"""GameUi 运行时公共导出层。"""
 
-import random
-from collections import deque
-from module.atom.click import RuleClick
-from module.atom.gif import RuleGif
-from module.atom.image import RuleImage
-from module.atom.list import RuleList
-from module.atom.ocr import RuleOcr
-from module.base.decorator import run_once
-from module.base.timer import Timer
-from module.exception import (GameNotRunningError, GamePageUnknownError)
-from module.logger import logger
-from tasks.Component.GeneralBattle.assets import GeneralBattleAssets
-from tasks.GameUi.assets import GameUiAssets
-from tasks.GameUi.page import Page, PageRegistry, page_main, random_click
-from tasks.Restart.assets import RestartAssets
-from tasks.SixRealms.assets import SixRealmsAssets
-from tasks.base_task import BaseTask
-from tasks.ActivityShikigami.assets import ActivityShikigamiAssets
+from tasks.GameUi.navigator import GameUi
+from tasks.GameUi.page_definition import Page
+from tasks.GameUi.session import NavigatorSession
 
+__all__ = ["GameUi", "NavigatorSession", "Page"]
 
-class GameUi(BaseTask, GameUiAssets):
-    ui_current: Page = None
-    ui_close = [GameUiAssets.I_BACK_MALL, GeneralBattleAssets.I_CONFIRM,
-                BaseTask.I_UI_BACK_RED, BaseTask.I_UI_BACK_YELLOW,
-                GameUiAssets.I_BACK_FRIENDS, GameUiAssets.I_BACK_DAILY,
-                GameUiAssets.I_REALM_RAID_GOTO_EXPLORATION,
-                GameUiAssets.I_SIX_GATES_GOTO_EXPLORATION, SixRealmsAssets.I_EXIT_SIXREALMS,
-                ActivityShikigamiAssets.I_SKIP_BUTTON, ActivityShikigamiAssets.I_RED_EXIT, BaseTask.I_UI_BACK_BLUE]
 
-    def __init__(self, config, device):
-        super().__init__(config, device)
-        # 初始化时动态导入所有 page 模块
-        self._import_all_pages()
-
-    @staticmethod
-    def _import_all_pages():
-        """动态加载 tasks/**/page.py"""
-        base_dir = Path(__file__).resolve().parent.parent  # tasks 目录
-        for task_dir in base_dir.iterdir():
-            if not task_dir.is_dir():
-                continue
-            page_file = task_dir / "page.py"
-            if not page_file.exists():
-                continue
-            module_name = f"tasks.{task_dir.name}.page"
-            spec = importlib.util.spec_from_file_location(module_name, page_file)
-            if spec and spec.loader:
-                module = importlib.util.module_from_spec(spec)
-                spec.loader.exec_module(module)
-
-    @property
-    def ui_pages(self) -> list[Page]:
-        return PageRegistry.all()
-
-    def ui_page_appear(self, page: Page, skip_first_screenshot: bool = True, interval: float = None):
-        """
-        判断当前页面是否为page
-        """
-        self.maybe_screenshot(skip_first_screenshot)
-        if isinstance(page.check_button, list):
-            for button in page.check_button:
-                if self.appear(button, interval):
-                    return True
-            return False
-        return self.appear(page.check_button, interval)
-
-    def ui_wait_until_appear(self, page: Page, timeout: float = 5, interval: float = 0.5,
-                             skip_first_screenshot: bool = True) -> bool:
-        """
-        等待页面出现
-        :param page: 等待的页面
-        :param timeout: 超时时间
-        :param interval: 检查间隔时间
-        :param skip_first_screenshot:
-        :return: 页面出现返回True, 否则返回False
-        """
-        logger.info(f'Waiting for {page}')
-        timeout_timer = Timer(timeout).start()
-        while not timeout_timer.reached():
-            if self.ui_page_appear(page, skip_first_screenshot, interval=interval):
-                return True
-            skip_first_screenshot = False
-        return False
-
-    def ui_get_current_page(self, skip_first_screenshot=True) -> Page:
-        """
-        获取当前页面
-        :param skip_first_screenshot:
-        :return:
-        """
-        logger.info("UI get current page")
-
-        @run_once
-        def app_check():
-            if not self.device.app_is_running():
-                raise GameNotRunningError("Game not running")
-
-        @run_once
-        def minicap_check():
-            if self.config.script.device.control_method == "uiautomator2":
-                self.device.uninstall_minicap()
-
-        @run_once
-        def rotation_check():
-            self.device.get_orientation()
-
-        timeout = Timer(10, count=20).start()
-        while 1:
-            self.maybe_screenshot(skip_first_screenshot)
-            skip_first_screenshot = False
-            # 如果10S还没有到底,那么就抛出异常
-            if timeout.reached():
-                break
-            # Known pages
-            for page in self.ui_pages:
-                if not page.check_button:
-                    continue
-                if self.ui_page_appear(page=page, interval=None):
-                    logger.attr("UI", page.name)
-                    self.ui_current = page
-                    return page
-            # Try to close unknown page
-            if self.try_close_unknown_page():
-                timeout = Timer(10, count=20).start()
-            else:
-                # entirely unknown page, click safe random area
-                self.click(random_click(), interval=4)
-            # wait to ui
-            sleep(0.3)
-            app_check()
-            minicap_check()
-            rotation_check()
-        # Unknown page, need manual switching
-        logger.warning("Unknown ui page")
-        logger.attr("EMULATOR__SCREENSHOT_METHOD", self.config.script.device.screenshot_method)
-        logger.attr("EMULATOR__CONTROL_METHOD", self.config.script.device.control_method)
-        logger.warning("Starting from current page is not supported")
-        logger.warning(f"Supported page: {[str(page) for page in self.ui_pages]}")
-        logger.warning('Supported page: Any page with a "HOME" button on the upper-right')
-        logger.critical("Please switch to a supported page before starting oas")
-        raise GamePageUnknownError
-
-    def ui_button_interval_reset(self, button):
-        """
-        Reset interval of some button to avoid mistaken clicks
-
-        Args:
-            button (Button):
-        """
-        if getattr(button, 'name', None) and button.name in self.interval_timer:
-            self.interval_timer[button.name].reset()
-
-    def build_reverse_path_dict(self, destination: Page) -> dict[Page, list[Page]]:
-        """
-        构建从每个页面到目标页面的最短路径(反向 BFS)
-
-        Returns:
-            dict[Page, list[Page]] -> {start_page: [page1, ...destinationPage], ...}
-        """
-        paths = {destination: [destination]}
-        queue = deque([destination])
-        while queue:
-            cur = queue.popleft()
-            for page in self.ui_pages:
-                if page not in paths and cur in page.links:
-                    # page -> cur
-                    paths[page] = [page] + paths[cur]
-                    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]))
-        return sorted_paths
-
-    def ui_goto_page(self, dest_page: Page, confirm_wait=0, skip_first_screenshot=True, timeout: int = 60) -> bool:
-        """前往指定page, 自动调用获取当前页面方法, 其他参数同ui_goto
-        """
-        self.ui_get_current_page()
-        return self.ui_goto(dest_page, confirm_wait, skip_first_screenshot, timeout)
-
-    def ui_goto(self, destination: Page, confirm_wait=0, skip_first_screenshot=True, timeout: int = 60) -> bool:
-        """
-        Args:
-            destination (Page):
-            confirm_wait:
-            skip_first_screenshot:
-        :return: find destination page or timeout reached
-        """
-        logger.hr(f"UI goto {destination}")
-        # 初始化
-        timeout_timer = Timer(timeout).start()
-        confirm_timer = Timer(confirm_wait, count=int(confirm_wait // 0.5)).start()
-        close_unknown_timer = Timer(3).start()
-        # 构建路径映射
-        path_dict = self.build_reverse_path_dict(destination)
-
-        found = False
-        while not timeout_timer.reached():
-            if found:
-                confirm_timer.wait()
-                return True
-            confirm_timer.reset()
-            path = path_dict.get(self.ui_current, None)
-            # 找不到路径则重新获取页面重试
-            if not path:
-                self.ui_get_current_page(skip_first_screenshot)
-                continue
-            skip_first_screenshot = False
-            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}")
-            # 遍历路径
-            found = self._execute_path(path, timeout_timer)
-            if not found:
-                if close_unknown_timer.reached_and_reset():
-                    self.try_close_unknown_page(skip_screenshot=False)
-                    self.ui_current = None
-        else:
-            logger.error(f'Cannot goto page[{destination}], timeout[{timeout}s] reached')
-        return False
-
-    def try_close_unknown_page(self, skip_screenshot: bool = True):
-        """
-        尝试关闭未知界面
-        :return: 执行了关闭返回True, 否则False
-        """
-        self.maybe_screenshot(skip_screenshot)
-        timer = Timer(None).start()
-        for close in self.ui_close:
-            if self.appear_then_click(close, interval=1.5):
-                logger.warning('Trying to switch to supported page')
-                logger.info(f'[{timer.current():.1f}s]Click {close} on {self.ui_current} success')
-                return True
-        return False
-
-    def _execute_path(self, path: list, timeout_timer):
-        """
-        执行路径
-        :param path: currentPage,page1,page2,...,destinationPage
-        :param timeout_timer: 超时定时器
-        :return: currentPage==destinationPage
-        """
-        for i, current_page in enumerate(path):
-            if timeout_timer.reached():
-                return False
-            # 当前页不等于路径中对应页, 尝试下一页
-            if self.ui_current != current_page:
-                continue
-            self.run_additional(current_page, interval=0.6, skip_first_screenshot=False)
-            # 如果已经是最后一页,不再跳转
-            if i == len(path) - 1:
-                if len(path) == 1:
-                    logger.info(f'Page arrived {current_page}')
-                break
-            next_page = path[i + 1]
-            logger.info(f'Page switch: {current_page} -> {next_page}')
-            # 获取页面跳转操作
-            button = current_page.links.get(next_page)
-            if not button:
-                logger.warning(f"No link from {current_page} to {next_page}")
-                continue
-            # 跳转页面
-            max_wait_timer = Timer(6).start()
-            logger.info(f'Wait appear and operate {button} on {current_page}')
-            max_attempts_per_button = 3  # 每个按钮最多尝试 3 次
-            attempts_list = [0] * len(button) if isinstance(button, list) else None
-            while not max_wait_timer.reached():
-                if timeout_timer.reached():
-                    return False
-                if isinstance(button, list):
-                    for idx, btn in enumerate(button):
-                        click_interval = 2.5 if attempts_list[idx] >= max_attempts_per_button else 0.8
-                        attempt =  self.appear_then_operate(btn, interval=click_interval, skip_first_screenshot=False)
-                        if attempt:
-                            attempts_list[idx] += 1
-                        # 只要第一个成功就跳出
-                        if attempt and idx == 0:
-                            break
-                if self.appear_then_operate(button, interval=0.8, skip_first_screenshot=False):
-                    break
-            else:
-                logger.warning(f'Failed recognize {button} on {current_page}')
-                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=2.5, 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 run_additional(self, page: Page, interval: float = None, skip_first_screenshot: bool = True):
-        """执行页面附加操作"""
-        if not page.additional:
-            return
-        for btn in page.additional:
-            # 支持反向条件操作: [条件元素, 操作元素, True]。不出现条件图片时点击另一个区域。
-            if isinstance(btn, list) and len(btn) == 3 and btn[2] is True:
-                condition, action, invert = btn
-                self.maybe_screenshot(skip_first_screenshot)
-                if not self.appear(condition):
-                    if self.appear_then_operate(action, interval=interval, skip_first_screenshot=False):
-                        logger.info(f'Page {page} additional invert conditional not {condition} -> {action} executed')
-                        skip_first_screenshot = False
-            # 支持复合条件操作: [条件元素, 操作元素]。出现条件图片时点击另一个区域。
-            elif isinstance(btn, list) and len(btn) == 2:
-                condition, action = btn
-                self.maybe_screenshot(skip_first_screenshot)
-                if self.appear(condition):
-                    if self.appear_then_operate(action, interval=interval, skip_first_screenshot=False):
-                        logger.info(f'Page {page} additional conditional {condition} -> {action} executed')
-                        skip_first_screenshot = False
-            elif self.appear_then_operate(btn, interval=interval, skip_first_screenshot=skip_first_screenshot):
-                logger.info(f'Page {page} additional {btn} clicked')
-                skip_first_screenshot = False
-
-    def appear_then_operate(self, target: RuleList | RuleImage | RuleGif | RuleOcr | RuleClick,
-                            interval: float = None, skip_first_screenshot: bool = True):
-        """
-        出现对应目标执行操作(点击图像, 滑动列表至array第一个元素并点击, 点击OCR, 点击)
-        :param target: 目标
-        :param interval: 间隔
-        :param skip_first_screenshot: 是否跳过首次截图
-        :return: 是否成功操作
-        """
-        self.maybe_screenshot(skip_first_screenshot)
-        operated = False
-        if isinstance(target, RuleList):
-            operated = self.list_appear_click(target, interval=interval)
-        elif isinstance(target, (RuleImage, RuleGif)):
-            operated = self.appear_then_click(target, interval=interval)
-        elif isinstance(target, RuleOcr):
-            operated = self.ocr_appear_click(target, interval=interval)
-        elif isinstance(target, RuleClick):
-            operated = self.click(target, interval=interval)
-        return operated
-
-
-if __name__ == '__main__':
+if __name__ == "__main__":
     from module.config.config import Config
     from module.device.device import Device
-    from tasks.GameUi.page import page_guild
+    from tasks.GameUi.page import page_main
 
-    c = Config('oas1')
+    c = Config("oas1")
     d = Device(c)
     game = GameUi(config=c, device=d)
-    for i in range(10):
-        game.ui_get_current_page()
-        game.ui_goto(page_guild)
-        game.ui_get_current_page()
-        game.ui_goto(page_main)
+    game.get_current_page()
+    game.goto_page(page_friends)

+ 180 - 0
tasks/GameUi/matcher.py

@@ -0,0 +1,180 @@
+from __future__ import annotations
+
+"""页面识别条件组合器。"""
+
+from dataclasses import dataclass
+from typing import Iterable, Union
+
+from module.atom.gif import RuleGif
+from module.atom.image import RuleImage
+from module.atom.ocr import RuleOcr
+from tasks.GameUi.common import RecognizerLike, invoke_task_callable
+
+
+class Matcher:
+    """页面识别条件的抽象基类。"""
+
+    def evaluate(self, task) -> bool:
+        """执行一次识别判断。
+
+        Args:
+            task: 当前运行时任务对象。
+
+        Returns:
+            识别是否成功。
+        """
+
+        raise NotImplementedError
+
+
+@dataclass(frozen=True)
+class AtomMatcher(Matcher):
+    """最小识别单元。
+
+    Attributes:
+        target: 单个识别目标,可以是 Rule 元对象或自定义函数。
+    """
+
+    target: RecognizerLike
+
+    def evaluate(self, task) -> bool:
+        """执行单个识别目标的判断。"""
+
+        target = self.target
+        if callable(target) and not isinstance(target, (RuleImage, RuleGif, RuleOcr)):
+            return bool(invoke_task_callable(target, task))
+        if isinstance(target, RuleOcr):
+            return bool(task.ocr_appear(target))
+        if isinstance(target, (RuleImage, RuleGif)):
+            return bool(task.appear(target))
+        return False
+
+
+@dataclass(frozen=True)
+class AnyMatcher(Matcher):
+    """任一子条件命中即成功。"""
+
+    children: tuple[Matcher, ...]
+
+    def evaluate(self, task) -> bool:
+        """按“或”语义执行识别。"""
+
+        return any(child.evaluate(task) for child in self.children)
+
+
+@dataclass(frozen=True)
+class AllMatcher(Matcher):
+    """所有子条件都命中才成功。"""
+
+    children: tuple[Matcher, ...]
+
+    def evaluate(self, task) -> bool:
+        """按“且”语义执行识别。"""
+
+        return all(child.evaluate(task) for child in self.children)
+
+
+@dataclass(frozen=True)
+class NotMatcher(Matcher):
+    """对子条件结果取反。"""
+
+    child: Matcher
+
+    def evaluate(self, task) -> bool:
+        """执行取反识别。"""
+
+        return not self.child.evaluate(task)
+
+
+def ensure_matcher(target: Union[Matcher | RecognizerLike | Iterable[RecognizerLike] | None]) -> Matcher | None:
+    """将任意识别输入规范化为 `Matcher`。
+
+    Args:
+        target: 原始识别定义,可以是 `Matcher`、Rule 元对象、可调用对象或可迭代集合。
+
+    Returns:
+        规范化后的 `Matcher`;传入 `None` 时返回 `None`。
+    """
+
+    if target is None:
+        return None
+    if isinstance(target, Matcher):
+        return target
+    if isinstance(target, (list, tuple, set)):
+        return AnyMatcher(tuple(ensure_matcher(item) for item in target if item is not None))
+    return AtomMatcher(target)
+
+
+def any_of(*targets: RecognizerLike | Matcher) -> Matcher:
+    """创建“任一命中即可”的组合识别条件。
+
+    Args:
+        *targets: 需要参与组合的识别条件。
+
+    Returns:
+        `AnyMatcher` 实例。
+    """
+
+    return AnyMatcher(tuple(ensure_matcher(target) for target in targets if target is not None))
+
+
+def all_of(*targets: RecognizerLike | Matcher) -> Matcher:
+    """创建“全部命中才成功”的组合识别条件。
+
+    Args:
+        *targets: 需要参与组合的识别条件。
+
+    Returns:
+        `AllMatcher` 实例。
+    """
+
+    return AllMatcher(tuple(ensure_matcher(target) for target in targets if target is not None))
+
+
+def not_(target: RecognizerLike | Matcher) -> Matcher:
+    """创建取反识别条件。
+
+    Args:
+        target: 需要取反的识别条件。
+
+    Returns:
+        `NotMatcher` 实例。
+    """
+
+    return NotMatcher(ensure_matcher(target))
+
+
+def collect_rule_images(target: Union[Matcher | RecognizerLike | Iterable[RecognizerLike] | None]) -> tuple[RuleImage, ...]:
+    """提取 matcher 树中可批量预取的 `RuleImage` 原子节点。"""
+
+    images: list[RuleImage] = []
+    seen = set()
+
+    def visit(node):
+        if node is None:
+            return
+        if isinstance(node, RuleImage):
+            cache_key = id(node)
+            if cache_key in seen:
+                return
+            seen.add(cache_key)
+            images.append(node)
+            return
+        if isinstance(node, AtomMatcher):
+            visit(node.target)
+            return
+        if isinstance(node, (AnyMatcher, AllMatcher)):
+            for child in node.children:
+                visit(child)
+            return
+        if isinstance(node, NotMatcher):
+            visit(node.child)
+            return
+        if isinstance(node, Matcher):
+            return
+        if isinstance(node, (list, tuple, set)):
+            for item in node:
+                visit(item)
+
+    visit(target)
+    return tuple(images)

+ 888 - 0
tasks/GameUi/navigator.py

@@ -0,0 +1,888 @@
+from __future__ import annotations
+
+import random
+from module.base.decorator import run_once
+from tasks.Exploration.assets import ExplorationAssets
+from tasks.GlobalGame.assets import GlobalGameAssets
+
+"""GameUi 导航运行时。"""
+
+import heapq
+import inspect
+import time
+from pathlib import Path
+from time import sleep
+
+from module.atom.click import RuleClick
+from module.atom.gif import RuleGif
+from module.atom.image import RuleImage
+from module.atom.list import RuleList
+from module.atom.ocr import RuleOcr
+from module.base.timer import Timer
+from module.exception import GamePageUnknownError, GameNotRunningError
+from module.logger import logger
+from tasks.ActivityShikigami.assets import ActivityShikigamiAssets
+from tasks.GameUi.action import ActionSequence, ConditionalAction
+from tasks.GameUi.assets import GameUiAssets
+from tasks.GameUi.common import infer_tasks_category_from_parts, infer_tasks_category_from_path
+from tasks.GameUi.matcher import collect_rule_images
+from tasks.GameUi.page_definition import Page, Transition, sort_pages_by_priority
+from tasks.GameUi.registry import PageRegistry
+from tasks.GameUi.session import NavigatorSession
+from tasks.SixRealms.assets import SixRealmsAssets
+from tasks.base_task import BaseTask
+
+
+class GameUi(BaseTask, GameUiAssets):
+    """页面识别、导航与未知页恢复的统一入口。"""
+
+    REPEATED_TRANSITION_FAILURE_THRESHOLD = 3
+
+    # 全局未知页关闭动作,所有任务共享。
+    DEFAULT_UNKNOWN_CLOSERS = [
+        GlobalGameAssets.I_UI_BACK_RED,
+        GlobalGameAssets.I_CHAT_CLOSE_BUTTON,
+        ActivityShikigamiAssets.I_SKIP_BUTTON,
+        GlobalGameAssets.I_UI_CONFIRM_SAMLL,
+        GlobalGameAssets.I_UI_CONFIRM,
+        ExplorationAssets.I_E_EXIT_CONFIRM,
+        GameUiAssets.I_BACK_DAILY,
+        GlobalGameAssets.I_UI_BACK_YELLOW,
+        SixRealmsAssets.I_EXIT_SIXREALMS,
+        GlobalGameAssets.I_UI_BACK_BLUE,
+    ]
+
+    def __init__(self, config, device):
+        """初始化 GameUi 运行时。
+
+        Args:
+            config: 当前任务配置对象。
+            device: 当前设备对象。
+        """
+
+        super().__init__(config, device)
+        PageRegistry.load_all_pages()
+        # 当前任务的导航 session,持有页面快照和运行期状态。
+        self.navigator = NavigatorSession(task_category=self._infer_task_category())
+        self.navigator.bootstrap(PageRegistry.all())
+
+    def _infer_task_category(self) -> str:
+        """根据当前任务模块路径推断任务分类。
+
+        Returns:
+            当前任务所属分类名。
+        """
+
+        module_parts = self.__class__.__module__.split(".")
+        if "tasks" in module_parts:
+            return infer_tasks_category_from_parts(
+                module_parts,
+                module_parts.index("tasks"),
+                component_use_child=True,
+            )
+
+        # 调度器通过固定模块名 `script_task` 动态加载任务时,__module__ 无法反映真实路径,
+        # 因此这里回退到类定义文件路径推断任务分类。
+        try:
+            class_file = Path(inspect.getfile(self.__class__)).resolve()
+        except (TypeError, OSError):
+            return "global"
+
+        return infer_tasks_category_from_path(class_file, component_use_child=True)
+
+    def _default_detect_categories(self) -> set[str]:
+        """获取普通当前页识别时允许扫描的分类集合。"""
+
+        return {"global", self.navigator.task_category}
+
+    def _navigation_detect_categories(self, destination: Page) -> set[str]:
+        """获取导航时用于识别当前页的分类集合。
+
+        Args:
+            destination: 目标页面。
+
+        Returns:
+            当前导航允许识别的页面分类集合。
+        """
+
+        return {"global", self.navigator.task_category, destination.category}
+
+    def _navigation_graph_categories(self, destination: Page, current: Page | None) -> set[str]:
+        """获取导航时允许参与建图的分类集合。
+
+        Args:
+            destination: 目标页面。
+            current: 当前页面。
+
+        Returns:
+            当前导航允许参与路径规划的页面分类集合。
+        """
+
+        categories = {"global", destination.category}
+        if current is not None:
+            categories.add(current.category)
+        return categories
+
+    def _invoke_callable(self, target):
+        """调用用户自定义动作函数。
+
+        Args:
+            target: 自定义可调用对象。
+
+        Returns:
+            调用结果。
+        """
+
+        try:
+            signature = inspect.signature(target)
+        except (TypeError, ValueError):
+            return target(self)
+        if len(signature.parameters) == 0:
+            return target()
+        return target(self)
+
+    def match_page_once(self, page: Page) -> bool:
+        """执行一次页面识别。
+
+        Args:
+            page: 待识别页面。
+
+        Returns:
+            单次识别是否成功。
+        """
+
+        if page.recognizer is None:
+            return False
+        return bool(page.recognizer.evaluate(self))
+
+    def confirm_page(self, page: Page, skip_first_screenshot: bool = True) -> bool:
+        """使用两帧稳定判定确认页面。
+
+        Args:
+            page: 待确认页面。
+            skip_first_screenshot: 是否复用当前截图。
+
+        Returns:
+            两帧连续识别是否成功。
+        """
+
+        self.maybe_screenshot(skip_first_screenshot)
+        if not self.match_page_once(page):
+            return False
+        self.screenshot()
+        return self.match_page_once(page)
+
+    def _detect_current_page(
+        self,
+        *,
+        skip_first_screenshot: bool = True,
+        categories: set[str] = None,
+    ) -> Page | None:
+        """在给定分类集合内识别当前页面。
+
+        Args:
+            skip_first_screenshot: 是否复用当前截图。
+            categories: 允许参与识别的页面分类集合。
+
+        Returns:
+            稳定识别到的当前页面;识别失败时返回 `None`。
+        """
+
+        pages = self.navigator.all_pages(categories)
+        return GameUi._detect_pages(self, pages, skip_first_screenshot=skip_first_screenshot)
+
+    def _detect_current_page_with_fallback(
+        self,
+        *,
+        skip_first_screenshot: bool = True,
+        categories: set[str] = None,
+        context: str = "current_page",
+    ) -> Page | None:
+        """先按作用域识别当前页面,失败后再回退到 session 全量页面。
+
+        Args:
+            skip_first_screenshot: 是否复用当前截图。
+            categories: 第一轮识别允许参与的页面分类集合。
+            context: 当前识别调用场景,用于日志输出。
+
+        Returns:
+            稳定识别到的当前页面;两轮识别都失败时返回 `None`。
+        """
+
+        page = self._detect_current_page(
+            skip_first_screenshot=skip_first_screenshot,
+            categories=categories,
+        )
+        if page is not None or not categories:
+            return page
+
+        sorted_categories = sorted(categories)
+        page = GameUi._detect_pages(
+            self,
+            self.navigator.all_pages(),
+            skip_first_screenshot=True,
+        )
+        if page is not None:
+            logger.attr("UI", page.name)
+            return page
+
+        logger.warning(f"Page detect miss[{context}]: scoped={sorted_categories}")
+        return None
+
+    def _detect_pages(
+        self,
+        pages: list[Page],
+        *,
+        skip_first_screenshot: bool = True,
+    ) -> Page | None:
+        """在给定页面集合内识别当前页面。"""
+
+        if not pages:
+            return None
+
+        self.maybe_screenshot(skip_first_screenshot)
+        GameUi._prepare_page_rule_image_cache(self, pages)
+        indexed_candidates = [(index, page) for index, page in enumerate(pages) if self.match_page_once(page)]
+        if not indexed_candidates:
+            return None
+
+        self.screenshot()
+        GameUi._prepare_page_rule_image_cache(self, [page for _, page in indexed_candidates])
+        for page in sort_pages_by_priority(indexed_candidates):
+            if self.match_page_once(page):
+                self.navigator.current_page = page
+                logger.attr("UI", page.name)
+                return page
+        return None
+
+    def _prepare_page_rule_image_cache(self, pages: list[Page]) -> None:
+        targets = []
+        seen = set()
+        for page in pages:
+            if page.recognizer is None:
+                continue
+            for target in collect_rule_images(page.recognizer):
+                cache_key = id(target)
+                if cache_key in seen:
+                    continue
+                seen.add(cache_key)
+                targets.append(target)
+        if targets and hasattr(self, "prepare_appear_cache"):
+            self.prepare_appear_cache(targets)
+
+    @staticmethod
+    def _action_name(action) -> str:
+        """将动作对象转换为便于日志输出的名称。
+
+        Args:
+            action: 目标动作对象。
+
+        Returns:
+            动作名称字符串。
+        """
+
+        if isinstance(action, (RuleImage, RuleGif, RuleOcr, RuleList, RuleClick)):
+            return action.name
+        if isinstance(action, ConditionalAction):
+            return f"ConditionalAction({GameUi._action_name(action.action)})"
+        if isinstance(action, ActionSequence):
+            return f"ActionSequence[{len(action.actions)}]"
+        if callable(action):
+            return str(getattr(action, "__name__", action.__class__.__name__))
+        return repr(action)
+
+    def _execute_action(self, action, *, interval: float | None = None, skip_first_screenshot: bool = True) -> bool:
+        """统一执行动作对象。
+
+        Args:
+            action: 待执行动作。
+            interval: 点击间隔。
+            skip_first_screenshot: 是否复用当前截图。
+
+        Returns:
+            动作是否成功执行。
+        """
+
+        self.maybe_screenshot(skip_first_screenshot)
+
+        if isinstance(action, ConditionalAction):
+            if not action.condition.evaluate(self):
+                return False
+            return self._execute_action(action.action, interval=interval, skip_first_screenshot=False)
+
+        if isinstance(action, ActionSequence):
+            if not action.actions:
+                return False
+            results = [
+                self._execute_action(item, interval=interval, skip_first_screenshot=(index == 0 and skip_first_screenshot))
+                for index, item in enumerate(action.actions)
+            ]
+            if action.success_index < len(results):
+                return results[action.success_index]
+            return any(results)
+
+        if isinstance(action, (list, tuple)):
+            return self._execute_action(
+                ActionSequence(tuple(action)),
+                interval=interval,
+                skip_first_screenshot=skip_first_screenshot,
+            )
+
+        if callable(action) and not isinstance(action, (RuleImage, RuleGif, RuleOcr, RuleList, RuleClick)):
+            result = self._invoke_callable(action)
+            if isinstance(result, bool):
+                return result
+            if result is None:
+                return False
+            return self._execute_action(result, interval=interval, skip_first_screenshot=False)
+
+        if isinstance(action, RuleList):
+            return self.list_appear_click(action, interval=interval or 0.8)
+        if isinstance(action, (RuleImage, RuleGif)):
+            return self.appear_then_click(action, interval=interval)
+        if isinstance(action, RuleOcr):
+            return self.ocr_appear_click(action, interval=interval)
+        if isinstance(action, RuleClick):
+            if interval is not None:
+                return self.click(action, interval=interval)
+            x, y = action.coord()
+            self.device.click(x=x, y=y, control_name=action.name)
+            return True
+        return False
+
+    def _run_hooks(self, hooks: list, *, interval: float = 0.6) -> None:
+        """按顺序执行 hook 列表。
+
+        Args:
+            hooks: 待执行的 hook 列表。
+            interval: hook 点击间隔。
+        """
+
+        for index, hook in enumerate(hooks):
+            self._execute_action(hook, interval=interval, skip_first_screenshot=(index == 0))
+
+    def _mark_page_entered(self, page: Page) -> None:
+        """记录最近一次已触发进入成功 hook 的页面。
+
+        Args:
+            page: 当前已进入的页面。
+        """
+
+        self.navigator.last_enter_success_page_key = page.key
+
+    def _run_enter_success_hooks_if_needed(self, page: Page) -> None:
+        """仅在页面变化时触发进入成功 hook。
+
+        Args:
+            page: 当前页面。
+        """
+
+        if self.navigator.last_enter_success_page_key == page.key:
+            return
+        self._run_hooks(page.on_enter_success)
+        self._mark_page_entered(page)
+
+    def _allowed_pages_for_navigation(self, destination: Page, current: Page | None) -> dict[str, Page]:
+        """构建本轮导航允许访问的页面集合。
+
+        Args:
+            destination: 目标页面。
+            current: 当前页面。
+
+        Returns:
+            以页面 key 为索引的允许页面字典。
+        """
+        categories = self._navigation_graph_categories(destination, current)
+        categories.add(self.navigator.task_category)
+        pages = {page.key: page for page in self.navigator.all_pages(categories)}
+        if current is not None:
+            pages[current.key] = current
+        pages[destination.key] = destination
+        return pages
+
+    def _build_path(self, current: Page, destination: Page) -> list[Transition]:
+        """在允许页面集合内构建最小代价路径。
+
+        Args:
+            current: 当前页面。
+            destination: 目标页面。
+
+        Returns:
+            最优路径的边列表;无法构建路径时返回 `None`。
+        """
+
+        if current == destination:
+            return []
+
+        allowed_pages = self._allowed_pages_for_navigation(destination, current)
+        if destination.key not in allowed_pages:
+            return None
+
+        queue: list[tuple[float, int, str]] = [(0.0, 0, current.key)]
+        best_cost: dict[str, float] = {current.key: 0.0}
+        previous: dict[str, tuple[str, Transition]] = {}
+        sequence = 0
+
+        while queue:
+            cost, _, page_key = heapq.heappop(queue)
+            if cost > best_cost.get(page_key, float("inf")):
+                continue
+            if page_key == destination.key:
+                break
+
+            page = allowed_pages[page_key]
+            for transition in page.transitions:
+                next_page = transition.destination
+                if next_page.key not in allowed_pages:
+                    continue
+                next_cost = cost + next_page.cost + transition.cost + self.navigator.penalty_of(transition)
+                if next_cost >= best_cost.get(next_page.key, float("inf")):
+                    continue
+                best_cost[next_page.key] = next_cost
+                previous[next_page.key] = (page_key, transition)
+                sequence += 1
+                heapq.heappush(queue, (next_cost, sequence, next_page.key))
+
+        if destination.key not in previous:
+            return None
+
+        path: list[Transition] = []
+        node_key = destination.key
+        while node_key != current.key:
+            prev_key, transition = previous[node_key]
+            path.append(transition)
+            node_key = prev_key
+        path.reverse()
+        return path
+
+    def _refresh_current_page(self, destination: Page, skip_first_screenshot: bool) -> Page | None:
+        """优先确认缓存当前页,失败后再执行作用域识别与全量兜底。
+
+        Args:
+            destination: 当前导航目标页面。
+            skip_first_screenshot: 是否复用当前截图。
+
+        Returns:
+            当前稳定页面;无法识别时返回 `None`。
+        """
+
+        current = self.navigator.current_page
+        if current is not None and self.confirm_page(current, skip_first_screenshot=skip_first_screenshot):
+            return current
+        return self._detect_current_page_with_fallback(
+            skip_first_screenshot=skip_first_screenshot,
+            categories=self._navigation_detect_categories(destination),
+            context="goto_page",
+        )
+
+    def _wait_for_destination(self, destination: Page, timeout: float = 4.0) -> bool:
+        """等待下一页面稳定出现。
+
+        Args:
+            destination: 目标页面。
+            timeout: 等待超时时间。
+
+        Returns:
+            是否在超时前稳定识别到目标页面。
+        """
+
+        timer = Timer(timeout).start()
+        while not timer.reached():
+            if self.confirm_page(destination, skip_first_screenshot=False):
+                self.navigator.current_page = destination
+                return True
+        return False
+
+    def _execute_transition(self, transition: Transition) -> bool:
+        """执行一条导航边。
+
+        Args:
+            transition: 待执行的页面边。
+
+        Returns:
+            是否成功到达边的终点页面。
+        """
+
+        source = transition.source
+        destination = transition.destination
+
+        logger.info(f"Page switch: {source} -> {destination}")
+
+        action_timer = Timer(6.0).start()
+        action_done = False
+        while not action_timer.reached():
+            if self._execute_action(transition.action, interval=0.8, skip_first_screenshot=False):
+                action_done = True
+                break
+
+        # 町中入口图标可能因动画或皮肤变化无法通过模板识别。只有在
+        # 重新确认当前页仍为 town,且目标动作具有固定图标区域时,
+        # 才机械点击一次 roi_front 中心作为保底。
+        if (
+            not action_done
+            and source.key == "page_town"
+            and isinstance(transition.action, (RuleImage, RuleGif))
+            and self.confirm_page(source, skip_first_screenshot=False)
+        ):
+            x, y, width, height = transition.action.roi_front
+            click_x = x + width // 2
+            click_y = y + height // 2
+            logger.warning(
+                "Town target was not recognized; use one fixed-position "
+                f"fallback click: action={self._action_name(transition.action)}, "
+                f"position=({click_x}, {click_y})"
+            )
+            self.device.click(
+                x=click_x,
+                y=click_y,
+                control_name=(
+                    f"TOWN_FALLBACK_{self._action_name(transition.action)}"
+                ),
+            )
+            action_done = True
+
+        if not action_done:
+            self._run_hooks(source.on_leave_failure)
+            self._run_hooks(transition.on_leave_failure)
+            self._run_hooks(destination.on_enter_failure)
+            self._run_hooks(transition.on_enter_failure)
+            penalty = self.navigator.add_penalty(transition)
+            logger.warning(f"Transition failed before leaving {source}: {transition.key}, penalty={penalty:.1f}")
+            self.navigator.current_page = self._detect_current_page_with_fallback(
+                skip_first_screenshot=False,
+                categories=self._navigation_detect_categories(destination),
+            )
+            return False
+
+        if self._wait_for_destination(destination):
+            self._run_hooks(source.on_leave_success)
+            self._run_hooks(transition.on_leave_success)
+            self._run_hooks(destination.on_enter_success)
+            self._run_hooks(transition.on_enter_success)
+            self._mark_page_entered(destination)
+            logger.info(f"Page arrived {destination}")
+            return True
+
+        self._run_hooks(source.on_leave_failure)
+        self._run_hooks(transition.on_leave_failure)
+        self._run_hooks(destination.on_enter_failure)
+        self._run_hooks(transition.on_enter_failure)
+        penalty = self.navigator.add_penalty(transition)
+        logger.warning(f"Transition cannot reach {destination}: {transition.key}, penalty={penalty:.1f}")
+        self.navigator.current_page = self._detect_current_page_with_fallback(
+            skip_first_screenshot=False,
+            categories=self._navigation_detect_categories(destination),
+        )
+        return False
+
+    def _collect_page_check_results(self, destination: Page) -> list[str]:
+        """收集当前截图下所有命中的页面名称。
+
+        Args:
+            destination: 当前导航目标页面。
+
+        Returns:
+            当前截图命中的页面名称列表。
+        """
+
+        pages = self.navigator.all_pages(self._navigation_detect_categories(destination))
+        self.screenshot()
+        return [page.name for page in pages if self.match_page_once(page)]
+
+    def _record_unknown_close_event(self, message: str) -> None:
+        """记录未知页关闭历史。
+
+        Args:
+            message: 本次关闭尝试的结果描述。
+        """
+
+        self.navigator.unknown_close_history.append(message)
+        self.navigator.unknown_close_history = self.navigator.unknown_close_history[-10:]
+
+    def _log_navigation_timeout(
+        self,
+        destination: Page,
+        last_path_signature: tuple[str, str] | None = None,
+        repeated_failure_transition_key: str | None = None,
+        repeated_failure_count: int = 0,
+        last_repeated_failure_close_result: str | None = None,
+    ) -> None:
+        """输出导航超时诊断日志。
+
+        Args:
+            destination: 当前导航目标页面。
+            last_path_signature: 最近一次成功构建的路径签名。
+            repeated_failure_transition_key: 最近一次连续失败的边 key。
+            repeated_failure_count: 当前连续失败次数。
+            last_repeated_failure_close_result: 最近一次“三连失败后主动关闭”的结果摘要。
+        """
+
+        current = self.navigator.current_page.name if self.navigator.current_page else "None"
+        allowed_categories = sorted(self._navigation_graph_categories(destination, self.navigator.current_page))
+        penalties = {
+            key: value
+            for key, value in sorted(self.navigator.edge_penalties.items(), key=lambda item: item[0])
+            if value > 0
+        }
+        check_results = self._collect_page_check_results(destination)
+        logger.warning("Unknown ui page or navigation stalled")
+        logger.warning(f"Current page: {current}")
+        logger.warning(f"Target page: {destination.name}")
+        logger.warning(f"Allowed categories: {allowed_categories}")
+        logger.warning(f"Current task category: {self.navigator.task_category}")
+        logger.warning(f"Current page checks: {check_results}")
+        logger.warning(f"Last path signature: {last_path_signature}")
+        logger.warning(
+            "Repeated transition failure: "
+            f"key={repeated_failure_transition_key}, count={repeated_failure_count}"
+        )
+        logger.warning(f"Last repeated-failure close result: {last_repeated_failure_close_result}")
+        logger.warning(f"Edge penalties: {penalties}")
+        logger.warning(f"Unknown close history: {self.navigator.unknown_close_history}")
+        raise GamePageUnknownError(f"Cannot goto page[{destination}]")
+
+    def get_current_page(self, skip_first_screenshot: bool = True, fallback: bool = False) -> Page | None:
+        """获取当前稳定页面。
+
+        Args:
+            skip_first_screenshot: 是否复用当前截图。
+            fallback: 是否回退至识别全部注册页面
+
+        Returns:
+            当前稳定识别到的页面;识别失败时返回 `None`。
+        """
+
+        if not fallback:
+            return self._detect_current_page(
+                skip_first_screenshot=skip_first_screenshot,
+                categories=self._default_detect_categories()
+            )
+        return self._detect_current_page_with_fallback(
+            skip_first_screenshot=skip_first_screenshot,
+            categories=self._default_detect_categories(),
+            context="get_current_page",
+        )
+
+    def pages_in_category(self, category: str) -> list[Page]:
+        """读取当前 session 中指定分类下的所有页面副本。"""
+
+        return self.navigator.all_pages({category})
+
+    def detect_page_in(self, *targets: str | Page, include_global: bool = True) -> Page | None:
+        """在指定分类或显式页面集合内识别当前页面。"""
+
+        category_set = {target for target in targets if isinstance(target, str)}
+        explicit_pages: list[Page] = []
+        for target in targets:
+            if not isinstance(target, Page):
+                continue
+            page = self.navigator.resolve_page(target)
+            if page is None:
+                continue
+            explicit_pages.append(page)
+
+        pages: list[Page] = []
+        if category_set:
+            if include_global:
+                category_set.add("global")
+            pages.extend(self.navigator.all_pages(category_set))
+        elif not explicit_pages and include_global:
+            pages.extend(self.navigator.all_pages({"global"}))
+
+        if explicit_pages:
+            existed = {page.key for page in pages}
+            for page in explicit_pages:
+                if page.key in existed:
+                    continue
+                pages.append(page)
+                existed.add(page.key)
+
+        return GameUi._detect_pages(self, pages, skip_first_screenshot=True)
+
+    def close_unknown_pages(self, skip_first_screenshot: bool = True) -> bool:
+        """尝试关闭未知页面。
+
+        Args:
+            skip_first_screenshot: 是否复用当前截图。
+
+        Returns:
+            是否成功触发某个关闭动作。
+        """
+
+        self.maybe_screenshot(skip_first_screenshot)
+        logger.warning("Try switch to a supported page")
+        for action in [*self.navigator.local_unknown_closers, *self.DEFAULT_UNKNOWN_CLOSERS]:
+            action_name = self._action_name(action)
+            # 若最后3次执行的都是该动作,则跳过该动作尝试其他动作
+            if len(self.navigator.unknown_close_history) >= 3 and \
+                    self.navigator.unknown_close_history[-3:] == [action_name] * 3:
+                continue
+            if self._execute_action(action, interval=1.5, skip_first_screenshot=False):
+                self._record_unknown_close_event(f"{action_name}")
+                # 关掉未知界面后等待页面变化, 防止多次识别到未知界面
+                time.sleep(random.randrange(8, 16, 1) / 10)
+                return True
+        self._record_unknown_close_event(f"None")
+
+        @run_once
+        def app_check():
+            if not self.device.app_is_running():
+                raise GameNotRunningError("Game not running")
+
+        @run_once
+        def minicap_check():
+            if self.config.script.device.control_method == "uiautomator2":
+                self.device.uninstall_minicap()
+
+        @run_once
+        def rotation_check():
+            self.device.get_orientation()
+
+        app_check()
+        minicap_check()
+        rotation_check()
+        return False
+
+    def _finalize_arrival(self, destination: Page, confirm_wait: float, start_time: float) -> bool:
+        """统一处理到达目标页后的收尾动作。
+
+        到达判定已由调用方完成(跳转边到达等待的两帧确认,或当前页刷新返回的两帧确认结果),
+        本方法不再重复确认,只负责收尾:刷新当前页缓存、幂等触发进入成功钩子、按需等待、输出到达日志。
+
+        Args:
+            destination: 已确认到达的目标页面。
+            confirm_wait: 到达后额外等待的确认时间。
+            start_time: 本次导航开始时间戳,用于输出耗时。
+
+        Returns:
+            固定返回 True,表示已到达目标页面。
+        """
+
+        self.navigator.current_page = destination
+        self._run_enter_success_hooks_if_needed(destination)
+        if confirm_wait > 0:
+            Timer(confirm_wait, count=int(confirm_wait // 0.5)).start().wait()
+        logger.attr(f'{time.time() - start_time:.1f}s', f"Page arrived {destination}")
+        return True
+
+    def goto_page(self, destination: Page, confirm_wait: float = 0, skip_first_screenshot: bool = True,
+                  timeout: int = 30) -> bool | None:
+        """导航到目标页面。
+
+        Args:
+            destination: 目标页面。
+            confirm_wait: 到达目标页面后额外等待的确认时间。
+            skip_first_screenshot: 是否复用当前截图。
+            timeout: 无有效进展超时时间,单位秒。
+
+        Returns:
+            是否成功到达目标页面。
+
+        Raises:
+            GamePageUnknownError: 无法恢复到可导航状态或无法推进到目标页面时抛出。
+        """
+
+        destination = self.navigator.resolve_page(destination) or self.navigator.add_page(destination)
+        logger.hr(f"UI goto {destination}")
+        start_time = time.time()
+        progress_timer = Timer(timeout).start()
+        last_progress_signature: tuple[str, str] | None = None
+        last_detected_page_key: str | None = None
+        repeated_failure_transition_key: str | None = None
+        repeated_failure_count = 0
+        last_repeated_failure_close_result: str | None = None
+
+        def reset_repeated_transition_failures() -> None:
+            nonlocal repeated_failure_transition_key, repeated_failure_count
+            repeated_failure_transition_key = None
+            repeated_failure_count = 0
+
+        while True:
+            current = self._refresh_current_page(destination, skip_first_screenshot)
+            skip_first_screenshot = False
+
+            if current is None:
+                if self.close_unknown_pages(skip_first_screenshot=False):
+                    progress_timer.reset()
+                    last_progress_signature = ("close_unknown", destination.key)
+                    last_detected_page_key = None
+                    reset_repeated_transition_failures()
+                elif progress_timer.reached():
+                    self._log_navigation_timeout(
+                        destination,
+                        last_path_signature=last_progress_signature,
+                        repeated_failure_transition_key=repeated_failure_transition_key,
+                        repeated_failure_count=repeated_failure_count,
+                        last_repeated_failure_close_result=last_repeated_failure_close_result,
+                    )
+                    raise GamePageUnknownError(f"Cannot goto page[{destination}]")
+                continue
+
+            if current.key != last_detected_page_key:
+                self._run_enter_success_hooks_if_needed(current)
+                progress_timer.reset()
+                last_detected_page_key = current.key
+                reset_repeated_transition_failures()
+
+            if current == destination:
+                # current 来自 _refresh_current_page,其返回已是两帧稳定确认的结果,无需再次 confirm。
+                return self._finalize_arrival(destination, confirm_wait, start_time)
+
+            path = self._build_path(current, destination)
+            if not path:
+                if self.close_unknown_pages(skip_first_screenshot=False):
+                    progress_timer.reset()
+                    last_progress_signature = ("close_unknown", current.key)
+                    reset_repeated_transition_failures()
+                    continue
+                if progress_timer.reached():
+                    self._log_navigation_timeout(
+                        destination,
+                        last_path_signature=last_progress_signature,
+                        repeated_failure_transition_key=repeated_failure_transition_key,
+                        repeated_failure_count=repeated_failure_count,
+                        last_repeated_failure_close_result=last_repeated_failure_close_result,
+                    )
+                continue
+
+            path_signature = (current.key, " -> ".join(transition.key for transition in path))
+            if path_signature != last_progress_signature:
+                progress_timer.reset()
+                last_progress_signature = path_signature
+            logger.info(f"Current page: {current}. Following path:")
+            logger.info(" -> ".join([current.name, *[transition.destination.name for transition in path]]))
+
+            advanced = True
+            for transition in path:
+                if not self._execute_transition(transition):
+                    advanced = False
+                    if repeated_failure_transition_key == transition.key:
+                        repeated_failure_count += 1
+                    else:
+                        repeated_failure_transition_key = transition.key
+                        repeated_failure_count = 1
+                    if repeated_failure_count % self.REPEATED_TRANSITION_FAILURE_THRESHOLD == 0:
+                        close_success = self.close_unknown_pages(skip_first_screenshot=False)
+                        logger.warning(f"Transition {transition.key} repeated failure close result: {close_success}")
+                        if close_success:
+                            progress_timer.reset()
+                            last_progress_signature = ("close_unknown_after_repeated_failure", transition.key)
+                            reset_repeated_transition_failures()
+                    break
+                progress_timer.reset()
+                last_detected_page_key = transition.destination.key
+                last_repeated_failure_close_result = None
+                reset_repeated_transition_failures()
+
+            if advanced and self.navigator.current_page == destination:
+                # _execute_transition 的到达等待已对目标页完成两帧确认,直接收尾返回,避免回环重复确认。
+                return self._finalize_arrival(destination, confirm_wait, start_time)
+            if progress_timer.reached():
+                self._log_navigation_timeout(
+                    destination,
+                    last_path_signature=last_progress_signature,
+                    repeated_failure_transition_key=repeated_failure_transition_key,
+                    repeated_failure_count=repeated_failure_count,
+                    last_repeated_failure_close_result=last_repeated_failure_close_result,
+                )
+                raise GamePageUnknownError(f"Cannot goto page[{destination}]")

+ 123 - 247
tasks/GameUi/page.py

@@ -1,247 +1,123 @@
-from itertools import compress
-
-import random
-
-import traceback
-from module.atom.click import RuleClick
-from tasks.BondlingFairyland.assets import BondlingFairylandAssets
-from tasks.Duel.assets import DuelAssets
-from tasks.GlobalGame.assets import GlobalGameAssets as GGA
-from tasks.GameUi.assets import GameUiAssets as G
-from tasks.KekkaiUtilize.assets import KekkaiUtilizeAssets
-from tasks.Restart.assets import RestartAssets
-from tasks.base_task import BaseTask as BT
-from tasks.RyouToppa.assets import RyouToppaAssets
-
-
-class PageRegistry:
-    _registry = []
-
-    @classmethod
-    def register(cls, page):
-        cls._registry.append(page)
-
-    @classmethod
-    def all(cls):
-        return list(cls._registry)
-
-
-class Page:
-    def __init__(self, check_button, links=None):
-        if links is None:
-            links = {}
-        self.check_button = check_button
-        self.links = links
-        self.additional: list = None  # 附加按钮或者是ocr检测按钮
-        (filename, line_number, function_name, text) = traceback.extract_stack()[-2]
-        self.name = text[:text.find('=')].strip()
-        PageRegistry.register(self)
-
-    def __eq__(self, other):
-        return self.name == other.name
-
-    def __hash__(self):
-        return hash(self.name)
-
-    def __str__(self):
-        return self.name
-
-    def link(self, button, destination):
-        self.links[destination] = button
-
-
-#登录login
-page_login = Page(G.I_CHECK_LOGIN_FORM)
-# Main Home 主页
-page_main = Page(G.I_CHECK_MAIN)
-page_main.additional = [G.I_AD_CLOSE_RED, G.I_BACK_FRIENDS, RestartAssets.I_CANCEL_BATTLE,
-                            GGA.I_CHAT_CLOSE_BUTTON, G.I_CLOSE_CHAT_WINDOW,
-                            [G.I_MAIN_GOTO_SHIKIGAMI_RECORDS, RestartAssets.C_LOGIN_SCROLL_CLOSE_AREA, True]]
-# 召唤summon
-page_summon = Page(G.I_CHECK_SUMMON)
-page_summon.link(button=G.I_SUMMON_GOTO_MAIN, destination=page_main)
-page_main.link(button=G.I_MAIN_GOTO_SUMMON, destination=page_summon)
-# 探索exploration
-page_exploration = Page(G.I_CHECK_EXPLORATION)
-page_exploration.link(button=G.I_BACK_YOLLOW, destination=page_main)
-page_main.link(button=G.I_MAIN_GOTO_EXPLORATION, destination=page_exploration)
-# 町中town
-page_town = Page(G.I_CHECK_TOWN)
-page_town.link(button=G.I_TOWN_GOTO_MAIN, destination=page_main)
-page_main.link(button=G.I_MAIN_GOTO_TOWN, destination=page_town)
-
-# ************************************* 探索部分 *****************************************#
-# 觉醒 awake zones
-page_awake_zones = Page(G.I_CHECK_AWAKE)
-page_awake_zones.link(button=G.I_BACK_YOLLOW, destination=page_exploration)
-page_exploration.link(button=G.I_EXPLORATION_GOTO_AWAKE_ZONE, destination=page_awake_zones)
-# 御魂 soul zones
-page_soul_zones = Page(G.I_CHECK_SOUL_ZONES)
-page_soul_zones.link(button=G.I_BACK_YOLLOW, destination=page_exploration)
-page_exploration.link(button=G.I_EXPLORATION_GOTO_SOUL_ZONE, destination=page_soul_zones)
-# 结界突破 realm raid
-page_realm_raid = Page(G.I_CHECK_REALM_RAID)
-page_realm_raid.link(button=G.I_REALM_RAID_GOTO_EXPLORATION, destination=page_exploration)
-page_exploration.link(button=G.I_EXPLORATION_GOTO_REALM_RAID, destination=page_realm_raid)
-# 寮结界突破右上角 kekkai toppa
-page_kekkai_toppa = Page(G.I_KEKKAI_TOPPA)
-page_kekkai_toppa.link(button=G.I_REALM_RAID_GOTO_EXPLORATION, destination=page_exploration)
-page_realm_raid.link(button=RyouToppaAssets.I_RYOU_TOPPA, destination=page_kekkai_toppa)
-page_kekkai_toppa.link(button=G.I_RYOUTOPPA_GOTO_REALMRAID, destination=page_realm_raid)
-# 御灵 goryou realm
-page_goryou_realm = Page(G.I_CHECK_GORYOU)
-page_goryou_realm.link(button=G.I_BACK_YOLLOW, destination=page_exploration)
-page_exploration.link(button=G.I_EXPLORATION_GOTO_GORYOU_REALM, destination=page_goryou_realm)
-# 委派 delegation
-page_delegation = Page(G.I_CHECK_DELEGATION)
-page_delegation.link(button=G.I_BACK_YOLLOW, destination=page_exploration)
-page_exploration.link(button=G.I_EXPLORATION_GOTO_DELEGATION, destination=page_delegation)
-# 秘闻副本 SECRET zones
-page_secret_zones = Page(G.I_CHECK_SECRET_ZONES)
-page_secret_zones.link(button=G.I_BACK_YOLLOW, destination=page_exploration)
-page_exploration.link(button=G.I_EXPLORATION_GOTO_SECRET_ZONES, destination=page_secret_zones)
-# 地域鬼王 area boss
-page_area_boss = Page(G.I_CHECK_AREA_BOSS)
-page_area_boss.link(button=G.I_BACK_YOLLOW, destination=page_exploration)
-page_exploration.link(button=G.I_EXPLORATION_GOTO_AREA_BOSS, destination=page_area_boss)
-# 平安奇谭 heian kitan
-page_heian_kitan = Page(G.I_CHECK_HEIAN_KITAN)
-page_heian_kitan.link(button=G.I_CHECK_HEIAN_KITAN, destination=page_exploration)
-page_exploration.link(button=G.I_EXPLORATION_GOTO_HEIAN_KITAN, destination=page_heian_kitan)
-# 六道之门 six gates
-page_six_gates = Page(G.I_CHECK_SIX_GATES)
-page_six_gates.link(button=G.I_SIX_GATES_GOTO_EXPLORATION, destination=page_exploration)
-page_exploration.link(button=G.I_EXPLORATION_GOTO_SIX_GATES, destination=page_six_gates)
-# 契灵之境 bondling fairyland
-page_bondling_fairyland = Page(BondlingFairylandAssets.I_BALL_AREA)
-page_bondling_fairyland.link(button=G.I_BACK_YOLLOW, destination=page_exploration)
-page_exploration.link(button=G.I_EXPLORATION_GOTO_BONDLING_FAIRYLAND, destination=page_bondling_fairyland)
-# 英杰试炼 hero test
-page_hero_test = Page(G.I_CHECK_HERO_TEST)
-page_hero_test.link(button=G.I_BACK_YOLLOW, destination=page_exploration)
-page_exploration.link(button=G.I_EXPLORATION_GOTO_HERO_TEST, destination=page_hero_test)
-
-# ************************************* 町中部分 *****************************************#
-# 斗技 duel
-page_duel = Page(G.I_CHECK_DUEL)
-page_duel.additional = [DuelAssets.I_D_TRY]
-page_duel.link(button=G.I_BACK_YOLLOW, destination=page_town)
-page_town.link(button=G.I_TOWN_GOTO_DUEL, destination=page_duel)
-# 逢魔之时 demon_encounter
-page_demon_encounter = Page(G.I_CHECK_DEMON_ENCOUNTER)
-page_demon_encounter.link(button=G.I_BACK_YOLLOW, destination=page_town)
-page_town.link(button=G.I_TOWN_GOTO_DEMON_ENCOUNTER, destination=page_demon_encounter)
-# 逢魔之时现世逢魔 demon_encounter_realworld
-page_demon_encounter_realworld = Page(G.I_CHECK_DEMON_ENCOUNTER_REALWORLD)
-page_demon_encounter_realworld.link(button=G.I_BACK_YOLLOW, destination=page_demon_encounter)
-page_demon_encounter.link(button=G.I_DEMON_ENCOUNTER_REALWORLD_GOTO, destination=page_demon_encounter_realworld)
-# 狩猎战 hunt
-page_hunt = Page(G.I_CHECK_HUNT)
-page_hunt.link(button=G.I_BACK_YOLLOW, destination=page_town)
-page_town.link(button=G.I_TOWN_GOTO_HUNT, destination=page_hunt)
-# 狩猎战麒麟 hunt_kirin
-page_hunt_kirin = Page(G.I_CHECK_HUNT_KIRIN)
-page_hunt_kirin.link(button=G.I_BACK_YOLLOW, destination=page_town)
-page_town.link(button=G.I_TOWN_GOTO_HUNT, destination=page_hunt_kirin)
-# 协同斗技 draft_duel
-page_draft_duel = Page(G.I_CHECK_DRAFT_DUEL)
-page_draft_duel.link(button=G.I_BACK_YOLLOW, destination=page_town)
-page_town.link(button=G.I_TOWN_GOTO_DRAFT_DUEL, destination=page_draft_duel)
-# 百鬼弈 hyakkisen
-page_hyakkisen = Page(G.I_CHECK_HYAKKISEN)
-page_hyakkisen.link(button=G.I_BACK_YOLLOW, destination=page_town)
-page_town.link(button=G.I_TOWN_GOTO_HYAKKISEN, destination=page_hyakkisen)
-# 百鬼夜行
-page_hyakkiyakou = Page(G.I_CHECK_KYAKKIYAKOU)
-page_hyakkiyakou.link(button=G.I_HYAKKIYAKOU_CLOSE, destination=page_town)
-page_town.link(button=G.I_TOWN_GOTO_HYAKKIYAKOU, destination=page_hyakkiyakou)
-
-# ************************************* 庭院部分 *****************************************#
-# 式神录 shikigami_records
-page_shikigami_records = Page(G.I_CHECK_RECORDS)
-page_shikigami_records.additional = [G.I_AD_DISAPPEAR, G.I_RECORDS_CLOSE, GGA.I_UI_CANCEL_SAMLL]
-page_shikigami_records.link(button=G.I_BACK_Y, destination=page_main)
-page_main.link(button=G.I_MAIN_GOTO_SHIKIGAMI_RECORDS, destination=page_shikigami_records)
-# 阴阳术 onmyodo
-page_onmyodo = Page(G.I_CHECK_ONMYODO)
-page_onmyodo.link(button=G.I_BACK_Y, destination=page_main)
-page_main.link(button=G.I_MAIN_GOTO_ONMYODO, destination=page_onmyodo)
-# 好友 friends
-page_friends = Page(G.I_CHECK_FRIENDS)
-page_friends.link(button=G.I_BACK_Y, destination=page_main)
-page_main.link(button=G.I_MAIN_GOTO_FRIENDS, destination=page_friends)
-# 花合战 daily
-page_daily = Page(G.I_CHECK_DAILY)
-# 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_main.link(button=G.I_MAIN_GOTO_DAILY, destination=page_daily)
-from tasks.DailyTrifles.assets import DailyTriflesAssets
-
-# 商店 mall
-page_mall = Page(check_button=[G.I_CHECK_MALL, DailyTriflesAssets.I_ROOM_GIFT])
-page_mall.additional = [G.I_AD_CLOSE_RED, GGA.I_UI_CANCEL_SAMLL, G.I_BACK_Y]
-page_mall.link(button=G.I_BACK_YOLLOW, destination=page_main)
-page_main.link(button=G.I_MAIN_GOTO_MALL, destination=page_mall)
-# 阴阳寮 guild
-page_guild = Page(G.I_CHECK_GUILD)
-page_guild.additional = [KekkaiUtilizeAssets.I_PLANT_TREE_CLOSE, G.I_CLOSE_CHAT_WINDOW]
-page_guild.link(button=G.I_BACK_Y, destination=page_main)
-page_main.link(button=G.I_MAIN_GOTO_GUILD, destination=page_guild)
-# 组队 team
-page_team = Page(G.I_CHECK_TEAM)
-page_team.link(button=G.I_BACK_Y, destination=page_main)
-page_main.link(button=G.I_MAIN_GOTO_TEAM, destination=page_team)
-# 收集 collection
-page_collection = Page(G.I_CHECK_COLLECTION)
-page_collection.additional = [GGA.I_UI_CANCEL_SAMLL]
-page_collection.link(button=G.I_BACK_Y, destination=page_main)
-page_main.link(button=G.I_MAIN_GOTO_COLLECTION, destination=page_collection)
-# 珍旅居
-page_travel = Page(G.I_CHECK_TRAVEL)
-page_travel.link(button=G.I_BACK_Y, destination=page_main)
-page_main.link(button=G.I_MAIN_GOTO_TRAVEL, destination=page_travel)
-
-# 道馆
-from tasks.Component.GeneralBattle.assets import GeneralBattleAssets
-from tasks.Dokan.assets import DokanAssets
-
-page_dokan = Page(DokanAssets.I_RYOU_DOKAN_CHECK)
-page_dokan.additional = [GeneralBattleAssets.I_EXIT, DokanAssets.I_RYOU_DOKAN_EXIT_ENSURE, G.I_BACK_BLUE]
-page_dokan.link(button=G.I_BACK_Y, destination=page_main)
-
-# 摸鱼行动页面
-from tasks.WeeklyTrifles.assets import WeeklyTriflesAssets
-page_touch_fish = Page(WeeklyTriflesAssets.I_CHECK_TOUCH_FISH)
-page_guild.link(button=WeeklyTriflesAssets.I_GUILD_GOTO_TF,destination=page_touch_fish)
-page_touch_fish.link(button=WeeklyTriflesAssets.I_WT_TF_GOTO_MAIN,destination=page_main)
-
-
-# ************************************* 战斗部分 *****************************************#
-# 战斗界面
-# page_battle = Page(GeneralBattleAssets.I_BATTLE_INFO)
-#
-#
-def random_click(low: int = None, high: int = None, ltrb: tuple = (True, False, True, False)) -> RuleClick | list[RuleClick]:
-    """
-    随机生成RuleClick, 不传入参数则返回1个RuleClick, 传入参数则生成范围内的click数组
-    :return: RuleClick或者RuleClick的数组
-    """
-    from tasks.Component.GeneralBattle.assets import GeneralBattleAssets as GBA
-    click_area_list = [GBA.C_REWARD_1, GBA.C_REWARD_2, GBA.C_REWARD_3]
-    click = random.choice(list(compress(click_area_list, ltrb)))
-    click.name = "SAFE_RANDOM_CLICK"
-    if low is None or high is None:
-        return click
-    return [click for _ in range(random.randint(low, high))]
-#
-#
-# # 奖励界面
-# page_reward = Page(check_button=[GeneralBattleAssets.I_REWARD_PURPLE_SNAKE_SKIN, GeneralBattleAssets.I_REWARD,
-#                                  GeneralBattleAssets.I_REWARD_EXP_SOUL_4, GeneralBattleAssets.I_WIN,
-#                                  GeneralBattleAssets.I_REWARD_GOLD, GeneralBattleAssets.I_REWARD_GOLD_SNAKE_SKIN,
-#                                  GeneralBattleAssets.I_REWARD_SOUL_5, GeneralBattleAssets.I_REWARD_SOUL_6,
-#                                  GGA.I_UI_REWARD, ])
-# page_reward.additional = [random_click()]
-# # 失败界面
-# page_failed = Page(GeneralBattleAssets.I_FALSE)
-# page_failed.additional = [random_click()]
+from __future__ import annotations
+
+"""GameUi 页面公共导出层。
+
+外部任务统一继续从 `tasks.GameUi.page` 导入页面定义、页面模型和辅助组合器,
+内部实现已经拆分到多个独立文件中。
+"""
+
+from tasks.GameUi.action import ActionSequence, ConditionalAction, conditional_action, sequence
+from tasks.GameUi.default_pages import (
+    page_act_list,
+    page_area_boss,
+    page_awake_zones,
+    page_battle,
+    page_battle_prepare,
+    page_battle_result,
+    page_bondling_fairyland,
+    page_collection,
+    page_daily,
+    page_delegation,
+    page_demon_encounter,
+    page_demon_encounter_realworld,
+    page_draft_duel,
+    page_duel,
+    page_entertainment,
+    page_exploration,
+    page_friends,
+    page_goryou_realm,
+    page_guild,
+    page_heian_kitan,
+    page_hero_test,
+    page_hunt,
+    page_hunt_kirin,
+    page_hyakkiyakou,
+    page_kekkai_toppa,
+    page_login,
+    page_main,
+    page_mall,
+    page_mall_recommend,
+    page_onmyodo,
+    page_realm_raid,
+    page_reward,
+    page_secret_zones,
+    page_shikigami_records,
+    page_six_gates,
+    page_soul_zones,
+    page_summon,
+    page_team,
+    page_town,
+    page_travel,
+    page_shirin,
+    random_click,
+    page_battle_team,
+    page_battle_team_exit,
+    page_pet
+)
+from tasks.GameUi.matcher import AllMatcher, AnyMatcher, AtomMatcher, Matcher, NotMatcher, all_of, any_of, ensure_matcher, not_
+from tasks.GameUi.page_definition import Page, Transition
+from tasks.GameUi.registry import PageRegistry
+
+__all__ = [
+    "ActionSequence",
+    "AllMatcher",
+    "AnyMatcher",
+    "AtomMatcher",
+    "ConditionalAction",
+    "Matcher",
+    "NotMatcher",
+    "Page",
+    "PageRegistry",
+    "Transition",
+    "all_of",
+    "any_of",
+    "conditional_action",
+    "ensure_matcher",
+    "not_",
+    "page_act_list",
+    "page_area_boss",
+    "page_awake_zones",
+    "page_battle",
+    "page_battle_prepare",
+    "page_battle_result",
+    "page_bondling_fairyland",
+    "page_collection",
+    "page_daily",
+    "page_delegation",
+    "page_demon_encounter",
+    "page_demon_encounter_realworld",
+    "page_draft_duel",
+    "page_duel",
+    "page_entertainment",
+    "page_exploration",
+    "page_friends",
+    "page_goryou_realm",
+    "page_guild",
+    "page_heian_kitan",
+    "page_hero_test",
+    "page_hunt",
+    "page_hunt_kirin",
+    "page_hyakkiyakou",
+    "page_kekkai_toppa",
+    "page_login",
+    "page_main",
+    "page_mall",
+    "page_mall_recommend",
+    "page_onmyodo",
+    "page_realm_raid",
+    "page_reward",
+    "page_secret_zones",
+    "page_shikigami_records",
+    "page_six_gates",
+    "page_soul_zones",
+    "page_summon",
+    "page_team",
+    "page_town",
+    "page_travel",
+    "page_shirin",
+    "random_click",
+    "sequence",
+    "page_battle_team",
+    "page_battle_team_exit",
+    "page_pet"
+]

+ 20 - 0
tasks/GameUi/page/image_act_list.json

@@ -0,0 +1,20 @@
+[
+  {
+    "itemName": "act_list_goto_act",
+    "imageName": "page_act_list_goto_act.png",
+    "roiFront": "1063,627,156,60",
+    "roiBack": "1007,552,272,166",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "活动列表页前往活动"
+  },
+  {
+    "itemName": "check_act_list",
+    "imageName": "page_check_act_list.png",
+    "roiFront": "112,13,125,44",
+    "roiBack": "75,3,205,66",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "活动列表页标志"
+  }
+]

+ 335 - 0
tasks/GameUi/page/image_exploration.json

@@ -0,0 +1,335 @@
+[
+  {
+    "itemName": "check_exploration",
+    "imageName": "page_check_exploration.png",
+    "roiFront": "1152,148,21,22",
+    "roiBack": "1152,148,21,22",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索界面标识"
+  },
+  {
+    "itemName": "exploration_goto_awake_zone",
+    "imageName": "page_exploration_goto_awake_zone.png",
+    "roiFront": "161,633,47,44",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往觉醒"
+  },
+  {
+    "itemName": "exploration_goto_soul_zone",
+    "imageName": "page_exploration_goto_soul_zone.png",
+    "roiFront": "69,633,46,39",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往御魂"
+  },
+  {
+    "itemName": "exploration_goto_realm_raid",
+    "imageName": "page_exploration_goto_realm_raid.png",
+    "roiFront": "354,636,49,38",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往结界突破"
+  },
+  {
+    "itemName": "exploration_goto_goryou_realm",
+    "imageName": "page_exploration_goto_goryou_realm.png",
+    "roiFront": "353,639,47,45",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "探索前往御灵"
+  },
+  {
+    "itemName": "exploration_goto_delegation",
+    "imageName": "page_exploration_goto_delegation.png",
+    "roiFront": "448,634,54,39",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往式神委派"
+  },
+  {
+    "itemName": "exploration_goto_secret_zones",
+    "imageName": "page_exploration_goto_secret_zones.png",
+    "roiFront": "546,635,51,42",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往秘闻"
+  },
+  {
+    "itemName": "exploration_goto_hero_test",
+    "imageName": "page_exploration_goto_hero_test.png",
+    "roiFront": "829,634,58,56",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往英杰试炼"
+  },
+  {
+    "itemName": "exploration_goto_area_boss",
+    "imageName": "page_exploration_goto_area_boss.png",
+    "roiFront": "642,638,50,38",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往地域鬼王"
+  },
+  {
+    "itemName": "exploration_goto_heian_kitan",
+    "imageName": "page_exploration_goto_heian_kitan.png",
+    "roiFront": "739,643,52,44",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往平安奇谭"
+  },
+  {
+    "itemName": "exploration_goto_bondling_fairyland",
+    "imageName": "page_exploration_goto_bondling_fairyland.png",
+    "roiFront": "1024,635,52,47",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往契灵之境"
+  },
+  {
+    "itemName": "check_awake",
+    "imageName": "page_check_awake.png",
+    "roiFront": "165,533,39,45",
+    "roiBack": "115,521,201,120",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "觉醒页面标志(必须在下方,觉醒页面有动画加载)"
+  },
+  {
+    "itemName": "check_soul_zones",
+    "imageName": "page_check_soul_zones.png",
+    "roiFront": "1188,635,48,46",
+    "roiBack": "1158,616,103,93",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "八岐大蛇页面标志(同觉醒逻辑back固定刚好等待加载动画)"
+  },
+  {
+    "itemName": "check_realm_raid",
+    "imageName": "page_check_realm_raid.png",
+    "roiFront": "129,632,52,48",
+    "roiBack": "66,526,233,188",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "个人突破页面标志"
+  },
+  {
+    "itemName": "check_hero_test",
+    "imageName": "page_check_hero_test.png",
+    "roiFront": "148,10,133,48",
+    "roiBack": "137,0,157,71",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "英杰试炼页面标志"
+  },
+  {
+    "itemName": "check_goryou",
+    "imageName": "page_check_goryou.png",
+    "roiFront": "880,8,30,39",
+    "roiBack": "880,8,30,39",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "御灵页面标志"
+  },
+  {
+    "itemName": "check_delegation",
+    "imageName": "page_check_delegation.png",
+    "roiFront": "839,132,49,45",
+    "roiBack": "839,132,49,45",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "委派页面标志"
+  },
+  {
+    "itemName": "check_secret_zones",
+    "imageName": "page_check_secret_zones.png",
+    "roiFront": "1145,592,110,119",
+    "roiBack": "1145,592,110,119",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "秘闻页面标志"
+  },
+  {
+    "itemName": "check_area_boss",
+    "imageName": "page_check_area_boss.png",
+    "roiFront": "20,320,150,130",
+    "roiBack": "20,320,150,130",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "地鬼页面标志"
+  },
+  {
+    "itemName": "check_heian_kitan",
+    "imageName": "page_check_heian_kitan.png",
+    "roiFront": "27,48,47,39",
+    "roiBack": "27,48,47,39",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "平安奇谭页面标志"
+  },
+  {
+    "itemName": "check_bondling_fairyland",
+    "imageName": "page_check_bondling_fairyland.png",
+    "roiFront": "614,660,56,49",
+    "roiBack": "582,630,130,90",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "契灵页面标志"
+  },
+  {
+    "itemName": "ryoutoppa_goto_realmraid",
+    "imageName": "page_ryoutoppa_goto_realmraid.png",
+    "roiFront": "1201,234,62,105",
+    "roiBack": "1201,234,62,105",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "寮突切换到个突按钮"
+  },
+  {
+    "itemName": "kekkai_toppa",
+    "imageName": "page_kekkai_toppa.png",
+    "roiFront": "1065,3,203,61",
+    "roiBack": "1065,3,203,61",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "寮突页面标志"
+  },
+  {
+    "itemName": "realm_raid_goto_shikigami_records",
+    "imageName": "page_realm_raid_goto_shikigami_records.png",
+    "roiFront": "1208,610,45,44",
+    "roiBack": "1166,520,112,198",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "突破进入式神录按钮"
+  },
+  {
+    "itemName": "exploration_to_moon_sea",
+    "imageName": "page_exploration_to_moon_sea.png",
+    "roiFront": "930,635,49,44",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往月之海"
+  },
+  {
+    "itemName": "exploration_to_incense_realm",
+    "imageName": "page_exploration_to_incense_realm.png",
+    "roiFront": "930,635,49,44",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往香行域"
+  },
+  {
+    "itemName": "exploration_to_seasonrift_forest",
+    "imageName": "page_exploration_to_seasonrift_forest.png",
+    "roiFront": "930,635,49,44",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往错季森"
+  },
+  {
+    "itemName": "exploration_to_pure_buddha_realm",
+    "imageName": "page_exploration_to_pure_buddha_realm.png",
+    "roiFront": "930,635,49,44",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往净佛刹"
+  },
+  {
+    "itemName": "exploration_to_mantra_tower",
+    "imageName": "page_exploration_to_mantra_tower.png",
+    "roiFront": "930,635,49,44",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往真言塔"
+  },
+  {
+    "itemName": "exploration_to_peacock_kingdom",
+    "imageName": "page_exploration_to_peacock_kingdom.png",
+    "roiFront": "930,635,49,44",
+    "roiBack": "33,619,1150,99",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "探索前往孔雀国"
+  },
+  {
+    "itemName": "check_moon_sea",
+    "imageName": "page_check_moon_sea.png",
+    "roiFront": "347,163,29,106",
+    "roiBack": "296,117,165,256",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "月之海标志"
+  },
+  {
+    "itemName": "check_incense_realm",
+    "imageName": "page_check_incense_realm.png",
+    "roiFront": "347,163,29,106",
+    "roiBack": "296,117,165,256",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "香行域标志"
+  },
+  {
+    "itemName": "check_seasonrift_forest",
+    "imageName": "page_check_seasonrift_forest.png",
+    "roiFront": "348,158,30,106",
+    "roiBack": "296,117,165,256",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "错季森标志"
+  },
+  {
+    "itemName": "check_pure_buddha_realm",
+    "imageName": "page_check_pure_buddha_realm.png",
+    "roiFront": "348,158,30,106",
+    "roiBack": "296,117,165,256",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "净佛刹标志"
+  },
+  {
+    "itemName": "check_mantra_tower",
+    "imageName": "page_check_mantra_tower.png",
+    "roiFront": "348,158,30,106",
+    "roiBack": "296,117,165,256",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "真言塔标志"
+  },
+  {
+    "itemName": "check_peacock_kingdom",
+    "imageName": "page_check_peacock_kingdom.png",
+    "roiFront": "348,158,30,106",
+    "roiBack": "296,117,165,256",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "孔雀国标志"
+  },
+  {
+    "itemName": "check_six_gates",
+    "imageName": "page_check_six_gates.png",
+    "roiFront": "411,297,21,21",
+    "roiBack": "395,262,54,85",
+    "method": "Template matching",
+    "threshold": 0.85,
+    "description": "六道之门检查(移植自mine)"
+  }
+]

+ 283 - 0
tasks/GameUi/page/image_main.json

@@ -0,0 +1,283 @@
+[
+  {
+    "itemName": "check_main",
+    "imageName": "page_check_main.png",
+    "roiFront": "807,108,76,45",
+    "roiBack": "49,98,1033,61",
+    "method": "Template matching",
+    "threshold": 0.95,
+    "description": "庭院标志"
+  },
+  {
+    "itemName": "main_scroll_close",
+    "imageName": "page_main_scroll_close.png",
+    "roiFront": "1181,634,28,39",
+    "roiBack": "1162,595,77,112",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "庭院卷轴关闭标识"
+  },
+  {
+    "itemName": "main_goto_exploration",
+    "imageName": "page_main_goto_exploration.png",
+    "roiFront": "493,116,45,75",
+    "roiBack": "243,100,933,211",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "庭院探索标志"
+  },
+  {
+    "itemName": "main_goto_town",
+    "imageName": "page_main_goto_town.png",
+    "roiFront": "706,249,61,57",
+    "roiBack": "200,120,951,298",
+    "method": "Template matching",
+    "threshold": 0.6,
+    "description": "庭院町中标志"
+  },
+  {
+    "itemName": "main_goto_shikigami_records",
+    "imageName": "page_main_goto_shikigami_records.png",
+    "roiFront": "1080,590,56,64",
+    "roiBack": "1080,590,120,100",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "庭院前往式神录"
+  },
+  {
+    "itemName": "main_goto_onmyodo",
+    "imageName": "page_main_goto_onmyodo.png",
+    "roiFront": "960,590,39,36",
+    "roiBack": "960,590,120,100",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "庭院前往阴阳术"
+  },
+  {
+    "itemName": "main_goto_friends",
+    "imageName": "page_main_goto_friends.png",
+    "roiFront": "845,590,55,55",
+    "roiBack": "845,590,120,100",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "庭院前往好友"
+  },
+  {
+    "itemName": "main_goto_daily",
+    "imageName": "page_main_goto_daily.png",
+    "roiFront": "790,618,49,40",
+    "roiBack": "735,590,120,100",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "进入花合战"
+  },
+  {
+    "itemName": "main_goto_mall",
+    "imageName": "page_main_goto_mall.png",
+    "roiFront": "664,661,40,18",
+    "roiBack": "601,613,163,78",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "庭院前往商店"
+  },
+  {
+    "itemName": "main_goto_guild",
+    "imageName": "page_main_goto_guild.png",
+    "roiFront": "495,590,50,22",
+    "roiBack": "495,590,120,100",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "庭院前往阴阳寮"
+  },
+  {
+    "itemName": "main_goto_team",
+    "imageName": "page_main_goto_team.png",
+    "roiFront": "395,590,38,48",
+    "roiBack": "395,590,120,100",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "庭院前往组队"
+  },
+  {
+    "itemName": "main_goto_collection",
+    "imageName": "page_main_goto_collection.png",
+    "roiFront": "70,590,36,41",
+    "roiBack": "70,590,120,100",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "庭院前往图鉴"
+  },
+  {
+    "itemName": "main_goto_travel",
+    "imageName": "page_main_goto_travel.png",
+    "roiFront": "170,590,64,61",
+    "roiBack": "170,590,120,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "庭院前往珍旅居"
+  },
+  {
+    "itemName": "check_travel",
+    "imageName": "page_check_travel.png",
+    "roiFront": "1134,583,78,77",
+    "roiBack": "1134,583,78,77",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "珍旅居页面标志"
+  },
+  {
+    "itemName": "check_records",
+    "imageName": "page_check_records.png",
+    "roiFront": "269,71,55,50",
+    "roiBack": "269,71,55,50",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "式神录页面标志"
+  },
+  {
+    "itemName": "check_onmyodo",
+    "imageName": "page_check_onmyodo.png",
+    "roiFront": "1166,117,84,547",
+    "roiBack": "1166,117,84,547",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "阴阳术页面标志"
+  },
+  {
+    "itemName": "check_friends",
+    "imageName": "page_check_friends.png",
+    "roiFront": "27,251,29,47",
+    "roiBack": "5,216,86,106",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "好友页面标志"
+  },
+  {
+    "itemName": "check_daily",
+    "imageName": "page_check_daily.png",
+    "roiFront": "28,515,58,62",
+    "roiBack": "1,487,154,145",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "花合战页面标志"
+  },
+  {
+    "itemName": "check_mall",
+    "imageName": "page_check_mall.png",
+    "roiFront": "231,455,131,78",
+    "roiBack": "201,432,185,121",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "商店页面标志"
+  },
+  {
+    "itemName": "check_mall_recommend",
+    "imageName": "page_check_mall_recommend.png",
+    "roiFront": "930,12,42,37",
+    "roiBack": "905,0,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "商店推荐页面标志"
+  },
+  {
+    "itemName": "check_guild",
+    "imageName": "page_check_guild.png",
+    "roiFront": "1072,630,49,46",
+    "roiBack": "1072,630,49,46",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "阴阳寮页面标志"
+  },
+  {
+    "itemName": "check_team",
+    "imageName": "page_check_team.png",
+    "roiFront": "32,585,82,65",
+    "roiBack": "0,563,148,139",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "组队页面标志"
+  },
+  {
+    "itemName": "check_collection",
+    "imageName": "page_check_collection.png",
+    "roiFront": "380,620,100,100",
+    "roiBack": "371,608,880,112",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "图鉴页面标志"
+  },
+  {
+    "itemName": "back_daily",
+    "imageName": "page_back_daily.png",
+    "roiFront": "33,13,39,50",
+    "roiBack": "33,13,39,50",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "花合战退出标志"
+  },
+  {
+    "itemName": "main_goto_summon",
+    "imageName": "page_main_goto_summon.png",
+    "roiFront": "1073,174,57,65",
+    "roiBack": "571,153,586,124",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "庭院召唤标志"
+  },
+  {
+    "itemName": "check_summon",
+    "imageName": "page_check_summon.png",
+    "roiFront": "750,580,30,28",
+    "roiBack": "578,516,419,204",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "召唤页面标志"
+  },
+  {
+    "itemName": "check_shrin",
+    "imageName": "page_check_shrin.png",
+    "roiFront": "80,92,33,97",
+    "roiBack": "56,73,84,138",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "阴阳寮神社左上角"
+  },
+  {
+    "itemName": "guild_to_shrin",
+    "imageName": "page_guild_to_shrin.png",
+    "roiFront": "877,629,49,53",
+    "roiBack": "840,602,302,113",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "阴阳寮前往神社"
+  },
+  {
+    "itemName": "back_y",
+    "imageName": "page_back_y.png",
+    "roiFront": "15,4,57,52",
+    "roiBack": "1,2,100,91",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "黄色返回按钮(移植自mine)"
+  }
+,
+  {
+    "itemName": "back_yollow",
+    "imageName": "page_back_yollow.png",
+    "roiFront": "24,16,48,55",
+    "roiBack": "0,0,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "黄色返回按钮-大(移植自mine)"
+  }
+,
+  {
+    "itemName": "summon_goto_main",
+    "imageName": "page_summon_goto_main.png",
+    "roiFront": "27,5,49,51",
+    "roiBack": "0,0,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "召唤页返回主页(移植自mine)"
+  }
+]

+ 174 - 0
tasks/GameUi/page/image_town.json

@@ -0,0 +1,174 @@
+[
+    {
+        "itemName": "check_town",
+        "imageName": "page_check_town.png",
+        "roiFront": "1026,106,68,82",
+        "roiBack": "765,98,402,96",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "description"
+    },
+    {
+        "itemName": "town_goto_main",
+        "imageName": "page_town_goto_main.png",
+        "roiFront": "1017,231,78,73",
+        "roiBack": "302,216,868,127",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "description"
+    },
+    {
+        "itemName": "town_goto_duel",
+        "imageName": "page_town_goto_duel.png",
+        "roiFront": "756,142,48,68",
+        "roiBack": "357,126,657,100",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "description"
+    },
+    {
+        "itemName": "town_goto_demon_encounter",
+        "imageName": "page_town_goto_demon_encounter.png",
+        "roiFront": "617,135,51,75",
+        "roiBack": "232,121,873,100",
+        "method": "Template matching",
+        "threshold": 0.7,
+        "description": "description"
+    },
+    {
+        "itemName": "town_goto_hunt",
+        "imageName": "page_town_goto_hunt.png",
+        "roiFront": "475,138,46,69",
+        "roiBack": "275,122,520,100",
+        "method": "Template matching",
+        "threshold": 0.7,
+        "description": "description"
+    },
+    {
+        "itemName": "town_goto_draft_duel",
+        "imageName": "page_town_goto_draft_duel.png",
+        "roiFront": "335,159,55,72",
+        "roiBack": "170,145,567,100",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "协同对弈"
+    },
+    {
+        "itemName": "town_goto_hyakkisen",
+        "imageName": "page_town_goto_hyakkisen.png",
+        "roiFront": "192,145,48,67",
+        "roiBack": "86,130,447,100",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "百鬼奕"
+    },
+    {
+        "itemName": "check_duel",
+        "imageName": "page_check_duel.png",
+        "roiFront": "149,16,64,38",
+        "roiBack": "133,0,110,74",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "斗技主界面左上角文字图像"
+    },
+    {
+        "itemName": "check_demon_encounter",
+        "imageName": "page_check_demon_encounter.png",
+        "roiFront": "26,658,42,43",
+        "roiBack": "2,619,100,100",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "现世逢魔页面标志"
+    },
+    {
+        "itemName": "check_hunt",
+        "imageName": "page_check_hunt.png",
+        "roiFront": "575,30,46,25",
+        "roiBack": "553,1,81,68",
+        "method": "Template matching",
+        "threshold": 0.7,
+        "description": "检查狩猎战界面"
+    },
+    {
+        "itemName": "check_hunt_kirin",
+        "imageName": "page_check_hunt_kirin.png",
+        "roiFront": "353,240,30,54",
+        "roiBack": "328,234,81,68",
+        "method": "Template matching",
+        "threshold": 0.7,
+        "description": "检查狩猎战麒麟界面"
+    },
+    {
+        "itemName": "check_draft_duel",
+        "imageName": "page_check_draft_duel.png",
+        "roiFront": "1051,612,56,58",
+        "roiBack": "1029,594,100,100",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "description"
+    },
+    {
+        "itemName": "town_goto_hyakkiyakou",
+        "imageName": "page_town_goto_hyakkiyakou.png",
+        "roiFront": "880,165,53,69",
+        "roiBack": "827,149,148,100",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "町中进入百鬼标志"
+    },
+    {
+        "itemName": "check_kyakkiyakou",
+        "imageName": "page_check_kyakkiyakou.png",
+        "roiFront": "1062,564,84,73",
+        "roiBack": "68,519,1185,141",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "百鬼夜行标志"
+    },
+    {
+        "itemName": "check_demon_encounter_2",
+        "imageName": "page_check_demon_encounter_2.png",
+        "roiFront": "501,441,53,122",
+        "roiBack": "358,326,370,288",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "逢魔之时新页面标志"
+    },
+    {
+        "itemName": "town_goto_entertainment",
+        "imageName": "page_town_goto_entertainment.png",
+        "roiFront": "201,144,35,26",
+        "roiBack": "201,144,35,26",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "町中前往娱乐区域"
+    },
+    {
+        "itemName": "check_entertainment",
+        "imageName": "page_check_entertainment.png",
+        "roiFront": "151,18,102,40",
+        "roiBack": "151,18,102,40",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "娱乐区域页面标志"
+    },
+    {
+        "itemName": "check_demon_encounter_realworld",
+        "imageName": "page_check_demon_encounter_realworld.png",
+        "roiFront": "26,658,42,43",
+        "roiBack": "2,619,100,100",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "检查逢魔之时现世逢魔界面(移植自mine)"
+    }
+,
+    {
+        "itemName": "demon_encounter_realworld_goto",
+        "imageName": "page_demon_encounter_realworld.png",
+        "roiFront": "994,485,106,30",
+        "roiBack": "994,485,106,30",
+        "method": "Template matching",
+        "threshold": 0.8,
+        "description": "进入现世逢魔(移植自mine)"
+    }
+]

+ 0 - 0
tasks/GameUi/page/page_list_act_img.json → tasks/GameUi/page/list_image_act_list.json


+ 13 - 0
tasks/GameUi/page/list_ocr_act_list.json

@@ -0,0 +1,13 @@
+{
+  "name": "act_list_ocr",
+  "direction": "vertical",
+  "type": "ocr",
+  "roiBack": "50,123,49,553",
+  "description": "活动列表页爬塔活动文字",
+  "list": [
+    {
+      "itemName": "版本",
+      "roiFront": "52,124,45,69"
+    }
+  ]
+}

BIN
tasks/GameUi/page/page_act_list_goto_act.png


BIN
tasks/GameUi/page/page_check_act_list.png


BIN
tasks/GameUi/page/page_check_awake.png


BIN
tasks/GameUi/page/page_check_demon_encounter.png


BIN
tasks/GameUi/page/page_check_demon_encounter_2.png


BIN
tasks/GameUi/page/page_check_entertainment.png


BIN
tasks/GameUi/page/page_check_exploration.png


BIN
tasks/GameUi/page/page_check_goryou.png


BIN
tasks/GameUi/page/page_check_hyakkisen.png


BIN
tasks/GameUi/page/page_check_incense_realm.png


BIN
tasks/GameUi/page/page_check_kyakkiyakou.png


BIN
tasks/GameUi/page/page_check_mall.png


BIN
tasks/GameUi/page/page_check_mall_recommend.png


BIN
tasks/GameUi/page/page_check_mantra_tower.png


BIN
tasks/GameUi/page/page_check_moon_sea.png


BIN
tasks/GameUi/page/page_check_peacock_kingdom.png


BIN
tasks/GameUi/page/page_check_pure_buddha_realm.png


BIN
tasks/GameUi/page/page_check_seasonrift_forest.png


BIN
tasks/GameUi/page/page_check_shrin.png


BIN
tasks/GameUi/page/page_check_soul_zones.png


BIN
tasks/GameUi/page/page_check_team.png


BIN
tasks/GameUi/page/page_exploration_goto_area_boss.png


BIN
tasks/GameUi/page/page_exploration_goto_awake_zone.png


BIN
tasks/GameUi/page/page_exploration_goto_bondling_fairyland.png


BIN
tasks/GameUi/page/page_exploration_goto_delegation.png


BIN
tasks/GameUi/page/page_exploration_goto_goryou_realm.png


BIN
tasks/GameUi/page/page_exploration_goto_hero_test.png


BIN
tasks/GameUi/page/page_exploration_goto_realm_raid.png


BIN
tasks/GameUi/page/page_exploration_goto_secret_zones.png


BIN
tasks/GameUi/page/page_exploration_goto_six_gates.png


BIN
tasks/GameUi/page/page_exploration_goto_soul_zone.png


BIN
tasks/GameUi/page/page_exploration_to_incense_realm.png


BIN
tasks/GameUi/page/page_exploration_to_mantra_tower.png


BIN
tasks/GameUi/page/page_exploration_to_moon_sea.png


BIN
tasks/GameUi/page/page_exploration_to_peacock_kingdom.png


BIN
tasks/GameUi/page/page_exploration_to_pure_buddha_realm.png


BIN
tasks/GameUi/page/page_exploration_to_seasonrift_forest.png


BIN
tasks/GameUi/page/page_guild_to_shrin.png


+ 0 - 254
tasks/GameUi/page/page_img.json

@@ -1,254 +0,0 @@
-[
-  {
-    "itemName": "check_main",
-    "imageName": "page_check_main.png",
-    "roiFront": "807,108,76,45",
-    "roiBack": "49,98,1033,61",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "main_scroll_close",
-    "imageName": "page_main_scroll_close.png",
-    "roiFront": "1181,634,28,39",
-    "roiBack": "1162,595,77,112",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "庭院卷轴关闭标识"
-  },
-  {
-    "itemName": "main_goto_exploration",
-    "imageName": "page_main_goto_exploration.png",
-    "roiFront": "493,116,45,75",
-    "roiBack": "243,100,933,211",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_exploration",
-    "imageName": "page_check_exploration.png",
-    "roiFront": "681,12,27,36",
-    "roiBack": "661,0,70,61",
-    "method": "Template matching",
-    "threshold": 0.65,
-    "description": "description"
-  },
-  {
-    "itemName": "exploration_goto_awake_zone",
-    "imageName": "page_exploration_goto_awake_zone.png",
-    "roiFront": "65,632,50,41",
-    "roiBack": "33,619,1125,98",
-    "method": "Template matching",
-    "threshold": 0.65,
-    "description": "探索前往觉醒"
-  },
-  {
-    "itemName": "exploration_goto_soul_zone",
-    "imageName": "page_exploration_goto_soul_zone.png",
-    "roiFront": "165,639,44,36",
-    "roiBack": "38,621,1106,98",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "探索前往御魂"
-  },
-  {
-    "itemName": "exploration_goto_realm_raid",
-    "imageName": "page_exploration_goto_realm_raid.png",
-    "roiFront": "263,636,51,46",
-    "roiBack": "42,618,1103,100",
-    "method": "Template matching",
-    "threshold": 0.65,
-    "description": "探索前往结界突破"
-  },
-  {
-    "itemName": "exploration_goto_goryou_realm",
-    "imageName": "page_exploration_goto_goryou_realm.png",
-    "roiFront": "353,639,47,45",
-    "roiBack": "49,613,1107,105",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "探索前往御灵"
-  },
-  {
-    "itemName": "exploration_goto_delegation",
-    "imageName": "page_exploration_goto_delegation.png",
-    "roiFront": "453,639,53,37",
-    "roiBack": "43,609,1107,107",
-    "method": "Template matching",
-    "threshold": 0.65,
-    "description": "探索前往式神委派"
-  },
-  {
-    "itemName": "exploration_goto_secret_zones",
-    "imageName": "page_exploration_goto_secret_zones.png",
-    "roiFront": "549,633,53,40",
-    "roiBack": "44,617,1102,99",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "探索前往秘闻"
-  },
-  {
-    "itemName": "exploration_goto_area_boss",
-    "imageName": "page_exploration_goto_area_boss.png",
-    "roiFront": "640,638,51,45",
-    "roiBack": "33,622,1103,90",
-    "method": "Template matching",
-    "threshold": 0.65,
-    "description": "探索前往地域鬼王"
-  },
-  {
-    "itemName": "exploration_goto_heian_kitan",
-    "imageName": "page_exploration_goto_heian_kitan.png",
-    "roiFront": "739,643,52,44",
-    "roiBack": "35,615,1097,102",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "探索前往平安奇谭"
-  },
-  {
-    "itemName": "exploration_goto_six_gates",
-    "imageName": "page_exploration_goto_six_gates.png",
-    "roiFront": "529,679,93,30",
-    "roiBack": "46,618,1090,100",
-    "method": "Template matching",
-    "threshold": 0.65,
-    "description": "探索前往六道之门"
-  },
-  {
-    "itemName": "exploration_goto_bondling_fairyland",
-    "imageName": "page_exploration_goto_bondling_fairyland.png",
-    "roiFront": "1032,634,46,50",
-    "roiBack": "41,619,1104,96",
-    "method": "Template matching",
-    "threshold": 0.65,
-    "description": "探索前往契灵之境"
-  },
-  {
-    "itemName": "back_blue",
-    "imageName": "page_back_blue.png",
-    "roiFront": "32,37,54,52",
-    "roiBack": "3,2,130,114",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_awake",
-    "imageName": "page_check_awake.png",
-    "roiFront": "164,534,42,41",
-    "roiBack": "124,524,197,119",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_soul_zones",
-    "imageName": "page_check_soul_zones.png",
-    "roiFront": "1193,636,40,40",
-    "roiBack": "1131,591,149,128",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_realm_raid",
-    "imageName": "page_check_realm_raid.png",
-    "roiFront": "129,632,52,48",
-    "roiBack": "66,526,233,188",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "description"
-  },
-  {
-    "itemName": "check_goryou",
-    "imageName": "page_check_goryou.png",
-    "roiFront": "881,17,30,39",
-    "roiBack": "881,17,30,39",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_delegation",
-    "imageName": "page_check_delegation.png",
-    "roiFront": "839,132,49,45",
-    "roiBack": "839,132,49,45",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_secret_zones",
-    "imageName": "page_check_secret_zones.png",
-    "roiFront": "1145,592,110,119",
-    "roiBack": "1145,592,110,119",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_area_boss",
-    "imageName": "page_check_area_boss.png",
-    "roiFront": "20,320,150,130",
-    "roiBack": "20,320,150,130",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_heian_kitan",
-    "imageName": "page_check_heian_kitan.png",
-    "roiFront": "27,48,47,39",
-    "roiBack": "27,48,47,39",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_six_gates",
-    "imageName": "page_check_six_gates.png",
-    "roiFront": "411,297,21,21",
-    "roiBack": "395,262,54,85",
-    "method": "Template matching",
-    "threshold": 0.85,
-    "description": "六道之门检查"
-  },
-  {
-    "itemName": "check_bondling_fairyland",
-    "imageName": "page_check_bondling_fairyland.png",
-    "roiFront": "614,660,56,49",
-    "roiBack": "614,660,56,49",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "six_gates_goto_exploration",
-    "imageName": "page_six_gates_goto_exploration.png",
-    "roiFront": "18,19,52,55",
-    "roiBack": "18,19,52,55",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "bondling_goto_exploration",
-    "imageName": "page_bondling_goto_exploration.png",
-    "roiFront": "20,13,60,59",
-    "roiBack": "20,13,60,59",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "ryoutoppa_goto_realmraid",
-    "imageName": "page_ryoutoppa_goto_realmraid.png",
-    "roiFront": "1201,234,62,105",
-    "roiBack": "1201,234,62,105",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  }
-]

+ 0 - 191
tasks/GameUi/page/page_img_2.json

@@ -1,191 +0,0 @@
-[
-  {
-    "itemName": "main_goto_town",
-    "imageName": "page_main_goto_town.png",
-    "roiFront": "706,249,61,57",
-    "roiBack": "200,120,951,298",
-    "method": "Template matching",
-    "threshold": 0.6,
-    "description": "description"
-  },
-  {
-    "itemName": "check_town",
-    "imageName": "page_check_town.png",
-    "roiFront": "1026,106,68,82",
-    "roiBack": "765,98,402,96",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "town_goto_main",
-    "imageName": "page_town_goto_main.png",
-    "roiFront": "1017,231,78,73",
-    "roiBack": "302,216,868,127",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "town_goto_duel",
-    "imageName": "page_town_goto_duel.png",
-    "roiFront": "756,142,48,68",
-    "roiBack": "357,126,657,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "town_goto_demon_encounter",
-    "imageName": "page_town_goto_demon_encounter.png",
-    "roiFront": "617,135,51,75",
-    "roiBack": "232,121,873,100",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "description"
-  },
-  {
-    "itemName": "town_goto_hunt",
-    "imageName": "page_town_goto_hunt.png",
-    "roiFront": "475,138,46,69",
-    "roiBack": "275,122,520,100",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "description"
-  },
-  {
-    "itemName": "town_goto_draft_duel",
-    "imageName": "page_town_goto_draft_duel.png",
-    "roiFront": "335,159,55,72",
-    "roiBack": "170,145,567,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "协同对弈"
-  },
-  {
-    "itemName": "town_goto_hyakkisen",
-    "imageName": "page_town_goto_hyakkisen.png",
-    "roiFront": "192,145,48,67",
-    "roiBack": "86,130,447,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "百鬼奕"
-  },
-  {
-    "itemName": "check_duel",
-    "imageName": "page_check_duel.png",
-    "roiFront": "149,16,64,38",
-    "roiBack": "133,0,110,74",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "斗技主界面左上角文字图像"
-  },
-  {
-    "itemName": "check_demon_encounter",
-    "imageName": "page_check_demon_encounter.png",
-    "roiFront": "153,16,129,38",
-    "roiBack": "153,16,129,38",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_demon_encounter_realworld",
-    "imageName": "page_check_demon_encounter_realworld.png",
-    "roiFront": "26,658,42,43",
-    "roiBack": "2,619,100,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "检查逢魔之时现世逢魔界面"
-  },
-  {
-    "itemName": "demon_encounter_realworld_goto",
-    "imageName": "page_demon_encounter_realworld.png",
-    "roiFront": "994,485,106,30",
-    "roiBack": "994,485,106,30",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "逢魔之时进入现世逢魔"
-  },
-  {
-    "itemName": "check_hunt",
-    "imageName": "page_check_hunt.png",
-    "roiFront": "575,30,46,25",
-    "roiBack": "553,1,81,68",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "检查狩猎战界面"
-  },
-  {
-    "itemName": "check_hunt_kirin",
-    "imageName": "page_check_hunt_kirin.png",
-    "roiFront": "353,240,30,54",
-    "roiBack": "328,234,81,68",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "检查狩猎战麒麟界面"
-  },
-  {
-    "itemName": "check_hyakkisen",
-    "imageName": "page_check_hyakkisen.png",
-    "roiFront": "1014,607,53,55",
-    "roiBack": "986,587,100,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_draft_duel",
-    "imageName": "page_check_draft_duel.png",
-    "roiFront": "1051,612,56,58",
-    "roiBack": "1029,594,100,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "back_yollow",
-    "imageName": "page_back_yollow.png",
-    "roiFront": "24,16,48,55",
-    "roiBack": "0,0,100,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "demon_encounter_goto_town",
-    "imageName": "page_demon_encounter_goto_town.png",
-    "roiFront": "28,20,56,52",
-    "roiBack": "3,4,100,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "town_goto_hyakkiyakou",
-    "imageName": "page_town_goto_hyakkiyakou.png",
-    "roiFront": "880,165,53,69",
-    "roiBack": "827,149,148,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_kyakkiyakou",
-    "imageName": "page_check_kyakkiyakou.png",
-    "roiFront": "305,567,56,64",
-    "roiBack": "280,545,100,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "hyakkiyakou_close",
-    "imageName": "page_hyakkiyakou_close.png",
-    "roiFront": "1063,181,47,43",
-    "roiBack": "1063,181,47,43",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  }
-]

+ 0 - 218
tasks/GameUi/page/page_img_3.json

@@ -1,218 +0,0 @@
-[
-  {
-    "itemName": "main_goto_shikigami_records",
-    "imageName": "page_main_goto_shikigami_records.png",
-    "roiFront": "1080,590,56,64",
-    "roiBack": "1080,590,120,100",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "式神录"
-  },
-  {
-    "itemName": "main_goto_onmyodo",
-    "imageName": "page_main_goto_onmyodo.png",
-    "roiFront": "960,590,39,36",
-    "roiBack": "960,590,120,100",
-    "method": "Template matching",
-    "threshold": 0.5,
-    "description": "description"
-  },
-  {
-    "itemName": "main_goto_friends",
-    "imageName": "page_main_goto_friends.png",
-    "roiFront": "845,590,55,55",
-    "roiBack": "845,590,120,100",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "description"
-  },
-  {
-    "itemName": "main_goto_daily",
-    "imageName": "page_main_goto_daily.png",
-    "roiFront": "779,612,51,67",
-    "roiBack": "754,595,89,97",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "进入花合战"
-  },
-  {
-    "itemName": "main_goto_mall",
-    "imageName": "page_main_goto_mall.png",
-    "roiFront": "663,661,41,22",
-    "roiBack": "644,613,81,78",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "description"
-  },
-  {
-    "itemName": "main_goto_guild",
-    "imageName": "page_main_goto_guild.png",
-    "roiFront": "495,590,50,22",
-    "roiBack": "495,590,120,100",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "description"
-  },
-  {
-    "itemName": "main_goto_team",
-    "imageName": "page_main_goto_team.png",
-    "roiFront": "395,590,38,48",
-    "roiBack": "395,590,120,100",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "description"
-  },
-  {
-    "itemName": "main_goto_collection",
-    "imageName": "page_main_goto_collection.png",
-    "roiFront": "70,590,36,41",
-    "roiBack": "70,590,120,100",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "description"
-  },
-  {
-    "itemName": "check_records",
-    "imageName": "page_check_records.png",
-    "roiFront": "269,71,55,50",
-    "roiBack": "269,71,55,50",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_onmyodo",
-    "imageName": "page_check_onmyodo.png",
-    "roiFront": "1166,117,84,547",
-    "roiBack": "1166,117,84,547",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_friends",
-    "imageName": "page_check_friends.png",
-    "roiFront": "27,251,29,47",
-    "roiBack": "5,216,86,106",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "description"
-  },
-  {
-    "itemName": "check_daily",
-    "imageName": "page_check_daily.png",
-    "roiFront": "28,515,58,62",
-    "roiBack": "1,487,154,145",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_mall",
-    "imageName": "page_check_mall.png",
-    "roiFront": "147,527,82,82",
-    "roiBack": "147,527,82,82",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_guild",
-    "imageName": "page_check_guild.png",
-    "roiFront": "1072,630,49,46",
-    "roiBack": "1072,630,49,46",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_team",
-    "imageName": "page_check_team.png",
-    "roiFront": "32,585,82,90",
-    "roiBack": "32,585,82,90",
-    "method": "Template matching",
-    "threshold": 0.63,
-    "description": "description"
-  },
-  {
-    "itemName": "check_collection",
-    "imageName": "page_check_collection.png",
-    "roiFront": "579,639,63,65",
-    "roiBack": "118,626,1162,94",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "back_y",
-    "imageName": "page_back_y.png",
-    "roiFront": "15,4,57,52",
-    "roiBack": "1,2,100,91",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "back_mall",
-    "imageName": "page_back_mall.png",
-    "roiFront": "28,33,50,51",
-    "roiBack": "28,33,50,51",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "back_friends",
-    "imageName": "page_back_friends.png",
-    "roiFront": "1152,87,53,52",
-    "roiBack": "1152,87,53,52",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "back_daily",
-    "imageName": "page_back_daily.png",
-    "roiFront": "33,13,39,50",
-    "roiBack": "33,13,39,50",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "back_act_list",
-    "imageName": "page_back_act_list.png",
-    "roiFront": "1165,65,51,47",
-    "roiBack": "1124,23,131,133",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "活动列表页返回庭院"
-  },
-  {
-    "itemName": "dlc_close",
-    "imageName": "store_dlc_close.png",
-    "roiFront": "916,147,24,25",
-    "roiBack": "916,147,24,25",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "下载拓展包弹窗"
-  },
-  {
-    "itemName": "back_battle",
-    "imageName": "page_back_battle.png",
-    "roiFront": "24,19,40,38",
-    "roiBack": "0,0,90,85",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "退出战斗按钮"
-  },
-  {
-    "itemName": "demon_encounter_realworld",
-    "imageName": "page_demon_encounter_realworld.png",
-    "roiFront": "994,485,106,30",
-    "roiBack": "994,485,106,30",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "进入现世逢魔"
-  }
-]

+ 0 - 11
tasks/GameUi/page/page_img_login.json

@@ -1,11 +0,0 @@
-[
-  {
-    "itemName": "check_login_form",
-    "imageName": "page_check_login_form.png",
-    "roiFront": "178,572,53,60",
-    "roiBack": "1,500,400,150",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  }
-]

+ 0 - 92
tasks/GameUi/page/page_img_supplement.json

@@ -1,92 +0,0 @@
-[
-  {
-    "itemName": "main_goto_summon",
-    "imageName": "page_main_goto_summon.png",
-    "roiFront": "1073,174,57,65",
-    "roiBack": "571,153,586,124",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "summon_goto_main",
-    "imageName": "page_summon_goto_main.png",
-    "roiFront": "27,5,49,51",
-    "roiBack": "0,0,100,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_summon",
-    "imageName": "page_check_summon.png",
-    "roiFront": "750,580,30,28",
-    "roiBack": "750,580,350,120",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "realm_raid_goto_exploration",
-    "imageName": "page_realm_raid_goto_exploration.png",
-    "roiFront": "1192,107,36,43",
-    "roiBack": "1192,107,36,43",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "就是一个红叉"
-  },
-  {
-    "itemName": "main_goto_travel",
-    "imageName": "page_main_goto_travel.png",
-    "roiFront": "170,590,64,61",
-    "roiBack": "170,590,120,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "check_travel",
-    "imageName": "page_check_travel.png",
-    "roiFront": "1134,583,78,77",
-    "roiBack": "1134,583,78,77",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "珍旅居"
-  },
-  {
-    "itemName": "act_list_goto_act",
-    "imageName": "page_act_list_goto_act.png",
-    "roiFront": "971,506,156,60",
-    "roiBack": "925,458,272,166",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "活动列表页前往活动"
-  },
-  {
-    "itemName": "check_act_list",
-    "imageName": "page_check_act_list.png",
-    "roiFront": "60,617,79,66",
-    "roiBack": "19,555,163,164",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "活动列表页标志"
-  },
-  {
-    "itemName": "check_hero_test",
-    "imageName": "page_check_hero_test.png",
-    "roiFront": "148,10,133,48",
-    "roiBack": "137,0,157,71",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "英杰试炼左上角标志"
-  },
-  {
-    "itemName": "exploration_goto_hero_test",
-    "imageName": "page_exploration_goto_hero_test.png",
-    "roiFront": "838,635,38,43",
-    "roiBack": "7,605,1272,113",
-    "method": "Template matching",
-    "threshold": 0.65,
-    "description": "探索前往英杰试炼"
-  }
-]

Некоторые файлы не были показаны из-за большого количества измененных файлов