Przeglądaj źródła

feat(gameui): add all page

runhey 3 lat temu
rodzic
commit
7a289583ab
92 zmienionych plików z 1083 dodań i 26 usunięć
  1. BIN
      module/config/i18n/zh_CN.qm
  2. 8 5
      module/config/i18n/zh_CN.ts
  3. 14 9
      module/ocr/models.py
  4. 2 5
      module/ocr/sub_ocr.py
  5. 2 2
      script.py
  6. 16 0
      tasks/Component/GeneralInvite/assets.py
  7. 1 0
      tasks/Component/GeneralInvite/config_invite.py
  8. 60 0
      tasks/Component/GeneralInvite/general_invite.py
  9. BIN
      tasks/Component/GeneralInvite/gi/gi_buff.png
  10. BIN
      tasks/Component/GeneralInvite/gi/gi_cancel.png
  11. BIN
      tasks/Component/GeneralInvite/gi/gi_i_default.png
  12. BIN
      tasks/Component/GeneralInvite/gi/gi_i_no_default.png
  13. BIN
      tasks/Component/GeneralInvite/gi/gi_sure.png
  14. 45 0
      tasks/Component/GeneralInvite/gi/image.json
  15. 143 1
      tasks/GameUi/assets.py
  16. 153 0
      tasks/GameUi/page.py
  17. 6 0
      tasks/GameUi/page/README.md
  18. BIN
      tasks/GameUi/page/image_name.png
  19. BIN
      tasks/GameUi/page/page_back_blue.png
  20. BIN
      tasks/GameUi/page/page_back_daily.png
  21. BIN
      tasks/GameUi/page/page_back_friends.png
  22. BIN
      tasks/GameUi/page/page_back_mall.png
  23. BIN
      tasks/GameUi/page/page_back_y.png
  24. BIN
      tasks/GameUi/page/page_back_yollow.png
  25. BIN
      tasks/GameUi/page/page_bondling_goto_exploration.png
  26. BIN
      tasks/GameUi/page/page_check_area_boss.png
  27. BIN
      tasks/GameUi/page/page_check_awake.png
  28. BIN
      tasks/GameUi/page/page_check_awake_zones.png
  29. BIN
      tasks/GameUi/page/page_check_bondling_fairyland.png
  30. BIN
      tasks/GameUi/page/page_check_collection.png
  31. BIN
      tasks/GameUi/page/page_check_daily.png
  32. BIN
      tasks/GameUi/page/page_check_delegation.png
  33. BIN
      tasks/GameUi/page/page_check_demon_encounter.png
  34. BIN
      tasks/GameUi/page/page_check_draft_duel.png
  35. BIN
      tasks/GameUi/page/page_check_duel.png
  36. BIN
      tasks/GameUi/page/page_check_exploration.png
  37. BIN
      tasks/GameUi/page/page_check_friends.png
  38. BIN
      tasks/GameUi/page/page_check_goryou.png
  39. BIN
      tasks/GameUi/page/page_check_guild.png
  40. BIN
      tasks/GameUi/page/page_check_heian_kitan.png
  41. BIN
      tasks/GameUi/page/page_check_hunt.png
  42. BIN
      tasks/GameUi/page/page_check_hyakkisen.png
  43. BIN
      tasks/GameUi/page/page_check_main.png
  44. BIN
      tasks/GameUi/page/page_check_mall.png
  45. BIN
      tasks/GameUi/page/page_check_onmyodo.png
  46. BIN
      tasks/GameUi/page/page_check_realm_raid.png
  47. BIN
      tasks/GameUi/page/page_check_records.png
  48. BIN
      tasks/GameUi/page/page_check_secret_zones.png
  49. BIN
      tasks/GameUi/page/page_check_six_gates.png
  50. BIN
      tasks/GameUi/page/page_check_soul_zones.png
  51. BIN
      tasks/GameUi/page/page_check_summon.png
  52. BIN
      tasks/GameUi/page/page_check_team.png
  53. BIN
      tasks/GameUi/page/page_check_town.png
  54. BIN
      tasks/GameUi/page/page_exploration_goto_area_boss.png
  55. BIN
      tasks/GameUi/page/page_exploration_goto_awake_zone.png
  56. BIN
      tasks/GameUi/page/page_exploration_goto_bondling_fairyland.png
  57. BIN
      tasks/GameUi/page/page_exploration_goto_delegation.png
  58. BIN
      tasks/GameUi/page/page_exploration_goto_goryou_realm.png
  59. BIN
      tasks/GameUi/page/page_exploration_goto_heian_kitan.png
  60. BIN
      tasks/GameUi/page/page_exploration_goto_main.png
  61. BIN
      tasks/GameUi/page/page_exploration_goto_realm_raid.png
  62. BIN
      tasks/GameUi/page/page_exploration_goto_secret_zones.png
  63. BIN
      tasks/GameUi/page/page_exploration_goto_six_gates.png
  64. BIN
      tasks/GameUi/page/page_exploration_goto_soul_zone.png
  65. 236 0
      tasks/GameUi/page/page_img.json
  66. 128 0
      tasks/GameUi/page/page_img_2.json
  67. 191 0
      tasks/GameUi/page/page_img_3.json
  68. 38 0
      tasks/GameUi/page/page_img_supplement.json
  69. BIN
      tasks/GameUi/page/page_main_goto_collection.png
  70. BIN
      tasks/GameUi/page/page_main_goto_daily.png
  71. BIN
      tasks/GameUi/page/page_main_goto_exploration.png
  72. BIN
      tasks/GameUi/page/page_main_goto_friends.png
  73. BIN
      tasks/GameUi/page/page_main_goto_guild.png
  74. BIN
      tasks/GameUi/page/page_main_goto_mall.png
  75. BIN
      tasks/GameUi/page/page_main_goto_onmyodo.png
  76. BIN
      tasks/GameUi/page/page_main_goto_shikigami_records.png
  77. BIN
      tasks/GameUi/page/page_main_goto_summon.png
  78. BIN
      tasks/GameUi/page/page_main_goto_team.png
  79. BIN
      tasks/GameUi/page/page_main_goto_town.png
  80. BIN
      tasks/GameUi/page/page_realm_raid_goto_exploration.png
  81. BIN
      tasks/GameUi/page/page_six_gates_goto_exploration.png
  82. BIN
      tasks/GameUi/page/page_summon_goto_main.png
  83. BIN
      tasks/GameUi/page/page_town_goto_demon_encounter.png
  84. BIN
      tasks/GameUi/page/page_town_goto_draft_duel.png
  85. BIN
      tasks/GameUi/page/page_town_goto_duel.png
  86. BIN
      tasks/GameUi/page/page_town_goto_hunt.png
  87. BIN
      tasks/GameUi/page/page_town_goto_hyakkisen.png
  88. BIN
      tasks/GameUi/page/page_town_goto_main.png
  89. 4 0
      tasks/GameUi/res/README.md
  90. 1 1
      tasks/GameUi/res/image.json
  91. 3 1
      tasks/Orochi/config.py
  92. 32 2
      tasks/Orochi/script_task.py

BIN
module/config/i18n/zh_CN.qm


+ 8 - 5
module/config/i18n/zh_CN.ts

@@ -379,8 +379,8 @@
 	<message><source>ShikigamiConfig</source><translation>活动</translation></message>
 	<message><source>Limit Time</source><translation>限制运行时间</translation></message>
 	<message><source>Limit Count</source><translation>限制挑战次数</translation></message>
-	<message><source>limit_time_help</source><translation>时间格式:"[days] [hours]:[minutes]:[seconds]"
-注意天数和小时之间有一个空格,不按照格式输入会无法正确设置</translation></message>
+	<message><source>limit_time_help</source><translation>时间格式:"[hours]:[minutes]:[seconds]"
+注意没有空格,使用英文的冒号 : 不按照格式输入会无法正确设置</translation></message>
 	<message><source>limit_count_help</source><translation>两个限制需要同时设置,最先达到就会退出。
 建议执行时间设置成一个小时足够长,此时基于次数来判定设置为100次</translation></message>
 	<message><source>GeneralClimb</source><translation>通用爬塔</translation></message>
@@ -399,13 +399,16 @@
 	<message><source>InviteNumber</source><translation>邀请人数</translation></message>
 	<message><source>Friend 1</source><translation>第一个队友名字</translation></message>
 	<message><source>Friend 2</source><translation>第二个队友名字</translation></message>
-	<message><source>Auto Find</source><translation>自动切换好友列表选中队友</translation></message>
+	<message><source>FindMode</source><translation>寻找队友模式</translation></message>
 	<message><source>Wait Time</source><translation>等待时间</translation></message>
 	<message><source>invite_number_help</source><translation>可选1或者2,为1时只会邀请第一个队友</translation></message>
 	<message><source>friend_name_help</source><translation>输入队友的名字必须是全称,这一项是基于OCR来识别,如果名字过于离谱建议画200勾玉改一个正常点的名字</translation></message>
 	<message><source>friend_2_name_help</source><translation>同上</translation></message>
-	<message><source>auto_find_help</source><translation>首先会在第一个好友列表寻找,如果没有找到则跳转到"最近" -> "寮友" -> "跨区"</translation></message>
-	<message><source>wait_time_help</source><translation>保持默认一分钟就好,期间每隔15s邀请一次</translation></message>
+	<message><source>find_mode_help</source><translation>默认会从上方列表自动寻找
+顺序是'好友' -> '最近' -> '聊友' -> '跨区',当然建议选择‘recent_friend’这样会快点</translation></message>
+	<message><source>wait_time_help</source><translation>保持默认一分钟就好,期间每隔20s邀请一次</translation></message>
+	<message><source>Default Invite</source><translation>战斗结束后勾选默认邀请</translation></message>
+	<message><source>default_invite_help</source><translation> </translation></message>
 </context>
 <context>
     <name>Args</name>

+ 14 - 9
module/ocr/models.py

@@ -16,12 +16,17 @@ if __name__ == "__main__":
     model = OCR_MODEL.ch
     import cv2
     import time
-    image = cv2.imread(r"D:\ocr_test_5.png")
-
-    for i in range(10):
-        start_time = time.time()
-        result = model.detect_and_ocr(image)
-        print(result)
-        end_time = time.time()
-        print(f'耗时:{end_time-start_time}')
-
+    from memory_profiler import profile
+    image = cv2.imread(r"E:\Project\OnmyojiAutoScript-assets\jade.png")
+
+    # 引入ocr 会导致非常巨大的内存开销
+    @profile
+    def test_memory():
+        for i in range(10):
+            start_time = time.time()
+            result = model.detect_and_ocr(image)
+            print(result)
+            end_time = time.time()
+            print(f'耗时:{end_time-start_time}')
+
+    test_memory()

+ 2 - 5
module/ocr/sub_ocr.py

@@ -188,9 +188,6 @@ class Duration(Single):
 
 
 if __name__ == '__main__':
-    d = DigitCounter.ocr_str_digit_counter('14/77')
-    print(d)
-
-    u = Duration.parse_time('01:30:00')
-    print(u)
+    import cv2
+    image = cv2.imread(r'E:\Project\OnmyojiAutoScript-assets\jade.png')
 

+ 2 - 2
script.py

@@ -444,5 +444,5 @@ class Script:
 if __name__ == "__main__":
     script = Script("oas1")
     # print(script.get_next_task())
-    script.run("ActivityShikigami")
-    # script.run('RealmRaid')
+    # script.run("ActivityShikigami")
+    script.run('AreaBoss')

+ 16 - 0
tasks/Component/GeneralInvite/assets.py

@@ -67,6 +67,22 @@ class GeneralInviteAssets:
 	I_FLAG_4_OFF = RuleImage(roi_front=(703,128,53,21), roi_back=(703,128,53,21), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_flag_4_off.png")
 	# 永生之海添加好友 
 	I_ADD_SEA = RuleImage(roi_front=(836,231,100,100), roi_back=(836,231,100,100), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_add_sea.png")
+	# 队员不接受邀请 
+	I_I_REJECT = RuleImage(roi_front=(12,226,64,61), roi_back=(12,226,64,275), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_i_reject.png")
+	# 队员接受邀请 
+	I_I_ACCEPT = RuleImage(roi_front=(113,225,63,72), roi_back=(113,225,63,280), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_i_accept.png")
+	# 队员默认接受邀请 
+	I_I_ACCEPT_DEFAULT = RuleImage(roi_front=(205,223,61,68), roi_back=(205,223,61,297), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_i_accept_default.png")
+	# 不勾选 默认邀请 
+	I_I_NO_DEFAULT = RuleImage(roi_front=(542,343,36,35), roi_back=(542,343,36,35), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_i_no_default.png")
+	# 勾选 默认邀请 
+	I_I_DEFAULT = RuleImage(roi_front=(541,342,41,39), roi_back=(541,342,41,39), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_i_default.png")
+	# description 
+	I_CANCEL = RuleImage(roi_front=(435,404,171,65), roi_back=(435,404,171,65), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_cancel.png")
+	# 队长邀请 确定 
+	I_SURE = RuleImage(roi_front=(668,401,175,60), roi_back=(668,401,175,60), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_sure.png")
+	# 所有的组队界面都有加成 
+	I_BUFF = RuleImage(roi_front=(794,38,46,42), roi_back=(794,38,46,42), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_buff.png")
 
 
 	# Ocr Rule Assets

+ 1 - 0
tasks/Component/GeneralInvite/config_invite.py

@@ -20,6 +20,7 @@ class InviteConfig(BaseModel):
     friend_2: str = Field(default='', description='friend_2_name_help')
     find_mode: FindMode = Field(default=FindMode.AUTO_FIND, description='find_mode_help')
     wait_time: time = Field(default=time(minute=1), description='wait_time_help')
+    default_invite: bool = Field(default=True, description='default_invite_help')
 
     # recent_friend, guild_friend, friend, other_friend
 

+ 60 - 0
tasks/Component/GeneralInvite/general_invite.py

@@ -37,6 +37,13 @@ class GeneralInvite(BaseTask, GeneralInviteAssets):
     timer_invite = None
     timer_wait = None
 
+    """
+    这个类就三个api
+    1. run_invite
+    2. invite_again
+    3. accept_invite
+    """
+
     def run_invite(self, config: InviteConfig, is_first: bool = False) -> bool:
         """
         队长!!身份。。。在组件界面邀请好友( 如果开启is_first) 等待队员进入开启挑战
@@ -431,6 +438,59 @@ class GeneralInvite(BaseTask, GeneralInviteAssets):
                 logger.warning('Invite friend 2 failed')
         time.sleep(0.5)
 
+    def invite_again(self, default_invite: bool=True) -> bool:
+        """
+        作为队长战斗胜利后再次邀请队友,
+        :param default_invite:  是否勾选默认
+        :return:
+        """
+        logger.info('Invite again')
+        # 判断是否进入界面
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_SURE):
+                break
+        # 如果勾选了默认邀请
+        if default_invite:
+            logger.info('Click default invite')
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_I_DEFAULT):
+                    break
+                if self.appear_then_click(self.I_I_NO_DEFAULT, interval=1):
+                    continue
+        else:
+            logger.info('Click no default invite')
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_I_NO_DEFAULT):
+                    break
+                if self.appear_then_click(self.I_I_DEFAULT, interval=1):
+                    continue
+
+        # 点击确认
+        logger.info('Click invite ensure')
+        while 1:
+            self.screenshot()
+            if not self.appear(self.I_SURE):
+                break
+            if self.appear_then_click(self.I_SURE):
+                continue
+
+    def accept_invite(self) -> bool:
+        """
+        队员接受邀请, 保持在庭院界面
+        :return:
+        """
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_BUFF):
+                break
+            if self.appear_then_click(self.I_I_ACCEPT_DEFAULT, interval=1):
+                continue
+            if self.appear_then_click(self.I_I_ACCEPT, interval=1):
+                continue
+
 if __name__ == '__main__':
     from module.config.config import Config
     from module.device.device import Device

BIN
tasks/Component/GeneralInvite/gi/gi_buff.png


BIN
tasks/Component/GeneralInvite/gi/gi_cancel.png


BIN
tasks/Component/GeneralInvite/gi/gi_i_default.png


BIN
tasks/Component/GeneralInvite/gi/gi_i_no_default.png


BIN
tasks/Component/GeneralInvite/gi/gi_sure.png


+ 45 - 0
tasks/Component/GeneralInvite/gi/image.json

@@ -277,5 +277,50 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "队员默认接受邀请"
+  },
+  {
+    "itemName": "i_no_default",
+    "imageName": "gi_i_no_default.png",
+    "roiFront": "542,343,36,35",
+    "roiBack": "542,343,36,35",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "不勾选 默认邀请"
+  },
+  {
+    "itemName": "i_default",
+    "imageName": "gi_i_default.png",
+    "roiFront": "541,342,41,39",
+    "roiBack": "541,342,41,39",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "勾选 默认邀请"
+  },
+  {
+    "itemName": "cancel",
+    "imageName": "gi_cancel.png",
+    "roiFront": "435,404,171,65",
+    "roiBack": "435,404,171,65",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "sure",
+    "imageName": "gi_sure.png",
+    "roiFront": "668,401,175,60",
+    "roiBack": "668,401,175,60",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "队长邀请 确定"
+  },
+  {
+    "itemName": "buff",
+    "imageName": "gi_buff.png",
+    "roiFront": "794,38,46,42",
+    "roiBack": "794,38,46,42",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "所有的组队界面都有加成"
   }
 ]

+ 143 - 1
tasks/GameUi/assets.py

@@ -10,9 +10,151 @@ from module.atom.list import RuleList
 class GameUiAssets: 
 
 
+	# Image Rule Assets
+	# description 
+	I_CHECK_MAIN = RuleImage(roi_front=(355,47,48,43), roi_back=(355,47,48,43), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_main.png")
+	# description 
+	I_MAIN_GOTO_EXPLORATION = RuleImage(roi_front=(475,104,45,66), roi_back=(475,104,45,66), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_exploration.png")
+	# description 
+	I_CHECK_EXPLORATION = RuleImage(roi_front=(1130,120,61,55), roi_back=(1130,120,61,55), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_exploration.png")
+	# description 
+	I_EXPLORATION_GOTO_AWAKE_ZONE = RuleImage(roi_front=(50,637,57,61), roi_back=(50,637,57,61), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_awake_zone.png")
+	# description 
+	I_EXPLORATION_GOTO_SOUL_ZONE = RuleImage(roi_front=(151,637,55,55), roi_back=(151,637,55,55), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_soul_zone.png")
+	# description 
+	I_EXPLORATION_GOTO_REALM_RAID = RuleImage(roi_front=(245,638,67,48), roi_back=(245,638,67,48), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_realm_raid.png")
+	# 前往御灵 
+	I_EXPLORATION_GOTO_GORYOU_REALM = RuleImage(roi_front=(343,629,60,67), roi_back=(343,629,60,67), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_goryou_realm.png")
+	# 式神委派 
+	I_EXPLORATION_GOTO_DELEGATION = RuleImage(roi_front=(445,638,60,50), roi_back=(445,638,60,50), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_delegation.png")
+	# 秘闻 
+	I_EXPLORATION_GOTO_SECRET_ZONES = RuleImage(roi_front=(542,645,61,55), roi_back=(542,645,61,55), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_secret_zones.png")
+	# 地狱鬼王 
+	I_EXPLORATION_GOTO_AREA_BOSS = RuleImage(roi_front=(640,638,51,45), roi_back=(640,638,51,45), 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=(739,643,52,44), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_heian_kitan.png")
+	# 六道之门 
+	I_EXPLORATION_GOTO_SIX_GATES = RuleImage(roi_front=(834,641,60,49), roi_back=(834,641,60,49), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_six_gates.png")
+	# 器灵 
+	I_EXPLORATION_GOTO_BONDLING_FAIRYLAND = RuleImage(roi_front=(937,639,61,54), roi_back=(937,639,61,54), threshold=0.8, 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=(376,565,73,82), roi_back=(376,565,73,82), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_awake.png")
+	# description 
+	I_CHECK_SOUL_ZONES = RuleImage(roi_front=(49,105,298,405), roi_back=(49,105,298,405), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_soul_zones.png")
+	# description 
+	I_CHECK_REALM_RAID = RuleImage(roi_front=(123,632,57,55), roi_back=(123,632,57,55), threshold=0.8, 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_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=(41,637,65,62), roi_back=(41,637,65,62), 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")
+	# description 
+	I_CHECK_SIX_GATES = RuleImage(roi_front=(1174,621,55,44), roi_back=(1174,621,55,44), threshold=0.8, 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")
+
+
+	# Image Rule Assets
+	# description 
+	I_MAIN_GOTO_TOWN = RuleImage(roi_front=(706,249,61,57), roi_back=(200,120,951,298), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_town.png")
+	# description 
+	I_CHECK_TOWN = RuleImage(roi_front=(1034,94,100,100), roi_back=(1034,94,100,100), 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")
+	# 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 
+	I_TOWN_GOTO_DEMON_ENCOUNTER = RuleImage(roi_front=(617,135,51,75), roi_back=(232,121,873,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_town_goto_demon_encounter.png")
+	# description 
+	I_TOWN_GOTO_HUNT = RuleImage(roi_front=(475,138,46,69), roi_back=(275,122,520,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_town_goto_hunt.png")
+	# 协同对弈 
+	I_TOWN_GOTO_DRAFT_DUEL = RuleImage(roi_front=(335,159,55,72), roi_back=(170,145,567,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_town_goto_draft_duel.png")
+	# 百鬼奕 
+	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")
+	# description 
+	I_CHECK_DUEL = RuleImage(roi_front=(1045,610,50,53), roi_back=(1018,579,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_duel.png")
+	# description 
+	I_CHECK_DEMON_ENCOUNTER = RuleImage(roi_front=(0,0,100,100), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_demon_encounter.png")
+	# description 
+	I_CHECK_HUNT = RuleImage(roi_front=(0,0,100,100), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_hunt.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")
+
+
+	# Image Rule Assets
+	# 式神录 
+	I_MAIN_GOTO_SHIKIGAMI_RECORDS = RuleImage(roi_front=(1097,612,56,64), roi_back=(1097,612,56,64), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_shikigami_records.png")
+	# description 
+	I_MAIN_GOTO_ONMYODO = RuleImage(roi_front=(992,614,51,60), roi_back=(992,614,51,60), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_onmyodo.png")
+	# description 
+	I_MAIN_GOTO_FRIENDS = RuleImage(roi_front=(878,623,55,55), roi_back=(878,623,55,55), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_friends.png")
+	# description 
+	I_MAIN_GOTO_DAILY = RuleImage(roi_front=(769,623,52,54), roi_back=(769,623,52,54), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_daily.png")
+	# description 
+	I_MAIN_GOTO_MALL = RuleImage(roi_front=(657,624,47,52), roi_back=(657,624,47,52), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_mall.png")
+	# description 
+	I_MAIN_GOTO_GUILD = RuleImage(roi_front=(540,611,50,54), roi_back=(540,611,50,54), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_guild.png")
+	# description 
+	I_MAIN_GOTO_TEAM = RuleImage(roi_front=(429,622,53,51), roi_back=(429,622,53,51), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_team.png")
+	# description 
+	I_MAIN_GOTO_COLLECTION = RuleImage(roi_front=(92,611,51,64), roi_back=(92,611,51,64), threshold=0.8, 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=(1011,592,133,60), roi_back=(1011,592,133,60), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_friends.png")
+	# description 
+	I_CHECK_DAILY = RuleImage(roi_front=(28,510,69,87), roi_back=(28,510,69,87), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_daily.png")
+	# description 
+	I_CHECK_MALL = RuleImage(roi_front=(7,503,100,100), roi_back=(7,503,100,100), 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=(1209,108,41,119), roi_back=(1209,108,41,119), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_team.png")
+	# description 
+	I_CHECK_COLLECTION = RuleImage(roi_front=(471,618,100,100), roi_back=(471,618,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_collection.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")
+	# description 
+	I_NEW = RuleImage(roi_front=(0,0,100,100), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/image_name.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 
+	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=(581,594,68,66), roi_back=(316,528,594,174), 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")
+
+
 	# Image Rule Assets
 	# 左上角蓝色的返回 
-	I_BACK_BLUE = 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_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")
 	# 阴阳术 

+ 153 - 0
tasks/GameUi/page.py

@@ -0,0 +1,153 @@
+import traceback
+
+from tasks.GameUi.assets import GameUiAssets as G
+
+
+class Page:
+    parent = None
+
+    def __init__(self, check_button):
+        self.check_button = check_button
+        self.links = {}
+        (filename, line_number, function_name, text) = traceback.extract_stack()[-2]
+        self.name = text[:text.find('=')].strip()
+
+    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
+
+
+# Main Home 主页
+page_main = Page(G.I_CHECK_MAIN)
+# 召唤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_BLUE, 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)
+
+# Unknown
+page_unknown = Page(None)
+page_unknown.link(button=G.I_CHECK_MAIN, destination=page_main)
+
+# ************************************* 探索部分 *****************************************#
+# 觉醒 awake zones
+page_awake_zones = Page(G.I_CHECK_AWAKE)
+page_awake_zones.link(button=G.I_BACK_BLUE, 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_BLUE, 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)
+# 御灵 goryou realm
+page_goryou_realm = Page(G.I_CHECK_GORYOU)
+page_goryou_realm.link(button=G.I_BACK_BLUE, 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_BLUE, 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_BLUE, 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_BLUE, destination=page_exploration)
+page_exploration.link(button=G.I_EXPLORATION_GOTO_AREA_BOSS, destination=page_area_boss)
+# 平安奇谭
+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(G.I_CHECK_BONDLING_FAIRYLAND)
+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)
+
+
+# ************************************* 町中部分 *****************************************#
+# 斗鸡 duel
+page_duel = Page(G.I_CHECK_DUEL)
+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)
+# 狩猎战 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)
+# 协同斗技 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)
+
+
+# ************************************* 庭院部分 *****************************************#
+# 式神录 shikigami_records
+page_shikigami_records = Page(G.I_CHECK_RECORDS)
+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.link(button=G.I_BACK_Y, destination=page_main)
+page_main.link(button=G.I_MAIN_GOTO_DAILY, destination=page_daily)
+# 商店 mall
+page_mall = Page(G.I_CHECK_MALL)
+page_mall.link(button=G.I_BACK_Y, 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.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.link(button=G.I_BACK_Y, destination=page_main)
+page_main.link(button=G.I_MAIN_GOTO_COLLECTION, destination=page_collection)
+
+
+
+
+
+
+
+

+ 6 - 0
tasks/GameUi/page/README.md

@@ -0,0 +1,6 @@
+page_img.json 表示探索部分的
+
+page_img_2.json 表示 town部分的町中部分
+
+page_img_3.json 表示庭院部分的
+

BIN
tasks/GameUi/page/image_name.png


BIN
tasks/GameUi/page/page_back_blue.png


BIN
tasks/GameUi/page/page_back_daily.png


BIN
tasks/GameUi/page/page_back_friends.png


BIN
tasks/GameUi/page/page_back_mall.png


BIN
tasks/GameUi/page/page_back_y.png


BIN
tasks/GameUi/page/page_back_yollow.png


BIN
tasks/GameUi/page/page_bondling_goto_exploration.png


BIN
tasks/GameUi/page/page_check_area_boss.png


BIN
tasks/GameUi/page/page_check_awake.png


BIN
tasks/GameUi/page/page_check_awake_zones.png


BIN
tasks/GameUi/page/page_check_bondling_fairyland.png


BIN
tasks/GameUi/page/page_check_collection.png


BIN
tasks/GameUi/page/page_check_daily.png


BIN
tasks/GameUi/page/page_check_delegation.png


BIN
tasks/GameUi/page/page_check_demon_encounter.png


BIN
tasks/GameUi/page/page_check_draft_duel.png


BIN
tasks/GameUi/page/page_check_duel.png


BIN
tasks/GameUi/page/page_check_exploration.png


BIN
tasks/GameUi/page/page_check_friends.png


BIN
tasks/GameUi/page/page_check_goryou.png


BIN
tasks/GameUi/page/page_check_guild.png


BIN
tasks/GameUi/page/page_check_heian_kitan.png


BIN
tasks/GameUi/page/page_check_hunt.png


BIN
tasks/GameUi/page/page_check_hyakkisen.png


BIN
tasks/GameUi/page/page_check_main.png


BIN
tasks/GameUi/page/page_check_mall.png


BIN
tasks/GameUi/page/page_check_onmyodo.png


BIN
tasks/GameUi/page/page_check_realm_raid.png


BIN
tasks/GameUi/page/page_check_records.png


BIN
tasks/GameUi/page/page_check_secret_zones.png


BIN
tasks/GameUi/page/page_check_six_gates.png


BIN
tasks/GameUi/page/page_check_soul_zones.png


BIN
tasks/GameUi/page/page_check_summon.png


BIN
tasks/GameUi/page/page_check_team.png


BIN
tasks/GameUi/page/page_check_town.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_heian_kitan.png


BIN
tasks/GameUi/page/page_exploration_goto_main.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


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

@@ -0,0 +1,236 @@
+[
+  {
+    "itemName": "check_main",
+    "imageName": "page_check_main.png",
+    "roiFront": "355,47,48,43",
+    "roiBack": "355,47,48,43",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_exploration",
+    "imageName": "page_main_goto_exploration.png",
+    "roiFront": "475,104,45,66",
+    "roiBack": "475,104,45,66",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "check_exploration",
+    "imageName": "page_check_exploration.png",
+    "roiFront": "1130,120,61,55",
+    "roiBack": "1130,120,61,55",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "exploration_goto_awake_zone",
+    "imageName": "page_exploration_goto_awake_zone.png",
+    "roiFront": "50,637,57,61",
+    "roiBack": "50,637,57,61",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "exploration_goto_soul_zone",
+    "imageName": "page_exploration_goto_soul_zone.png",
+    "roiFront": "151,637,55,55",
+    "roiBack": "151,637,55,55",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "exploration_goto_realm_raid",
+    "imageName": "page_exploration_goto_realm_raid.png",
+    "roiFront": "245,638,67,48",
+    "roiBack": "245,638,67,48",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "exploration_goto_goryou_realm",
+    "imageName": "page_exploration_goto_goryou_realm.png",
+    "roiFront": "343,629,60,67",
+    "roiBack": "343,629,60,67",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "前往御灵"
+  },
+  {
+    "itemName": "exploration_goto_delegation",
+    "imageName": "page_exploration_goto_delegation.png",
+    "roiFront": "445,638,60,50",
+    "roiBack": "445,638,60,50",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "式神委派"
+  },
+  {
+    "itemName": "exploration_goto_secret_zones",
+    "imageName": "page_exploration_goto_secret_zones.png",
+    "roiFront": "542,645,61,55",
+    "roiBack": "542,645,61,55",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "秘闻"
+  },
+  {
+    "itemName": "exploration_goto_area_boss",
+    "imageName": "page_exploration_goto_area_boss.png",
+    "roiFront": "640,638,51,45",
+    "roiBack": "640,638,51,45",
+    "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": "739,643,52,44",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "平安奇谭"
+  },
+  {
+    "itemName": "exploration_goto_six_gates",
+    "imageName": "page_exploration_goto_six_gates.png",
+    "roiFront": "834,641,60,49",
+    "roiBack": "834,641,60,49",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "六道之门"
+  },
+  {
+    "itemName": "exploration_goto_bondling_fairyland",
+    "imageName": "page_exploration_goto_bondling_fairyland.png",
+    "roiFront": "937,639,61,54",
+    "roiBack": "937,639,61,54",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "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": "376,565,73,82",
+    "roiBack": "376,565,73,82",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "check_soul_zones",
+    "imageName": "page_check_soul_zones.png",
+    "roiFront": "49,105,298,405",
+    "roiBack": "49,105,298,405",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "check_realm_raid",
+    "imageName": "page_check_realm_raid.png",
+    "roiFront": "123,632,57,55",
+    "roiBack": "123,632,57,55",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "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": "41,637,65,62",
+    "roiBack": "41,637,65,62",
+    "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": "1174,621,55,44",
+    "roiBack": "1174,621,55,44",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "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"
+  }
+]

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

@@ -0,0 +1,128 @@
+[
+  {
+    "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.8,
+    "description": "description"
+  },
+  {
+    "itemName": "check_town",
+    "imageName": "page_check_town.png",
+    "roiFront": "1034,94,100,100",
+    "roiBack": "1034,94,100,100",
+    "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.8,
+    "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.8,
+    "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": "1045,610,50,53",
+    "roiBack": "1018,579,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "check_demon_encounter",
+    "imageName": "page_check_demon_encounter.png",
+    "roiFront": "0,0,100,100",
+    "roiBack": "0,0,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "check_hunt",
+    "imageName": "page_check_hunt.png",
+    "roiFront": "0,0,100,100",
+    "roiBack": "0,0,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "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"
+  }
+]

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

@@ -0,0 +1,191 @@
+[
+  {
+    "itemName": "main_goto_shikigami_records",
+    "imageName": "page_main_goto_shikigami_records.png",
+    "roiFront": "1097,612,56,64",
+    "roiBack": "1097,612,56,64",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "式神录"
+  },
+  {
+    "itemName": "main_goto_onmyodo",
+    "imageName": "page_main_goto_onmyodo.png",
+    "roiFront": "992,614,51,60",
+    "roiBack": "992,614,51,60",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_friends",
+    "imageName": "page_main_goto_friends.png",
+    "roiFront": "878,623,55,55",
+    "roiBack": "878,623,55,55",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_daily",
+    "imageName": "page_main_goto_daily.png",
+    "roiFront": "769,623,52,54",
+    "roiBack": "769,623,52,54",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_mall",
+    "imageName": "page_main_goto_mall.png",
+    "roiFront": "657,624,47,52",
+    "roiBack": "657,624,47,52",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_guild",
+    "imageName": "page_main_goto_guild.png",
+    "roiFront": "540,611,50,54",
+    "roiBack": "540,611,50,54",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_team",
+    "imageName": "page_main_goto_team.png",
+    "roiFront": "429,622,53,51",
+    "roiBack": "429,622,53,51",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_collection",
+    "imageName": "page_main_goto_collection.png",
+    "roiFront": "92,611,51,64",
+    "roiBack": "92,611,51,64",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "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": "1011,592,133,60",
+    "roiBack": "1011,592,133,60",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "check_daily",
+    "imageName": "page_check_daily.png",
+    "roiFront": "28,510,69,87",
+    "roiBack": "28,510,69,87",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "check_mall",
+    "imageName": "page_check_mall.png",
+    "roiFront": "7,503,100,100",
+    "roiBack": "7,503,100,100",
+    "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": "1209,108,41,119",
+    "roiBack": "1209,108,41,119",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "check_collection",
+    "imageName": "page_check_collection.png",
+    "roiFront": "471,618,100,100",
+    "roiBack": "471,618,100,100",
+    "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": "new",
+    "imageName": "image_name.png",
+    "roiFront": "0,0,100,100",
+    "roiBack": "0,0,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

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

@@ -0,0 +1,38 @@
+[
+  {
+    "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": "581,594,68,66",
+    "roiBack": "316,528,594,174",
+    "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": "就是一个红叉"
+  }
+]

BIN
tasks/GameUi/page/page_main_goto_collection.png


BIN
tasks/GameUi/page/page_main_goto_daily.png


BIN
tasks/GameUi/page/page_main_goto_exploration.png


BIN
tasks/GameUi/page/page_main_goto_friends.png


BIN
tasks/GameUi/page/page_main_goto_guild.png


BIN
tasks/GameUi/page/page_main_goto_mall.png


BIN
tasks/GameUi/page/page_main_goto_onmyodo.png


BIN
tasks/GameUi/page/page_main_goto_shikigami_records.png


BIN
tasks/GameUi/page/page_main_goto_summon.png


BIN
tasks/GameUi/page/page_main_goto_team.png


BIN
tasks/GameUi/page/page_main_goto_town.png


BIN
tasks/GameUi/page/page_realm_raid_goto_exploration.png


BIN
tasks/GameUi/page/page_six_gates_goto_exploration.png


BIN
tasks/GameUi/page/page_summon_goto_main.png


BIN
tasks/GameUi/page/page_town_goto_demon_encounter.png


BIN
tasks/GameUi/page/page_town_goto_draft_duel.png


BIN
tasks/GameUi/page/page_town_goto_duel.png


BIN
tasks/GameUi/page/page_town_goto_hunt.png


BIN
tasks/GameUi/page/page_town_goto_hyakkisen.png


BIN
tasks/GameUi/page/page_town_goto_main.png


+ 4 - 0
tasks/GameUi/res/README.md

@@ -0,0 +1,4 @@
+## 已弃置
+
+
+

+ 1 - 1
tasks/GameUi/res/image.json

@@ -1,6 +1,6 @@
 [
   {
-    "itemName": "back_blue",
+    "itemName": "back_bl",
     "imageName": "res_back_blue.png",
     "roiFront": "32,31,50,53",
     "roiBack": "1,2,139,120",

+ 3 - 1
tasks/Orochi/config.py

@@ -3,6 +3,8 @@
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
 from enum import Enum
+from datetime import datetime, time
+
 from tasks.Component.config_scheduler import Scheduler
 from tasks.Component.config_base import ConfigBase, TimeDelta
 from tasks.Component.GeneralInvite.config_invite import InviteConfig
@@ -35,7 +37,7 @@ class OrochiConfig(ConfigBase):
     # 层数
     layer: Layer = Field(default=Layer.ELEVEN, description='layer_help')
     # 限制时间
-    limit_time: TimeDelta = Field(default=TimeDelta(minutes=30), description='limit_time_help')
+    limit_time: time = Field(default=time(minute=30), description='limit_time_help')
     # 限制次数
     limit_count: int = Field(default=30, description='limit_count_help')
     # 是否开启御魂加成

+ 32 - 2
tasks/Orochi/script_task.py

@@ -5,14 +5,30 @@
 
 from tasks.base_task import BaseTask
 from tasks.Component.GeneralBattle.general_battle import GeneralBattle
+from tasks.Component.GeneralInvite.general_invite import GeneralInvite
+from tasks.Component.GeneralBuff.general_buff import GeneralBuff
+from tasks.Component.GeneralRoom.general_room import GeneralRoom
 from tasks.GameUi.game_ui import GameUi
 from tasks.Orochi.assets import OrochiAssets
+from tasks.Orochi.config import Orochi, UserStatus
 from module.logger import logger
 
-class ScriptTask(GeneralBattle, GameUi, OrochiAssets):
+class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi, OrochiAssets):
 
     def run(self) -> bool:
-        pass
+        config: Orochi = self.config.orochi
+        if config.orochi_config.soul_buff_enable:
+            self.open_buff()
+            self.soul(is_open=True)
+            self.close_buff()
+
+        match config.orochi_config.user_status:
+            case UserStatus.LEADER: self.run_leader()
+            case UserStatus.MEMBER: self.run_member()
+            case UserStatus.ALONE: self.run_alone()
+            case UserStatus.WILD: self.run_wild()
+            case _: logger.error('Unknown user status')
+
 
     def check_layer(self, layer: str) -> bool:
         """
@@ -25,6 +41,20 @@ class ScriptTask(GeneralBattle, GameUi, OrochiAssets):
             return True
 
 
+    def run_leader(self):
+        pass
+
+    def run_member(self):
+        pass
+
+    def run_alone(self):
+        pass
+
+    def run_wild(self):
+        logger.error('Wild mode is not implemented')
+        pass
+
+