runhey 3 лет назад
Родитель
Сommit
430a2647c5
39 измененных файлов с 463 добавлено и 28 удалено
  1. 57 1
      config/template.json
  2. 2 2
      module/config/i18n/zh_CN.ts
  3. 39 9
      module/ocr/base_ocr.py
  4. 1 1
      script.py
  5. 1 1
      tasks/Component/GeneralInvite/general_invite.py
  6. BIN
      tasks/Component/GeneralInvite/gi/gi_matching.png
  7. 2 2
      tasks/Component/GeneralInvite/gi/image.json
  8. BIN
      tasks/Component/GeneralRoom/gr/gr_gr_matching_new.png
  9. 2 2
      tasks/Component/GeneralRoom/gr/image.json
  10. 64 0
      tasks/Component/ReplaceShikigami/assets.py
  11. 3 0
      tasks/Component/ReplaceShikigami/replace_shikigami.py
  12. 56 0
      tasks/Component/ReplaceShikigami/rs/click.json
  13. 128 0
      tasks/Component/ReplaceShikigami/rs/image.json
  14. BIN
      tasks/Component/ReplaceShikigami/rs/rs_rs_material.png
  15. BIN
      tasks/Component/ReplaceShikigami/rs/rs_rs_material_selected.png
  16. BIN
      tasks/Component/ReplaceShikigami/rs/rs_rs_n.png
  17. BIN
      tasks/Component/ReplaceShikigami/rs/rs_rs_n_selected.png
  18. BIN
      tasks/Component/ReplaceShikigami/rs/rs_rs_no_add.png
  19. BIN
      tasks/Component/ReplaceShikigami/rs/rs_rs_r.png
  20. BIN
      tasks/Component/ReplaceShikigami/rs/rs_rs_r_selected.png
  21. BIN
      tasks/Component/ReplaceShikigami/rs/rs_rs_records_shiki.png
  22. BIN
      tasks/Component/ReplaceShikigami/rs/rs_rs_sp.png
  23. BIN
      tasks/Component/ReplaceShikigami/rs/rs_rs_sp_selected.png
  24. BIN
      tasks/Component/ReplaceShikigami/rs/rs_rs_sr.png
  25. BIN
      tasks/Component/ReplaceShikigami/rs/rs_rs_sr_selected.png
  26. BIN
      tasks/Component/ReplaceShikigami/rs/rs_rs_ssr.png
  27. BIN
      tasks/Component/ReplaceShikigami/rs/rs_rs_ssr_selected.png
  28. 12 0
      tasks/GotoMain/assets.py
  29. 12 0
      tasks/KekkaiActivation/assets.py
  30. 12 0
      tasks/KekkaiUtilize/assets.py
  31. 4 4
      tasks/Orochi/o/image.json
  32. BIN
      tasks/Orochi/o/o_orochi_matching.png
  33. 4 0
      tasks/Restart/assets.py
  34. 2 0
      tasks/Restart/config.py
  35. BIN
      tasks/Restart/harvest/harvest_harvest_ap.png
  36. BIN
      tasks/Restart/harvest/harvest_harvest_mail_title.png
  37. 18 0
      tasks/Restart/harvest/image.json
  38. 32 6
      tasks/Restart/login.py
  39. 12 0
      tasks/ui/assets.py

+ 57 - 1
config/template.json

@@ -36,7 +36,8 @@
       "enable_sign": true,
       "enable_sign_999": true,
       "enable_mail": true,
-      "enable_soul": true
+      "enable_soul": true,
+      "enable_ap": true
     }
   },
   "global_game": {
@@ -123,6 +124,61 @@
       "random_click_swipt_enable": false
     }
   },
+  "kekkai_utilize": {
+    "scheduler": {
+      "enable": false,
+      "next_run": "2023-01-01 00:00:00",
+      "priority": 2,
+      "success_interval": "00 06:00:00",
+      "failure_interval": "00 06:00:00",
+      "server_update": "09:00:00"
+    },
+    "utilize_config": {
+      "utilize_rule": "auto",
+      "auto_switch_sort": true,
+      "shikigami_class": "N",
+      "shikigami_order": 4,
+      "guild_ap_enable": true,
+      "guild_assets_enable": true,
+      "box_ap_enable": true,
+      "box_exp_enable": true
+    }
+  },
+  "kekkai_activation": {
+    "scheduler": {
+      "enable": false,
+      "next_run": "2023-01-01 00:00:00",
+      "priority": 2,
+      "success_interval": "00 10:00:00",
+      "failure_interval": "00 10:00:00",
+      "server_update": "09:00:00"
+    },
+    "activation_config": {
+      "card_rule": "auto",
+      "exchange_before": true,
+      "exchange_max": true,
+      "shikigami_class": "N"
+    }
+  },
+  "demon_encounter": {
+    "scheduler": {
+      "enable": false,
+      "next_run": "2023-01-01 00:00:00",
+      "priority": 2,
+      "success_interval": "01 00:00:00",
+      "failure_interval": "01 00:00:00",
+      "server_update": "09:00:00"
+    },
+    "general_battle_config": {
+      "lock_team_enable": false,
+      "preset_enable": false,
+      "preset_group": 1,
+      "preset_team": 1,
+      "green_enable": false,
+      "green_mark": "green_left1",
+      "random_click_swipt_enable": false
+    }
+  },
   "orochi": {
     "scheduler": {
       "enable": false,

+ 2 - 2
module/config/i18n/zh_CN.ts

@@ -455,7 +455,7 @@ mode_3策略是刷到五个契灵后开始结契,选择高级、中级盘来
 </context>	
 <context>
     <name>Args</name>
-	<message><source>UtilizeScheduler</source><translation>调度</translation></message>
+	<message><source>UtilizeScheduler</source><translation>任务调度</translation></message>
 	<message><source>UtilizeConfig</source><translation>寄养</translation></message>
 	<message><source>Utilize Rule</source><translation>寄养规则</translation></message>
 	<message><source>Auto Switch Sort</source><translation>切换好友列表以游戏刷新高星排序</translation></message>
@@ -477,7 +477,7 @@ mode_3策略是刷到五个契灵后开始结契,选择高级、中级盘来
 </context>	
 <context>
     <name>Args</name>
-	<message><source>ActivationScheduler</source><translation>调度</translation></message>
+	<message><source>ActivationScheduler</source><translation>任务调度</translation></message>
 	<message><source>ActivationConfig</source><translation>寄养</translation></message>
 	<message><source>Card Rule</source><translation>放卡规则</translation></message>
 	<message><source>Exchange Max</source><translation>收取经验后更换下来满级的式神</translation></message>

+ 39 - 9
module/ocr/base_ocr.py

@@ -181,7 +181,7 @@ class BaseCor:
             return self.keyword == result
 
 
-    def filter(self, boxed_results: list[BoxedResult], keyword: str=None) -> list:
+    def filter(self, boxed_results: list[BoxedResult], keyword: str=None) -> list or None:
         """
         使用ocr获取结果后和keyword进行匹配. 返回匹配的index list
         :param keyword: 如果不指定默认适用对象的keyword
@@ -205,18 +205,48 @@ class BaseCor:
 
         # 如果适用顺序拼接还是没有匹配到,那可能是竖排的,使用单个字节的keyword进行匹配
         indices = []
+        # 对于keyword中的每一个字符,都要在strings中进行匹配
+        # 如果这个字符在strings中的某一个string中,那么就记录这个string的index
+        max_index = len(strings) - 1
         for index, char in enumerate(keyword):
             for i, string in enumerate(strings):
                 if char not in string:
+                    continue
+                if i <= max_index:
+                    indices.append(i)
                     break
-                if i == len(strings) - 1:
-                    indices.append(index)
         if indices:
+            # 剔除掉重复的index
+            indices = list(set(indices))
             return indices
         else:
-            indices = None
-            return indices
-
-
-
-
+            return None
+
+
+
+
+# def test():
+#     # strings = ["探", "索"]
+#     # keyword = "探索"
+#     # strings是截图ocr的结果,keyword是要匹配的关键字
+#     strings = ['123', '456', '789', '101112', '131415', '456']
+#     keyword = '123456'
+#
+#     indices = []
+#     # 对于keyword中的每一个字符,都要在strings中进行匹配
+#     # 如果这个字符在strings中的某一个string中,那么就记录这个string的index
+#     max_index = len(strings) - 1
+#     for index, char in enumerate(keyword):
+#         for i, string in enumerate(strings):
+#             if char not in string:
+#                 continue
+#             if i <= max_index:
+#                 indices.append(i)
+#                 break
+#     if indices:
+#         # 剔除掉重复的index
+#         indices = list(set(indices))
+#         return indices
+#     else:
+#         return None
+# print(test())

+ 1 - 1
script.py

@@ -392,7 +392,7 @@ class Script:
             # Skip first restart
             if self.is_first_task and task == 'Restart':
                 logger.info('Skip task `Restart` at scheduler start')
-                self.config.task_delay(task='Restart', finish=True, success=True, server=True)
+                self.config.task_delay(task='Restart', success=True, server=True)
                 del_cached_property(self, 'config')
                 continue
 

+ 1 - 1
tasks/Component/GeneralInvite/general_invite.py

@@ -645,5 +645,5 @@ if __name__ == '__main__':
 
     # t.run_invite(c.orochi.invite_config, is_first=True)
     t.screenshot()
-    print(t.check_and_invite(True))
+    print(t.detect_select('我是真的天秀'))
 

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


+ 2 - 2
tasks/Component/GeneralInvite/gi/image.json

@@ -56,8 +56,8 @@
   {
     "itemName": "matching",
     "imageName": "gi_matching.png",
-    "roiFront": "1200,110,52,114",
-    "roiBack": "1200,110,52,114",
+    "roiFront": "51,574,52,114",
+    "roiBack": "51,574,52,114",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "如果是到时间会退出房间,这个右边显示一个匹配的图片"

BIN
tasks/Component/GeneralRoom/gr/gr_gr_matching_new.png


+ 2 - 2
tasks/Component/GeneralRoom/gr/image.json

@@ -65,8 +65,8 @@
   {
     "itemName": "gr_matching_new",
     "imageName": "gr_gr_matching_new.png",
-    "roiFront": "1204,102,42,121",
-    "roiBack": "1204,102,42,121",
+    "roiFront": "62,571,42,121",
+    "roiBack": "62,571,42,121",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"

+ 64 - 0
tasks/Component/ReplaceShikigami/assets.py

@@ -0,0 +1,64 @@
+from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+from module.atom.long_click import RuleLongClick
+from module.atom.swipe import RuleSwipe
+from module.atom.ocr import RuleOcr
+from module.atom.list import RuleList
+
+# This file was automatically generated by module/dev_tools/assets_extract.py.
+# Don't modify it manually.
+class ReplaceShikigamiAssets: 
+
+
+	# Click Rule Assets
+	# description 
+	C_SHIKIGAMI_SWITCH_1 = RuleClick(roi_front=(31,618,66,64), roi_back=(31,618,66,64), name="shikigami_switch_1")
+	# description 
+	C_SHIKIGAMI_LEFT_1 = RuleClick(roi_front=(163,487,100,179), roi_back=(163,487,100,179), name="shikigami_left_1")
+	# description 
+	C_SHIKIGAMI_LEFT_2 = RuleClick(roi_front=(295,487,100,178), roi_back=(295,487,100,178), name="shikigami_left_2")
+	# description 
+	C_SHIKIGAMI_LEFT_3 = RuleClick(roi_front=(436,492,100,178), roi_back=(436,492,100,178), name="shikigami_left_3")
+	# description 
+	C_SHIKIGAMI_LEFT_4 = RuleClick(roi_front=(571,493,100,174), roi_back=(571,493,100,174), name="shikigami_left_4")
+	# description 
+	C_SHIKIGAMI_LEFT_5 = RuleClick(roi_front=(704,492,100,176), roi_back=(704,492,100,176), name="shikigami_left_5")
+	# description 
+	C_SHIKIGAMI_LEFT_6 = RuleClick(roi_front=(839,487,100,182), roi_back=(839,487,100,182), name="shikigami_left_6")
+	# description 
+	C_SHIKIGAMI_LEFT_7 = RuleClick(roi_front=(977,493,100,171), roi_back=(977,493,100,171), name="shikigami_left_7")
+	# description 
+	C_SHIKIGAMI_LEFT_8 = RuleClick(roi_front=(1033,490,100,180), roi_back=(1033,490,100,180), name="shikigami_left_8")
+
+
+	# Image Rule Assets
+	# description 
+	I_RS_NO_ADD = RuleImage(roi_front=(276,222,100,212), roi_back=(28,181,1232,293), threshold=0.8, method="Template matching", file="./tasks/Component/ReplaceShikigami/rs/rs_rs_no_add.png")
+	# 素材 
+	I_RS_MATERIAL = RuleImage(roi_front=(32,283,59,56), roi_back=(32,283,59,56), threshold=0.8, method="Template matching", file="./tasks/Component/ReplaceShikigami/rs/rs_rs_material.png")
+	# description 
+	I_RS_N = RuleImage(roi_front=(138,299,57,59), roi_back=(138,299,57,59), threshold=0.8, method="Template matching", file="./tasks/Component/ReplaceShikigami/rs/rs_rs_n.png")
+	# description 
+	I_RS_R = RuleImage(roi_front=(230,344,64,61), roi_back=(230,344,64,61), threshold=0.8, method="Template matching", file="./tasks/Component/ReplaceShikigami/rs/rs_rs_r.png")
+	# description 
+	I_RS_SR = RuleImage(roi_front=(307,421,62,58), roi_back=(307,421,62,58), threshold=0.8, method="Template matching", file="./tasks/Component/ReplaceShikigami/rs/rs_rs_sr.png")
+	# description 
+	I_RS_SSR = RuleImage(roi_front=(354,517,63,58), roi_back=(354,517,63,58), threshold=0.8, method="Template matching", file="./tasks/Component/ReplaceShikigami/rs/rs_rs_ssr.png")
+	# description 
+	I_RS_SP = RuleImage(roi_front=(372,621,58,60), roi_back=(372,621,58,60), threshold=0.8, method="Template matching", file="./tasks/Component/ReplaceShikigami/rs/rs_rs_sp.png")
+	# description 
+	I_RS_MATERIAL_SELECTED = RuleImage(roi_front=(27,620,68,65), roi_back=(27,620,68,65), threshold=0.8, method="Template matching", file="./tasks/Component/ReplaceShikigami/rs/rs_rs_material_selected.png")
+	# description 
+	I_RS_N_SELECTED = RuleImage(roi_front=(30,620,66,60), roi_back=(30,620,66,60), threshold=0.8, method="Template matching", file="./tasks/Component/ReplaceShikigami/rs/rs_rs_n_selected.png")
+	# description 
+	I_RS_R_SELECTED = RuleImage(roi_front=(26,617,72,60), roi_back=(26,617,72,60), threshold=0.8, method="Template matching", file="./tasks/Component/ReplaceShikigami/rs/rs_rs_r_selected.png")
+	# description 
+	I_RS_SR_SELECTED = RuleImage(roi_front=(32,623,59,55), roi_back=(32,623,59,55), threshold=0.8, method="Template matching", file="./tasks/Component/ReplaceShikigami/rs/rs_rs_sr_selected.png")
+	# description 
+	I_RS_SSR_SELECTED = RuleImage(roi_front=(29,622,66,59), roi_back=(29,622,66,59), threshold=0.8, method="Template matching", file="./tasks/Component/ReplaceShikigami/rs/rs_rs_ssr_selected.png")
+	# description 
+	I_RS_SP_SELECTED = RuleImage(roi_front=(31,622,62,59), roi_back=(31,622,62,59), threshold=0.8, method="Template matching", file="./tasks/Component/ReplaceShikigami/rs/rs_rs_sp_selected.png")
+	# description 
+	I_RS_RECORDS_SHIKI = RuleImage(roi_front=(1148,548,49,43), roi_back=(1148,548,49,43), threshold=0.8, method="Template matching", file="./tasks/Component/ReplaceShikigami/rs/rs_rs_records_shiki.png")
+
+

+ 3 - 0
tasks/Component/ReplaceShikigami/replace_shikigami.py

@@ -0,0 +1,3 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey

+ 56 - 0
tasks/Component/ReplaceShikigami/rs/click.json

@@ -0,0 +1,56 @@
+[
+  {
+    "itemName": "shikigami_switch_1",
+    "roiFront": "31,618,66,64",
+    "roiBack": "31,618,66,64",
+    "description": "description"
+  },
+  {
+    "itemName": "shikigami_left_1",
+    "roiFront": "163,487,100,179",
+    "roiBack": "163,487,100,179",
+    "description": "description"
+  },
+  {
+    "itemName": "shikigami_left_2",
+    "roiFront": "295,487,100,178",
+    "roiBack": "295,487,100,178",
+    "description": "description"
+  },
+  {
+    "itemName": "shikigami_left_3",
+    "roiFront": "436,492,100,178",
+    "roiBack": "436,492,100,178",
+    "description": "description"
+  },
+  {
+    "itemName": "shikigami_left_4",
+    "roiFront": "571,493,100,174",
+    "roiBack": "571,493,100,174",
+    "description": "description"
+  },
+  {
+    "itemName": "shikigami_left_5",
+    "roiFront": "704,492,100,176",
+    "roiBack": "704,492,100,176",
+    "description": "description"
+  },
+  {
+    "itemName": "shikigami_left_6",
+    "roiFront": "839,487,100,182",
+    "roiBack": "839,487,100,182",
+    "description": "description"
+  },
+  {
+    "itemName": "shikigami_left_7",
+    "roiFront": "977,493,100,171",
+    "roiBack": "977,493,100,171",
+    "description": "description"
+  },
+  {
+    "itemName": "shikigami_left_8",
+    "roiFront": "1033,490,100,180",
+    "roiBack": "1033,490,100,180",
+    "description": "description"
+  }
+]

+ 128 - 0
tasks/Component/ReplaceShikigami/rs/image.json

@@ -0,0 +1,128 @@
+[
+  {
+    "itemName": "rs_no_add",
+    "imageName": "rs_rs_no_add.png",
+    "roiFront": "276,222,100,212",
+    "roiBack": "28,181,1232,293",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "rs_material",
+    "imageName": "rs_rs_material.png",
+    "roiFront": "32,283,59,56",
+    "roiBack": "32,283,59,56",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "素材"
+  },
+  {
+    "itemName": "rs_n",
+    "imageName": "rs_rs_n.png",
+    "roiFront": "138,299,57,59",
+    "roiBack": "138,299,57,59",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "rs_r",
+    "imageName": "rs_rs_r.png",
+    "roiFront": "230,344,64,61",
+    "roiBack": "230,344,64,61",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "rs_sr",
+    "imageName": "rs_rs_sr.png",
+    "roiFront": "307,421,62,58",
+    "roiBack": "307,421,62,58",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "rs_ssr",
+    "imageName": "rs_rs_ssr.png",
+    "roiFront": "354,517,63,58",
+    "roiBack": "354,517,63,58",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "rs_sp",
+    "imageName": "rs_rs_sp.png",
+    "roiFront": "372,621,58,60",
+    "roiBack": "372,621,58,60",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "rs_material_selected",
+    "imageName": "rs_rs_material_selected.png",
+    "roiFront": "27,620,68,65",
+    "roiBack": "27,620,68,65",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "rs_n_selected",
+    "imageName": "rs_rs_n_selected.png",
+    "roiFront": "30,620,66,60",
+    "roiBack": "30,620,66,60",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "rs_r_selected",
+    "imageName": "rs_rs_r_selected.png",
+    "roiFront": "26,617,72,60",
+    "roiBack": "26,617,72,60",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "rs_sr_selected",
+    "imageName": "rs_rs_sr_selected.png",
+    "roiFront": "32,623,59,55",
+    "roiBack": "32,623,59,55",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "rs_ssr_selected",
+    "imageName": "rs_rs_ssr_selected.png",
+    "roiFront": "29,622,66,59",
+    "roiBack": "29,622,66,59",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "rs_sp_selected",
+    "imageName": "rs_rs_sp_selected.png",
+    "roiFront": "31,622,62,59",
+    "roiBack": "31,622,62,59",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "rs_records_shiki",
+    "imageName": "rs_rs_records_shiki.png",
+    "roiFront": "1148,548,49,43",
+    "roiBack": "1148,548,49,43",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/Component/ReplaceShikigami/rs/rs_rs_material.png


BIN
tasks/Component/ReplaceShikigami/rs/rs_rs_material_selected.png


BIN
tasks/Component/ReplaceShikigami/rs/rs_rs_n.png


BIN
tasks/Component/ReplaceShikigami/rs/rs_rs_n_selected.png


BIN
tasks/Component/ReplaceShikigami/rs/rs_rs_no_add.png


BIN
tasks/Component/ReplaceShikigami/rs/rs_rs_r.png


BIN
tasks/Component/ReplaceShikigami/rs/rs_rs_r_selected.png


BIN
tasks/Component/ReplaceShikigami/rs/rs_rs_records_shiki.png


BIN
tasks/Component/ReplaceShikigami/rs/rs_rs_sp.png


BIN
tasks/Component/ReplaceShikigami/rs/rs_rs_sp_selected.png


BIN
tasks/Component/ReplaceShikigami/rs/rs_rs_sr.png


BIN
tasks/Component/ReplaceShikigami/rs/rs_rs_sr_selected.png


BIN
tasks/Component/ReplaceShikigami/rs/rs_rs_ssr.png


BIN
tasks/Component/ReplaceShikigami/rs/rs_rs_ssr_selected.png


+ 12 - 0
tasks/GotoMain/assets.py

@@ -0,0 +1,12 @@
+from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+from module.atom.long_click import RuleLongClick
+from module.atom.swipe import RuleSwipe
+from module.atom.ocr import RuleOcr
+from module.atom.list import RuleList
+
+# This file was automatically generated by module/dev_tools/assets_extract.py.
+# Don't modify it manually.
+class GotoMainAssets: 
+	pass
+

+ 12 - 0
tasks/KekkaiActivation/assets.py

@@ -0,0 +1,12 @@
+from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+from module.atom.long_click import RuleLongClick
+from module.atom.swipe import RuleSwipe
+from module.atom.ocr import RuleOcr
+from module.atom.list import RuleList
+
+# This file was automatically generated by module/dev_tools/assets_extract.py.
+# Don't modify it manually.
+class KekkaiActivationAssets: 
+	pass
+

+ 12 - 0
tasks/KekkaiUtilize/assets.py

@@ -0,0 +1,12 @@
+from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+from module.atom.long_click import RuleLongClick
+from module.atom.swipe import RuleSwipe
+from module.atom.ocr import RuleOcr
+from module.atom.list import RuleList
+
+# This file was automatically generated by module/dev_tools/assets_extract.py.
+# Don't modify it manually.
+class KekkaiUtilizeAssets: 
+	pass
+

+ 4 - 4
tasks/Orochi/o/image.json

@@ -28,7 +28,7 @@
   },
   {
     "itemName": "orochi_unlock",
-    "imageName": "o_unlock.png",
+    "imageName": "o_orochi_unlock.png",
     "roiFront": "560,564,26,29",
     "roiBack": "560,564,26,29",
     "method": "Template matching",
@@ -55,9 +55,9 @@
   },
   {
     "itemName": "orochi_matching",
-    "imageName": "o_matching.png",
-    "roiFront": "1205,106,44,114",
-    "roiBack": "1205,106,44,114",
+    "imageName": "o_orochi_matching.png",
+    "roiFront": "62,568,44,114",
+    "roiBack": "62,568,44,114",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"

BIN
tasks/Orochi/o/o_orochi_matching.png


+ 4 - 0
tasks/Restart/assets.py

@@ -29,6 +29,10 @@ class RestartAssets:
 	I_HARVEST_MAIL_CONFIRM = RuleImage(roi_front=(687,543,168,64), roi_back=(687,543,168,64), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_mail_confirm.png")
 	# description 
 	I_HARVEST_SOUL = RuleImage(roi_front=(241,497,38,36), roi_back=(68,480,930,72), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_soul.png")
+	# description 
+	I_HARVEST_MAIL_TITLE = RuleImage(roi_front=(520,48,245,41), roi_back=(520,48,245,41), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_mail_title.png")
+	# description 
+	I_HARVEST_AP = RuleImage(roi_front=(721,486,31,38), roi_back=(206,462,999,81), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_ap.png")
 
 
 	# Image Rule Assets

+ 2 - 0
tasks/Restart/config.py

@@ -21,6 +21,8 @@ class HarvestConfig(BaseModel):
     enable_mail: bool = Field(default=True)
     # 御魂加成
     enable_soul: bool = Field(default=True)
+    # 体力
+    enable_ap: bool = Field(default=True)
 
 
 

BIN
tasks/Restart/harvest/harvest_harvest_ap.png


BIN
tasks/Restart/harvest/harvest_harvest_mail_title.png


+ 18 - 0
tasks/Restart/harvest/image.json

@@ -79,5 +79,23 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
+  },
+  {
+    "itemName": "harvest_mail_title",
+    "imageName": "harvest_harvest_mail_title.png",
+    "roiFront": "520,48,245,41",
+    "roiBack": "520,48,245,41",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "harvest_ap",
+    "imageName": "harvest_harvest_ap.png",
+    "roiFront": "721,486,31,38",
+    "roiBack": "206,462,999,81",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
   }
 ]

+ 32 - 6
tasks/Restart/login.py

@@ -105,35 +105,61 @@ class LoginHandler(BaseTask, RestartAssets):
 
             # 点击'获得奖励'
             if self.ui_reward_appear_click():
+                timer_harvest.reset()
                 continue
             # 获得奖励
             if self.appear_then_click(self.I_UI_AWARD, interval=1):
+                timer_harvest.reset()
                 continue
 
             # 勾玉
             if self.appear_then_click(self.I_HARVEST_JADE, interval=1):
+                timer_harvest.reset()
                 continue
             # 签到
             if self.appear_then_click(self.I_HARVEST_SIGN, interval=1):
+                timer_harvest.reset()
                 continue
             if self.appear_then_click(self.I_HARVEST_SIGN_2, interval=1):
+                timer_harvest.reset()
                 continue
             # 999天的签到福袋
             if self.appear_then_click(self.I_HARVEST_SIGN_999, interval=1):
+                timer_harvest.reset()
                 continue
             # 邮件
             if self.appear_then_click(self.I_HARVEST_MAIL, interval=1):
-                continue
-            if self.appear_then_click(self.I_HARVEST_MAIL_ALL, interval=1):
-                continue
-            if self.appear_then_click(self.I_HARVEST_MAIL_CONFIRM, interval=1):
-                continue
-            if self.appear_then_click(self.I_HARVEST_MAIL_OPEN, interval=1):
+                timer_harvest.reset()
+                continue
+            if self.appear(self.I_HARVEST_MAIL_TITLE, interval=0.2):
+                while 1:
+                    self.screenshot()
+                    if self.appear_then_click(self.I_HARVEST_MAIL_ALL, interval=2):
+                        timer_harvest.reset()
+                        pass
+                    if self.appear_then_click(self.I_HARVEST_MAIL_CONFIRM, interval=1):
+                        continue
+
+                    # 如果一直出现收取全部,那就说明还在进行中
+                    if self.appear(self.I_HARVEST_MAIL_ALL):
+                        pass
+                    # 如果没有出现 ‘收取全部’ 也没有出现 ‘还未读的邮件’ 那就可以退出了
+                    if not self.appear(self.I_HARVEST_MAIL_ALL) and not self.appear(self.I_HARVEST_MAIL_OPEN):
+                        logger.info('Mail has been harvested')
+                        logger.info('Exit mail')
+                        break
+                    if self.appear_then_click(self.I_HARVEST_MAIL_OPEN, interval=1):
+                        timer_harvest.reset()
+                        continue
+            # 体力
+            if self.appear_then_click(self.I_HARVEST_AP, interval=1):
+                timer_harvest.reset()
                 continue
 
 
             # 红色的关闭
             if self.appear_then_click(self.I_UI_BACK_RED, interval=1):
+                timer_harvest.reset()
                 continue
 
             # 三秒内没有发现任何奖励,退出

+ 12 - 0
tasks/ui/assets.py

@@ -0,0 +1,12 @@
+from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+from module.atom.long_click import RuleLongClick
+from module.atom.swipe import RuleSwipe
+from module.atom.ocr import RuleOcr
+from module.atom.list import RuleList
+
+# This file was automatically generated by module/dev_tools/assets_extract.py.
+# Don't modify it manually.
+class uiAssets: 
+	pass
+