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

Merge pull request #188 from runhey/dev

Dev
huangrunheng 2 лет назад
Родитель
Сommit
977d3757d9
100 измененных файлов с 1093 добавлено и 109 удалено
  1. 34 4
      README.md
  2. BIN
      bin/droidcast/DroidCast-debug-1.1.0.apk
  3. BIN
      bin/droidcast/DroidCast-debug-1.2.0.apk
  4. 44 0
      dev_tools/assets_test.py
  5. 6 6
      module/atom/image.py
  6. 1 1
      module/config/config_manual.py
  7. 11 7
      module/device/screenshot.py
  8. 3 2
      module/ocr/sub_ocr.py
  9. 1 1
      tasks/AreaBoss/script_task.py
  10. 29 5
      tasks/BondlingFairyland/script_task.py
  11. 45 0
      tasks/Component/Costume/README.md
  12. 116 0
      tasks/Component/Costume/assets.py
  13. 59 0
      tasks/Component/Costume/config.py
  14. 98 0
      tasks/Component/Costume/costume_base.py
  15. 41 0
      tasks/Component/Costume/costume_test.py
  16. 61 0
      tasks/Component/Costume/costume_test_realm.py
  17. 47 0
      tasks/Component/Costume/main1/image.json
  18. BIN
      tasks/Component/Costume/main1/image_name.png
  19. BIN
      tasks/Component/Costume/main1/main1_check_main_1.png
  20. BIN
      tasks/Component/Costume/main1/main1_main_goto_exploration_1.png
  21. BIN
      tasks/Component/Costume/main1/main1_main_goto_summon_1.png
  22. BIN
      tasks/Component/Costume/main1/main1_main_goto_town_1.png
  23. BIN
      tasks/Component/Costume/main1/main1_pet_house_1.png
  24. 47 0
      tasks/Component/Costume/main2/image.json
  25. BIN
      tasks/Component/Costume/main2/main2_check_main_2.png
  26. BIN
      tasks/Component/Costume/main2/main2_main_goto_exploration_2.png
  27. BIN
      tasks/Component/Costume/main2/main2_main_goto_summon_2.png
  28. BIN
      tasks/Component/Costume/main2/main2_main_goto_town_2.png
  29. BIN
      tasks/Component/Costume/main2/main2_pet_house_2.png
  30. 47 0
      tasks/Component/Costume/main3/image.json
  31. BIN
      tasks/Component/Costume/main3/main3_check_main_3.png
  32. BIN
      tasks/Component/Costume/main3/main3_main_goto_exploration_3.png
  33. BIN
      tasks/Component/Costume/main3/main3_main_goto_summon_3.png
  34. BIN
      tasks/Component/Costume/main3/main3_main_goto_town_3.png
  35. BIN
      tasks/Component/Costume/main3/main3_pet_house_3.png
  36. 47 0
      tasks/Component/Costume/main4/image.json
  37. BIN
      tasks/Component/Costume/main4/main4_check_main_4.png
  38. BIN
      tasks/Component/Costume/main4/main4_main_goto_exploration_4.png
  39. BIN
      tasks/Component/Costume/main4/main4_main_goto_summon_4.png
  40. BIN
      tasks/Component/Costume/main4/main4_main_goto_town_4.png
  41. BIN
      tasks/Component/Costume/main4/main4_pet_house_4.png
  42. 47 0
      tasks/Component/Costume/main5/image.json
  43. BIN
      tasks/Component/Costume/main5/main5_check_main_5.png
  44. BIN
      tasks/Component/Costume/main5/main5_main_goto_exploration_5.png
  45. BIN
      tasks/Component/Costume/main5/main5_main_goto_summon_5.png
  46. BIN
      tasks/Component/Costume/main5/main5_main_goto_town_5.png
  47. BIN
      tasks/Component/Costume/main5/main5_pet_house_5.png
  48. 47 0
      tasks/Component/Costume/main6/image.json
  49. BIN
      tasks/Component/Costume/main6/main6_check_main_6.png
  50. BIN
      tasks/Component/Costume/main6/main6_main_goto_exploration_6.png
  51. BIN
      tasks/Component/Costume/main6/main6_main_goto_summon_6.png
  52. BIN
      tasks/Component/Costume/main6/main6_main_goto_town_6.png
  53. BIN
      tasks/Component/Costume/main6/main6_pet_house_6.png
  54. 47 0
      tasks/Component/Costume/main7/image.json
  55. BIN
      tasks/Component/Costume/main7/main7_check_main_7.png
  56. BIN
      tasks/Component/Costume/main7/main7_main_goto_exploration_7.png
  57. BIN
      tasks/Component/Costume/main7/main7_main_goto_summon_7.png
  58. BIN
      tasks/Component/Costume/main7/main7_main_goto_town_7.png
  59. BIN
      tasks/Component/Costume/main7/main7_pet_house_7.png
  60. 47 0
      tasks/Component/Costume/main8/image.json
  61. BIN
      tasks/Component/Costume/main8/main8_check_main_8.png
  62. BIN
      tasks/Component/Costume/main8/main8_main_goto_exploration_8.png
  63. BIN
      tasks/Component/Costume/main8/main8_main_goto_summon_8.png
  64. BIN
      tasks/Component/Costume/main8/main8_main_goto_town_8.png
  65. BIN
      tasks/Component/Costume/main8/main8_pet_house_8.png
  66. 19 0
      tasks/Component/CostumeRealm/assets.py
  67. 20 0
      tasks/Component/CostumeRealm/realm1/image.json
  68. BIN
      tasks/Component/CostumeRealm/realm1/realm1_shi_card_1.png
  69. BIN
      tasks/Component/CostumeRealm/realm1/realm1_shi_defense_1.png
  70. 2 3
      tasks/DailyTrifles/script_task.py
  71. 5 0
      tasks/Exploration/script_task.py
  72. 2 0
      tasks/GlobalGame/config.py
  73. BIN
      tasks/KekkaiActivation/a/a_a_demount.png
  74. BIN
      tasks/KekkaiActivation/a/a_a_invite.png
  75. 11 2
      tasks/KekkaiActivation/a/image.json
  76. 8 6
      tasks/KekkaiActivation/assets.py
  77. BIN
      tasks/KekkaiActivation/cards/cards_cards_kaiko_3.png
  78. BIN
      tasks/KekkaiActivation/cards/cards_cards_kaiko_4.png
  79. BIN
      tasks/KekkaiActivation/cards/cards_cards_kaiko_5.png
  80. BIN
      tasks/KekkaiActivation/cards/cards_cards_kaiko_6.png
  81. 8 8
      tasks/KekkaiActivation/cards/image.json
  82. 1 1
      tasks/KekkaiActivation/ocr.json
  83. 8 2
      tasks/KekkaiActivation/script_task.py
  84. 14 8
      tasks/KekkaiUtilize/assets.py
  85. 9 9
      tasks/KekkaiUtilize/realm/image.json
  86. 8 5
      tasks/KekkaiUtilize/script_task.py
  87. 27 0
      tasks/KekkaiUtilize/utilize/image_2.json
  88. BIN
      tasks/KekkaiUtilize/utilize/utilize_check_friend_realm_1.png
  89. BIN
      tasks/KekkaiUtilize/utilize/utilize_check_friend_realm_2.png
  90. BIN
      tasks/KekkaiUtilize/utilize/utilize_check_friend_realm_3.png
  91. 2 2
      tasks/Orochi/assets.py
  92. 4 4
      tasks/Orochi/o/image.json
  93. BIN
      tasks/Orochi/o/o_orochi_lock.png
  94. BIN
      tasks/Orochi/o/o_orochi_unlock.png
  95. 1 15
      tasks/Orochi/script_task.py
  96. 6 6
      tasks/Restart/assets.py
  97. BIN
      tasks/Restart/harvest/harvest_harvest_sign.png
  98. 7 7
      tasks/Restart/harvest/image.json
  99. 2 2
      tasks/Restart/login.py
  100. 4 3
      tasks/Restart/script_task.py

+ 34 - 4
README.md

@@ -25,14 +25,27 @@
 
 ### [文档](https://runhey.github.io/OnmyojiAutoScript-website/)
 
+#### 主仓库: [https://github.com/runhey/OnmyojiAutoScript](https://github.com/runhey/OnmyojiAutoScript)
+
 </div>
 
+阴阳师,作为一个手游,已经进入了生命周期的晚期。从现在到关服的这段时间里,请减少花费在阴阳师上的时间,把一切都交给 OAS。
 
 ## 功能 Features
 
 - OAS 还在开发中,[查看已实现](https://github.com/runhey/OnmyojiAutoScript/issues/54)
+- **日常任务**: 悬赏封印、小猫咪、小杂签到、金币妖怪、年兽、花合战、地鬼、封魔、御魂整理
+- **每周相关**: 真蛇、秘闻竞速、神秘商店、搜刮商店、斗技、每周小杂事
+- **阴阳寮**: 结界上卡、结界蹭卡、结界突破、寮突破、狩猎战、集体任务
+- **御魂副本**: 八岐大蛇、业原火、日轮之城、永生之海
+- **肝帝专属**: 探索、契灵、御灵、觉醒副本、石距
+- **限时活动**: 每期爬塔、超鬼王
 
 ### 显著特点 
+- **全部任务**: 你能想到的没有想到的都有,一条龙给你解放双手(该画饼画饼,该挖坑挖坑)
+- **无缝衔接**: 时间管理大师,优异的任务调度系统,无缝寄养,无缝执行任务
+- **装饰可选**: 全部初始皮肤是什么鬼,这里支持你喜欢的庭院、主题等等,[详细说明](https://github.com/runhey/OnmyojiAutoScript/issues/180)
+- **...**
 
 ## 许可证 LICENSE
 
@@ -41,14 +54,24 @@ This project is licensed under the GNU General Public License v3.0.
 ## 声明 Announcement
 本软件开源、免费,仅供学习交流使用。开发者团队拥有本项目的最终解释权。使用本软件产生的所有问题与本项目与开发者团队无关。
 
+## 关于 Alas
+OAS 基于碧蓝航线脚本 [AzurLaneAutoScript](https://github.com/LmeSzinc/AzurLaneAutoScript) 开发,考虑到星穹铁道脚本 [StarRailCopilot](https://github.com/LmeSzinc/StarRailCopilot) 中所提及的问题,
+OAS 在其基础上进行了如下优化:
+- **调整设计架构**: 将前后端拆离出来更加灵活,方便后续的维护和扩展;更改些代码架构使其减少同游戏耦合,更加通用。
+- **搭建新的GUI**: 原生的方案过于臃肿,选用 [flutter](https://flutter.cn) 搭建一个全平台的界面端,界面更加舒适简洁
+- **新的OCR库**: 跟随 [LmeSzinc](https://github.com/LmeSzinc) 的步伐, [ppocr-onnx](https://github.com/triwinds/ppocr-onnx) 更加简易使用,精度更高速度更快 
+- **新的Assets管理**: 构建了一个新的Assets管理系统,更加方便的管理游戏资源如图片,文字,点击等等
+- **配置文件 [pydantic](https://github.com/pydantic/pydantic) 化**: pydantic 可以更加优雅的管理用户配置
+
 ## 相关项目 Relative Repositories
-OAS 基于 Alas 框架开发
+
 - [Alas](https://github.com/LmeSzinc/AzurLaneAutoScript): 碧蓝航线的自动化脚本
 - [SRC](https://github.com/LmeSzinc/StarRailCopilot): 星铁速溶茶,崩坏:星穹铁道脚本,基于下一代Alas框架。
+- [OASX](https://github.com/runhey/OASX): 同 OAS 对接的全平台 GUI
 - [NikkeAutoScript](https://github.com/takagisanmie/NIKKEAutoScript): 胜利女神:NIKKE 自动日常脚本
 - [AAS](https://github.com/TheFunny/ArisuAutoSweeper): 蔚蓝档案自动化脚本
 - [MAA](https://github.com/MaaAssistantArknights/MaaAssistantArknights): 明日方舟小助手,全日常一键长草
-- [FGO-py](https://github.com/hgjazhgj/FGO-py): 全自动免配置跨平台开箱即用的Fate/Grand Order助手.启动脚本,上床睡觉,养肝护发,满加成圣诞了解一下?
+- [FGO-py](https://github.com/hgjazhgj/FGO-py): 全自动免配置跨平台开箱即用的Fate/Grand Order助手
 - [OAS-website](https://github.com/runhey/OnmyojiAutoScript-website): OAS 的文档网站,使用 [docusaurus](https://docusaurus.io/) 构建
 - [ppocr-onnx](https://github.com/triwinds/ppocr-onnx): OCR 库,基于 onnxruntime 和 PaddleOCR
 - [gurs](https://github.com/2833844911/gurs): 基于赛贝尔曲线模拟滑动轨迹, 引入其轨迹模拟人手滑动
@@ -67,8 +90,15 @@ OAS 基于 Alas 框架开发
 #### QQ开发群: 207613181
 
 - 发展规划:[#54](https://github.com/runhey/OnmyojiAutoScript/issues/54)
-- OAS 继承了 Alas 的设计思路,这使得极大简便了开发,欢迎提交 Pull Requests,挑选你感兴趣的部分进行开发即可。
-- OAS 仍在活跃中, 我们会不定期发布未来的工作在 Issues 上并标记为 `help wanted`,欢迎向 OAS 提交 Pull Requests,我们会认真阅读你的每一行代码的。
+- OAS 继承了 Alas 的设计思路,极大简便了开发,欢迎提交 PR,挑选你感兴趣的部分进行开发即可。
+- OAS 仍在活跃中, 我们会不定期发布未来的工作在 Issues 上并标记为 `help wanted`,欢迎向 OAS 提交 PR,我们会认真阅读你的每一行代码的。
+
+## 安装 Installation 
+
+- [学习提问](https://runhey.github.io/OnmyojiAutoScript-website/docs/user-manual/scientific-question): 最基本的要求,**必看必学必会**
+- [用户手册](https://runhey.github.io/OnmyojiAutoScript-website/docs/user-manual/getting-started): 在线手册,不定期更新,包含所有使用说明
+- [安装教程](https://runhey.github.io/OnmyojiAutoScript-website/docs/user-manual/installation): 保姆式安装手册,多翻翻有惊喜
+- [开发文档](https://runhey.github.io/OnmyojiAutoScript-website/docs/development/preamble): 虽然迭代很多、年久失修,但入门开发必读,具体以源码为准
 
 ## 鸣谢 Acknowledgements
 

BIN
bin/droidcast/DroidCast-debug-1.1.0.apk


BIN
bin/droidcast/DroidCast-debug-1.2.0.apk


+ 44 - 0
dev_tools/assets_test.py

@@ -0,0 +1,44 @@
+import cv2
+import numpy as np
+
+from numpy import float32, int32, uint8, fromfile
+from pathlib import Path
+
+from module.logger import logger
+from module.atom.image import RuleImage
+from module.atom.ocr import RuleOcr
+
+
+def load_image(file: str):
+    file = Path(file)
+    img = cv2.imdecode(fromfile(file, dtype=uint8), -1)
+    img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
+
+    height, width, channels = img.shape
+    if height != 720 or width != 1280:
+        logger.error(f'Image size is {height}x{width}, not 720x1280')
+        return None
+    return img
+
+
+def detect_image(file: str, targe: RuleImage) -> bool:
+    img = load_image(file)
+    return targe.match(img)
+
+def detect_ocr(file: str, target: RuleOcr):
+    img = load_image(file)
+    return target.ocr(img)
+
+
+
+# 图片文件路径 可以是相对路径
+IMAGE_FILE = './log/screenshots/1706857943173.png'
+if __name__ == '__main__':
+    from tasks.KekkaiActivation.assets import KekkaiActivationAssets
+    targe = KekkaiActivationAssets.I_CARDS_KAIKO_6
+    print(detect_image(IMAGE_FILE, targe))
+    # from tasks.KekkaiActivation.assets import KekkaiActivationAssets
+    # target = KekkaiActivationAssets.O_CARD_ALL_TIME
+    # print(detect_ocr(IMAGE_FILE, target))
+
+

+ 6 - 6
module/atom/image.py

@@ -21,15 +21,16 @@ class RuleImage:
         :param threshold: 阈值  0.8
         :param file: 相对路径, 带后缀
         """
+        self._match_init = False  # 这个是给后面的 等待图片稳定
+        self._image = None  # 这个是匹配的目标
+        self.method = method
+
         self.roi_front: list = list(roi_front)
         self.roi_back = roi_back
-        self.method = method
         self.threshold = threshold
         self.file = file
 
-        self._match_init = False  # 这个是给后面的 等待图片稳定
 
-        self._image = None  # 这个是匹配的目标
 
     @cached_property
     def name(self) -> str:
@@ -90,7 +91,6 @@ class RuleImage:
         """
         return self.method == "Template matching"
 
-
     def corp(self, image: np.array) -> np.array:
         """
         截取图片
@@ -98,12 +98,11 @@ class RuleImage:
         :return:
         """
         x, y, w, h = self.roi_back
+        x, y, w, h = int(x), int(y), int(w), int(h)
         return image[y:y + h, x:x + w]
 
-
     def match(self, image: np.array, threshold: float = None) -> bool:
         """
-
         :param threshold:
         :param image:
         :return:
@@ -151,6 +150,7 @@ class RuleImage:
         return int(x + w//2), int(y + h//2)
 
 
+
 if __name__ == "__main__":
     image = cv2.imread("D:/4713.jpg")
     mat = RuleImage(roi_front=(758,122,66,77), roi_back=(339,104,836,120), threshold=0.8, method="Template matching", file="./tasks/AreaBoss/res/res_explore.png")

+ 1 - 1
module/config/config_manual.py

@@ -30,7 +30,7 @@ class ConfigManual:
 
     # 'DroidCast', 'DroidCast_raw'
     DROIDCAST_VERSION = 'DroidCast'
-    DROIDCAST_FILEPATH_LOCAL = './bin/droidcast/DroidCast-debug-1.1.0.apk'
+    DROIDCAST_FILEPATH_LOCAL = './bin/droidcast/DroidCast-debug-1.2.0.apk'
     DROIDCAST_FILEPATH_REMOTE = '/data/local/tmp/DroidCast.apk'
     DROIDCAST_RAW_FILEPATH_LOCAL = './bin/droidcast/DroidCastS-release-1.1.5.apk'
     DROIDCAST_RAW_FILEPATH_REMOTE = '/data/local/tmp/DroidCastS.apk'

+ 11 - 7
module/device/screenshot.py

@@ -2,6 +2,7 @@ import os
 import time
 from collections import deque
 from datetime import datetime
+from pathlib import Path
 
 import cv2
 import numpy as np
@@ -119,18 +120,21 @@ class Screenshot(Adb, DroidCast, Scrcpy, Window):
         """
         now = time.time()
         if interval is None:
-            interval = self.config.SCREEN_SHOT_SAVE_INTERVAL
+            interval = 1  # 可改
 
         if now - self._last_save_time.get(genre, 0) > interval:
             fmt = 'png'
-            file = '%s.%s' % (int(now * 1000), fmt)
+            file: str = '%s.%s' % (int(now * 1000), fmt)
 
-            folder = self.config.SCREEN_SHOT_SAVE_FOLDER_BASE if to_base_folder else self.config.SCREEN_SHOT_SAVE_FOLDER
-            folder = os.path.join(folder, genre)
-            if not os.path.exists(folder):
-                os.mkdir(folder)
+            folder = Path('./log/screenshots')
+            folder.mkdir(parents=True, exist_ok=True)
+            file: Path = folder / file
+            file = file.resolve()
+            # folder = os.path.join(folder, genre)
+            # if not os.path.exists(folder):
+            #     os.mkdir(folder)
 
-            file = os.path.join(folder, file)
+            # file = os.path.join(folder, file)
             self.image_save(file)
             self._last_save_time[genre] = now
             return True

+ 3 - 2
module/ocr/sub_ocr.py

@@ -156,9 +156,10 @@ class DigitCounter(Single):
 
 class Duration(Single):
     def after_process(self, result):
-        result = super().after_process(result)
         result = result.replace('I', '1').replace('D', '0').replace('S', '5')
-        result = result.replace('B', '8').replace(':', ':')
+        result = result.replace('o', '0').replace('l', '1').replace('O', '0')
+        result = result.replace('B', '8').replace(':', ':').replace(' ', '')
+        result = super().after_process(result)
         return result
 
     @staticmethod

+ 1 - 1
tasks/AreaBoss/script_task.py

@@ -68,7 +68,7 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, AreaBossAssets):
             self.screenshot()
             if self.appear_then_click(self.I_BACK_BLUE, threshold=0.6, interval=2):
                 continue
-            if self.appear(self.I_EXPLORE, threshold=0.6):
+            if self.appear(self.I_CHECK_MAIN, threshold=0.6):
                 break
 
     def boss(self, battle: RuleImage, collect: bool=False):

+ 29 - 5
tasks/BondlingFairyland/script_task.py

@@ -23,6 +23,13 @@ from module.atom.image import RuleImage
 from module.logger import logger
 from module.exception import TaskEnd
 
+
+
+class BondlingNumberMax(Exception):
+    pass
+
+
+
 class ScriptTask(GameUi, BondlingBattle, SwitchSoul, BondlingFairylandAssets):
 
     ball_pos_list = [None, None, None, None, None]  # 用于记录每一个位置的球是否出现
@@ -45,6 +52,7 @@ class ScriptTask(GameUi, BondlingBattle, SwitchSoul, BondlingFairylandAssets):
         battle_config = cong.battle_config
 
         current_ball = 0  # 用于记录当前捕捉的球的位置
+        success = True
         while 1:
 
             if not self.in_search_ui(screenshot=True):
@@ -72,10 +80,17 @@ class ScriptTask(GameUi, BondlingBattle, SwitchSoul, BondlingFairylandAssets):
                     current_ball -= 1
                     logger.info(f'Current ball number: {current_ball} ')
                     continue
-                if self.run_catch(bondling_config, bondling_switch_soul, battle_config):
-                    current_ball -= 1
-                    logger.info(f'Catch successful and current ball number: {current_ball} ')
-                else:
+
+                try:
+                    if self.run_catch(bondling_config, bondling_switch_soul, battle_config):
+                        current_ball -= 1
+                        logger.info(f'Catch successful and current ball number: {current_ball} ')
+                    else:
+                        break
+                except BondlingNumberMax:
+                    logger.error('Bondling number max, exit')
+                    self.config.notifier.push(title='契灵之境', content='契灵数量已达上限500,请及时处理')
+                    success = False
                     break
             else:
                 # 否则就是模式1
@@ -93,7 +108,10 @@ class ScriptTask(GameUi, BondlingBattle, SwitchSoul, BondlingFairylandAssets):
         self.ui_get_current_page()
         self.ui_goto(page_main)
 
-        self.set_next_run(task='BondlingFairyland', finish=True, success=True)
+        if success:
+            self.set_next_run(task='BondlingFairyland', finish=True, success=True)
+        else:
+            self.set_next_run(task='BondlingFairyland', finish=True, success=False)
         raise TaskEnd
 
 
@@ -479,12 +497,18 @@ class ScriptTask(GameUi, BondlingBattle, SwitchSoul, BondlingFairylandAssets):
         """
         点击 挑战, 主要是结契时的挑战
         """
+        click_count = 0
         while 1:
             self.screenshot()
             if not self.appear(self.I_CLICK_CAPTION, threshold=0.7):
                 break
             if self.appear_then_click(self.I_BALL_FIRE, interval=1):
+                click_count += 1
                 continue
+            if click_count >= 6:
+                logger.error('Click fire failed')
+                logger.error('You might need to check your bondling number. It most possibly arrived to the max 500')
+                raise BondlingNumberMax
             # 某些活动的时候出现 “选择共鸣的阴阳师”
             if self.appear_then_click(self.I_UI_CONFIRM, interval=1):
                 continue

+ 45 - 0
tasks/Component/Costume/README.md

@@ -0,0 +1,45 @@
+## 如何添加自定义庭院
+
+1. 在`./tasks/Component/Costume`文件夹下面新建一个你的这个庭院皮肤文件夹比如`mainxxx`
+
+2. 在你的文件夹下面新增一个`image.json`,启动`gui.py`对应工具添加对应的assets
+
+   **很重要很重要,你不要乱划动庭院,如果你留意到游戏在你的停留位置是默认的**
+
+   **在你生成之前需要点击探索然后在回来、再点击町中然后回来,确保你的当前的位置的默认的**
+
+   你需要生成如下的assets:
+
+   - check_main_xxx:   这张图片用来判断是否在庭院的
+   - main_goto_exploration_xxx:  这张图片是用来点击"探索"图标的
+   - main_goto_summon_xxx:  这张图片是用来点击 ”召唤“
+   - main_goto_town_xxx:   町中知道吧
+   - pet_house_xxx:  进入宠物屋
+
+3. 执行`./dev_tools/assets_extract.py`这个将会更新`./tasks/Component/Costume/assets.py` 你不需要手动修改这个文件
+
+4. 好了你现在以及输出你这个庭院皮肤的assets了,下面是为其加入 OAS 中
+
+5. 打开`./tasks/Component/Costume/config.py`看到类似这种的,照着填进去
+
+   ```python
+   COSTUME_MAIN_2 = 'costume_main_2'  # 琼夜淬光
+   ```
+
+6. 打开`./tasks/Component/Costume/costume_base.py`看到类似这种的,照着填进去。
+
+   解释一下,`COSTUME_MAIN_2` 是你刚刚定义的一个庭院类型,后面的第一个key就是原先的assets, 后面的value就是你刚刚输出的要替换的原先的assets。具体的值在`assets.py`文件有定义。照着填没毛病吧。
+
+   ```python
+   MainType.COSTUME_MAIN_2: {'I_CHECK_MAIN': 'I_CHECK_MAIN_1',
+                                 'I_MAIN_GOTO_EXPLORATION': 'I_MAIN_GOTO_EXPLORATION_1',
+                                 'I_MAIN_GOTO_SUMMON': 'I_MAIN_GOTO_SUMMON_1',
+                                 'I_MAIN_GOTO_TOWN': 'I_MAIN_GOTO_TOWN_1',
+                                 'I_PET_HOUSE': 'I_PET_HOUSE_1', },
+   ```
+
+7. 完事之后,你需要测试一下。执行`./tasks/Component/Costume/costume_test.py` 这个文件。
+
+   **在测试之前你需要打开一次 OASX 修改你对应的庭院皮肤的选项**
+
+8. 完事啦???哪有那么简单,你没有发现打开 OASX 的时候发现你的选项还是 `costume_main_xxx` 这种吗。你还需要添加一个翻译,[点击这儿](https://runhey.github.io/OnmyojiAutoScript-website/docs/development/user-option#7翻译)

+ 116 - 0
tasks/Component/Costume/assets.py

@@ -0,0 +1,116 @@
+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 ./dev_tools/assets_extract.py.
+# Don't modify it manually.
+class CostumeAssets: 
+
+
+	# Image Rule Assets
+	# description 
+	I_CHECK_MAIN_1 = RuleImage(roi_front=(1049,146,48,55), roi_back=(880,119,271,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main1/main1_check_main_1.png")
+	# description 
+	I_MAIN_GOTO_EXPLORATION_1 = RuleImage(roi_front=(486,148,50,54), roi_back=(282,127,441,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main1/main1_main_goto_exploration_1.png")
+	# description 
+	I_MAIN_GOTO_SUMMON_1 = RuleImage(roi_front=(818,206,32,37), roi_back=(634,175,388,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main1/main1_main_goto_summon_1.png")
+	# description 
+	I_MAIN_GOTO_TOWN_1 = RuleImage(roi_front=(567,340,36,60), roi_back=(474,325,240,86), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main1/main1_main_goto_town_1.png")
+	# description 
+	I_PET_HOUSE_1 = RuleImage(roi_front=(1250,439,25,26), roi_back=(1198,362,81,147), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main1/main1_pet_house_1.png")
+
+
+	# Image Rule Assets
+	# description 
+	I_CHECK_MAIN_2 = RuleImage(roi_front=(1090,146,48,55), roi_back=(880,108,271,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main2/main2_check_main_2.png")
+	# description 
+	I_MAIN_GOTO_EXPLORATION_2 = RuleImage(roi_front=(749,197,50,54), roi_back=(506,166,441,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main2/main2_main_goto_exploration_2.png")
+	# 不知道为什么有的时候这个会有一个蝴蝶在上面飞 
+	I_MAIN_GOTO_SUMMON_2 = RuleImage(roi_front=(975,238,85,45), roi_back=(752,208,408,100), threshold=0.6, method="Template matching", file="./tasks/Component/Costume/main2/main2_main_goto_summon_2.png")
+	# description 
+	I_MAIN_GOTO_TOWN_2 = RuleImage(roi_front=(783,328,47,60), roi_back=(608,310,398,86), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main2/main2_main_goto_town_2.png")
+	# description 
+	I_PET_HOUSE_2 = RuleImage(roi_front=(1243,458,29,40), roi_back=(1198,396,81,147), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main2/main2_pet_house_2.png")
+
+
+	# Image Rule Assets
+	# description 
+	I_CHECK_MAIN_3 = RuleImage(roi_front=(390,122,48,55), roi_back=(149,108,1002,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main3/main3_check_main_3.png")
+	# description 
+	I_MAIN_GOTO_EXPLORATION_3 = RuleImage(roi_front=(785,127,50,54), roi_back=(413,113,847,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main3/main3_main_goto_exploration_3.png")
+	#  
+	I_MAIN_GOTO_SUMMON_3 = RuleImage(roi_front=(1072,165,50,62), roi_back=(589,146,659,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main3/main3_main_goto_summon_3.png")
+	# description 
+	I_MAIN_GOTO_TOWN_3 = RuleImage(roi_front=(659,263,47,60), roi_back=(512,242,555,86), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main3/main3_main_goto_town_3.png")
+	# description 
+	I_PET_HOUSE_3 = RuleImage(roi_front=(1136,423,29,40), roi_back=(1038,409,241,73), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main3/main3_pet_house_3.png")
+
+
+	# Image Rule Assets
+	# description 
+	I_CHECK_MAIN_4 = RuleImage(roi_front=(513,139,48,55), roi_back=(149,108,1068,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main4/main4_check_main_4.png")
+	# description 
+	I_MAIN_GOTO_EXPLORATION_4 = RuleImage(roi_front=(434,233,43,56), roi_back=(148,201,847,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main4/main4_main_goto_exploration_4.png")
+	#  
+	I_MAIN_GOTO_SUMMON_4 = RuleImage(roi_front=(959,215,41,62), roi_back=(556,187,659,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main4/main4_main_goto_summon_4.png")
+	# description 
+	I_MAIN_GOTO_TOWN_4 = RuleImage(roi_front=(814,242,47,60), roi_back=(524,228,555,82), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main4/main4_main_goto_town_4.png")
+	# description 
+	I_PET_HOUSE_4 = RuleImage(roi_front=(977,387,29,40), roi_back=(922,371,241,73), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main4/main4_pet_house_4.png")
+
+
+	# Image Rule Assets
+	# description 
+	I_CHECK_MAIN_5 = RuleImage(roi_front=(760,119,240,55), roi_back=(149,108,1068,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main5/main5_check_main_5.png")
+	# description 
+	I_MAIN_GOTO_EXPLORATION_5 = RuleImage(roi_front=(633,107,46,79), roi_back=(278,101,847,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main5/main5_main_goto_exploration_5.png")
+	#  
+	I_MAIN_GOTO_SUMMON_5 = RuleImage(roi_front=(1072,171,58,62), roi_back=(532,151,659,100), threshold=0.7, method="Template matching", file="./tasks/Component/Costume/main5/main5_main_goto_summon_5.png")
+	# description 
+	I_MAIN_GOTO_TOWN_5 = RuleImage(roi_front=(871,281,60,51), roi_back=(524,261,555,82), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main5/main5_main_goto_town_5.png")
+	# description 
+	I_PET_HOUSE_5 = RuleImage(roi_front=(1135,533,29,40), roi_back=(1008,512,241,73), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main5/main5_pet_house_5.png")
+
+
+	# Image Rule Assets
+	# description 
+	I_CHECK_MAIN_6 = RuleImage(roi_front=(760,119,240,66), roi_back=(149,108,1068,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main6/main6_check_main_6.png")
+	# description 
+	I_MAIN_GOTO_EXPLORATION_6 = RuleImage(roi_front=(535,150,46,79), roi_back=(237,136,904,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main6/main6_main_goto_exploration_6.png")
+	#  
+	I_MAIN_GOTO_SUMMON_6 = RuleImage(roi_front=(1123,250,43,62), roi_back=(601,232,669,100), threshold=0.7, method="Template matching", file="./tasks/Component/Costume/main6/main6_main_goto_summon_6.png")
+	# description 
+	I_MAIN_GOTO_TOWN_6 = RuleImage(roi_front=(535,378,60,61), roi_back=(313,365,666,82), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main6/main6_main_goto_town_6.png")
+	# description 
+	I_PET_HOUSE_6 = RuleImage(roi_front=(1101,516,29,40), roi_back=(987,497,241,73), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main6/main6_pet_house_6.png")
+
+
+	# Image Rule Assets
+	# description 
+	I_CHECK_MAIN_7 = RuleImage(roi_front=(843,116,240,64), roi_back=(149,108,1078,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main7/main7_check_main_7.png")
+	# description 
+	I_MAIN_GOTO_EXPLORATION_7 = RuleImage(roi_front=(653,150,47,79), roi_back=(237,137,904,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main7/main7_main_goto_exploration_7.png")
+	#  
+	I_MAIN_GOTO_SUMMON_7 = RuleImage(roi_front=(1110,264,43,59), roi_back=(701,232,779,100), threshold=0.7, method="Template matching", file="./tasks/Component/Costume/main7/main7_main_goto_summon_7.png")
+	# description 
+	I_MAIN_GOTO_TOWN_7 = RuleImage(roi_front=(712,314,56,51), roi_back=(300,295,777,82), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main7/main7_main_goto_town_7.png")
+	# description 
+	I_PET_HOUSE_7 = RuleImage(roi_front=(1163,468,50,40), roi_back=(1033,444,241,73), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main7/main7_pet_house_7.png")
+
+
+	# Image Rule Assets
+	# description 
+	I_CHECK_MAIN_8 = RuleImage(roi_front=(843,116,240,64), roi_back=(149,108,1088,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main8/main8_check_main_8.png")
+	# description 
+	I_MAIN_GOTO_EXPLORATION_8 = RuleImage(roi_front=(665,141,59,61), roi_back=(239,125,904,100), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main8/main8_main_goto_exploration_8.png")
+	#  
+	I_MAIN_GOTO_SUMMON_8 = RuleImage(roi_front=(1236,212,39,62), roi_back=(1085,192,194,119), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main8/main8_main_goto_summon_8.png")
+	# description 
+	I_MAIN_GOTO_TOWN_8 = RuleImage(roi_front=(671,434,56,51), roi_back=(308,409,888,82), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main8/main8_main_goto_town_8.png")
+	# description 
+	I_PET_HOUSE_8 = RuleImage(roi_front=(1110,499,50,40), roi_back=(1033,469,241,83), threshold=0.8, method="Template matching", file="./tasks/Component/Costume/main8/main8_pet_house_8.png")
+
+

+ 59 - 0
tasks/Component/Costume/config.py

@@ -0,0 +1,59 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from pydantic import BaseModel, Field
+from enum import Enum
+
+# 庭院皮肤
+class MainType(str, Enum):
+    COSTUME_MAIN = 'costume_main'  # 初语谧景
+    COSTUME_MAIN_1 = 'costume_main_1'  # 织梦莲庭
+    COSTUME_MAIN_2 = 'costume_main_2'  # 琼夜淬光
+    COSTUME_MAIN_3 = 'costume_main_3'  # 烬夜韶阁
+    COSTUME_MAIN_4 = 'costume_main_4'  # 笔墨山河
+    COSTUME_MAIN_5 = 'costume_main_5'  # 枫色秋庭
+    COSTUME_MAIN_6 = 'costume_main_6'  # 暖池青苑
+    COSTUME_MAIN_7 = 'costume_main_7'  # 盛夏幽庭
+    COSTUME_MAIN_8 = 'costume_main_8'  # 远海航船
+
+# 结界皮肤
+class RealmType(str, Enum):
+    COSTUME_REALM_DEFAULT = 'costume_realm_default'  # 妖扇结界
+    COSTUME_REALM_1 = 'costume_realm_1'  # 鬼灵咒符
+    COSTUME_REALM_2 = 'costume_realm_2'  # 狐梦之乡
+    COSTUME_REALM_3 = 'costume_realm_3'  # 编心织忆
+    COSTUME_REALM_4 = 'costume_realm_4'  # 花海繁生
+
+# 主题,就是庭院最右下角的展开按钮
+class ThemeType(str, Enum):
+    COSTUME_THEME_DEFAULT = 'costume_theme_default'  # 伊始之卷
+
+# 幕间,就是式神录这里
+class ShikigamiType(str, Enum):
+    COSTUME_SHIKIGAMI_DEFAULT = 'costume_shikigami_default'  # 静栖走廊
+
+# 签到主题
+class SignType(str, Enum):
+    COSTUME_SIGN_DEFAULT = 'costume_sign_default'  # 默认
+
+# 战斗主题
+class BattleType(str, Enum):
+    COSTUME_BATTLE_DEFAULT = 'costume_battle_default'  # 默认
+
+
+
+class CostumeConfig(BaseModel):
+    # 皮肤配置
+    costume_main_type: MainType = Field(default=MainType.COSTUME_MAIN, description='costume_main_type_help')
+    costume_realm_type: RealmType = Field(default=RealmType.COSTUME_REALM_DEFAULT, description='costume_realm_type_help')
+    costume_theme_type: ThemeType = Field(default=ThemeType.COSTUME_THEME_DEFAULT, description='costume_theme_type_help')
+    costume_shikigami_type: ShikigamiType = Field(default=ShikigamiType.COSTUME_SHIKIGAMI_DEFAULT, description='costume_shikigami_type_help')
+    costume_sign_type: SignType = Field(default=SignType.COSTUME_SIGN_DEFAULT, description='costume_sign_type_help')
+    costume_battle_type: BattleType = Field(default=BattleType.COSTUME_BATTLE_DEFAULT, description='costume_battle_type_help')
+
+
+
+
+
+
+

+ 98 - 0
tasks/Component/Costume/costume_base.py

@@ -0,0 +1,98 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+
+from module.atom.image import RuleImage
+
+from tasks.Component.Costume.config import (MainType, CostumeConfig, RealmType,
+                                            ThemeType, ShikigamiType, SignType, BattleType)
+from tasks.Component.Costume.assets import CostumeAssets
+from tasks.Component.CostumeRealm.assets import CostumeRealmAssets
+
+# 庭院皮肤
+main_costume_model = {
+    MainType.COSTUME_MAIN_1: {'I_CHECK_MAIN': 'I_CHECK_MAIN_1',
+                              'I_MAIN_GOTO_EXPLORATION': 'I_MAIN_GOTO_EXPLORATION_1',
+                              'I_MAIN_GOTO_SUMMON': 'I_MAIN_GOTO_SUMMON_1',
+                              'I_MAIN_GOTO_TOWN': 'I_MAIN_GOTO_TOWN_1',
+                              'I_PET_HOUSE': 'I_PET_HOUSE_1', },
+    MainType.COSTUME_MAIN_2: {'I_CHECK_MAIN': 'I_CHECK_MAIN_2',
+                              'I_MAIN_GOTO_EXPLORATION': 'I_MAIN_GOTO_EXPLORATION_2',
+                              'I_MAIN_GOTO_SUMMON': 'I_MAIN_GOTO_SUMMON_2',
+                              'I_MAIN_GOTO_TOWN': 'I_MAIN_GOTO_TOWN_2',
+                              'I_PET_HOUSE': 'I_PET_HOUSE_2', },
+    MainType.COSTUME_MAIN_3: {'I_CHECK_MAIN': 'I_CHECK_MAIN_3',
+                              'I_MAIN_GOTO_EXPLORATION': 'I_MAIN_GOTO_EXPLORATION_3',
+                              'I_MAIN_GOTO_SUMMON': 'I_MAIN_GOTO_SUMMON_3',
+                              'I_MAIN_GOTO_TOWN': 'I_MAIN_GOTO_TOWN_3',
+                              'I_PET_HOUSE': 'I_PET_HOUSE_3', },
+    MainType.COSTUME_MAIN_4: {'I_CHECK_MAIN': 'I_CHECK_MAIN_4',
+                              'I_MAIN_GOTO_EXPLORATION': 'I_MAIN_GOTO_EXPLORATION_4',
+                              'I_MAIN_GOTO_SUMMON': 'I_MAIN_GOTO_SUMMON_4',
+                              'I_MAIN_GOTO_TOWN': 'I_MAIN_GOTO_TOWN_4',
+                              'I_PET_HOUSE': 'I_PET_HOUSE_4', },
+    MainType.COSTUME_MAIN_5: {'I_CHECK_MAIN': 'I_CHECK_MAIN_5',
+                              'I_MAIN_GOTO_EXPLORATION': 'I_MAIN_GOTO_EXPLORATION_5',
+                              'I_MAIN_GOTO_SUMMON': 'I_MAIN_GOTO_SUMMON_5',
+                              'I_MAIN_GOTO_TOWN': 'I_MAIN_GOTO_TOWN_5',
+                              'I_PET_HOUSE': 'I_PET_HOUSE_5', },
+    MainType.COSTUME_MAIN_6: {'I_CHECK_MAIN': 'I_CHECK_MAIN_6',
+                              'I_MAIN_GOTO_EXPLORATION': 'I_MAIN_GOTO_EXPLORATION_6',
+                              'I_MAIN_GOTO_SUMMON': 'I_MAIN_GOTO_SUMMON_6',
+                              'I_MAIN_GOTO_TOWN': 'I_MAIN_GOTO_TOWN_6',
+                              'I_PET_HOUSE': 'I_PET_HOUSE_6', },
+    MainType.COSTUME_MAIN_7: {'I_CHECK_MAIN': 'I_CHECK_MAIN_7',
+                              'I_MAIN_GOTO_EXPLORATION': 'I_MAIN_GOTO_EXPLORATION_7',
+                              'I_MAIN_GOTO_SUMMON': 'I_MAIN_GOTO_SUMMON_7',
+                              'I_MAIN_GOTO_TOWN': 'I_MAIN_GOTO_TOWN_7',
+                              'I_PET_HOUSE': 'I_PET_HOUSE_7', },
+    MainType.COSTUME_MAIN_8: {'I_CHECK_MAIN': 'I_CHECK_MAIN_8',
+                              'I_MAIN_GOTO_EXPLORATION': 'I_MAIN_GOTO_EXPLORATION_8',
+                              'I_MAIN_GOTO_SUMMON': 'I_MAIN_GOTO_SUMMON_8',
+                              'I_MAIN_GOTO_TOWN': 'I_MAIN_GOTO_TOWN_8',
+                              'I_PET_HOUSE': 'I_PET_HOUSE_8', },
+}
+
+# 结界皮肤
+realm_costume_model = {
+    RealmType.COSTUME_REALM_1: {'I_SHI_CARD': 'I_SHI_CARD_1',
+                                'I_SHI_DEFENSE': 'I_SHI_DEFENSE_1',},
+}
+
+class CostumeBase:
+
+    def check_costume(self, config: CostumeConfig):
+        self.check_costume_main(config.costume_main_type)
+        self.check_costume_realm(config.costume_realm_type)
+
+    def replace_img(self, asset_before: str, asset_after: RuleImage):
+        if not hasattr(self, asset_before):
+            return
+        # setattr(self, asset_before, asset_after)
+        asset_before_object: RuleImage = getattr(self, asset_before)
+        asset_before_object.roi_front = asset_after.roi_front
+        asset_before_object.roi_back = asset_after.roi_back
+        asset_before_object.threshold = asset_after.threshold
+        asset_before_object.file = asset_after.file
+
+    def check_costume_main(self, main_type: MainType):
+        if main_type == MainType.COSTUME_MAIN:
+            return
+        costume_assets = CostumeAssets()
+        for key, value in main_costume_model[main_type].items():
+            assert_value: RuleImage = getattr(costume_assets, value)
+            self.replace_img(key, assert_value)
+
+    def check_costume_realm(self, realm_type: RealmType):
+        if realm_type == RealmType.COSTUME_REALM_DEFAULT:
+            return
+        costume_realm_assets = CostumeRealmAssets()
+        for key, value in realm_costume_model[realm_type].items():
+            assert_value: RuleImage = getattr(costume_realm_assets, value)
+            self.replace_img(key, assert_value)
+
+
+
+if __name__ == '__main__':
+    c = CostumeBase()
+    c.check_costume_main(MainType.COSTUME_MAIN_1)

+ 41 - 0
tasks/Component/Costume/costume_test.py

@@ -0,0 +1,41 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+
+from module.atom.image import RuleImage
+
+from tasks.GameUi.assets import GameUiAssets
+from tasks.GameUi.game_ui import GameUi
+from tasks.Component.GeneralBattle.general_battle import GeneralBattle
+from tasks.Component.SwitchSoul.switch_soul import SwitchSoul
+from tasks.Pets.assets import PetsAssets
+from tasks.base_task import BaseTask
+from module.logger import logger
+
+class ScriptTask(GeneralBattle, GameUi, SwitchSoul, PetsAssets, ):
+
+    def run(self):
+        # 探索测试
+        self.ui_click(self.I_MAIN_GOTO_EXPLORATION, self.I_CHECK_EXPLORATION)
+        self.ui_click(self.I_UI_BACK_BLUE, self.I_CHECK_MAIN)
+        # 町中测试
+        self.ui_click(self.I_MAIN_GOTO_TOWN, self.I_CHECK_TOWN)
+        self.ui_click(self.I_TOWN_GOTO_MAIN, self.I_CHECK_MAIN)
+        # 召唤测试
+        self.ui_click(self.I_MAIN_GOTO_SUMMON, self.I_CHECK_SUMMON)
+        self.ui_click(self.I_SUMMON_GOTO_MAIN, self.I_CHECK_MAIN)
+        # 宠物屋测试
+        self.ui_click(self.I_PET_HOUSE, self.I_PET_CLAW)
+        self.ui_click(self.I_PET_EXIT, self.I_CHECK_MAIN)
+        logger.info('Test Success')
+
+
+if __name__ == '__main__':
+    from module.config.config import Config
+    from module.device.device import Device
+
+    c = Config('oas1')
+    d = Device(c)
+    t = ScriptTask(c, d)
+    t.run()
+

+ 61 - 0
tasks/Component/Costume/costume_test_realm.py

@@ -0,0 +1,61 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+
+
+from module.logger import logger
+from module.base.timer import Timer
+
+from tasks.KekkaiActivation.script_task import ScriptTask as KekkaiActivationScriptTask
+
+class ScriptTask(KekkaiActivationScriptTask):
+
+    def run(self):
+
+        images_count = [[self.I_SHI_GROWN,     0],  # 式神育成
+                        [self.I_SHI_CARD,      0],  # 结界卡
+                        [self.I_SHI_DEFENSE,   0],  # 结界防守
+                        [self.I_REALM_SHIN,    0],  # 结界皮肤
+                        # 下面是测试的时候不一定有的, 但是这三个运行一段时间后应该会有
+                        [self.I_CARD_EXP,      0],  # 收取经验(没有满的图)
+                        [self.I_BOX_AP,        0],  # 收取体力(没有满的图)
+                        [self.I_BOX_EXP,       0],  # 收取盒子经验(没有满)
+                        # 下面两个才是很难有
+                        [self.I_BOX_EXP_MAX,   0],  # 收取盒子经验(经验满)
+                        [self.I_UTILIZE_EXP,   0],  # 收取寄养别人的经验
+                        ]
+
+        logger.hr('Costume Test Start')
+        timer = Timer(5)
+        timer.start()
+        while 1:
+            self.screenshot()
+            logger.info('Detecting images...')
+
+            for i in images_count:
+                if self.appear(i[0]):
+                    i[1] += 1
+                    # logger.info('Find image %s %d times' % (i[0], i[1]))
+
+            if timer.reached():
+                # 五秒测试结束
+                logger.info('Five seconds test over')
+                break
+
+        logger.info('--------------------------------------------------------')
+        logger.info('%-20s   %s' % ('Image', 'Count'))
+        for i in images_count:
+            logger.info('%-20s %3d times' % (i[0], i[1]))
+        logger.info('Test Done')
+
+
+if __name__ == '__main__':
+    from module.config.config import Config
+    from module.device.device import Device
+
+    c = Config('oas1')
+    d = Device(c)
+    t = ScriptTask(c, d)
+    t.run()
+
+

+ 47 - 0
tasks/Component/Costume/main1/image.json

@@ -0,0 +1,47 @@
+[
+  {
+    "itemName": "check_main_1",
+    "imageName": "main1_check_main_1.png",
+    "roiFront": "1049,146,48,55",
+    "roiBack": "880,119,271,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_exploration_1",
+    "imageName": "main1_main_goto_exploration_1.png",
+    "roiFront": "486,148,50,54",
+    "roiBack": "282,127,441,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_summon_1",
+    "imageName": "main1_main_goto_summon_1.png",
+    "roiFront": "818,206,32,37",
+    "roiBack": "634,175,388,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_town_1",
+    "imageName": "main1_main_goto_town_1.png",
+    "roiFront": "567,340,36,60",
+    "roiBack": "474,325,240,86",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "pet_house_1",
+    "imageName": "main1_pet_house_1.png",
+    "roiFront": "1250,439,25,26",
+    "roiBack": "1198,362,81,147",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/Component/Costume/main1/image_name.png


BIN
tasks/Component/Costume/main1/main1_check_main_1.png


BIN
tasks/Component/Costume/main1/main1_main_goto_exploration_1.png


BIN
tasks/Component/Costume/main1/main1_main_goto_summon_1.png


BIN
tasks/Component/Costume/main1/main1_main_goto_town_1.png


BIN
tasks/Component/Costume/main1/main1_pet_house_1.png


+ 47 - 0
tasks/Component/Costume/main2/image.json

@@ -0,0 +1,47 @@
+[
+  {
+    "itemName": "check_main_2",
+    "imageName": "main2_check_main_2.png",
+    "roiFront": "1090,146,48,55",
+    "roiBack": "880,108,271,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_exploration_2",
+    "imageName": "main2_main_goto_exploration_2.png",
+    "roiFront": "749,197,50,54",
+    "roiBack": "506,166,441,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_summon_2",
+    "imageName": "main2_main_goto_summon_2.png",
+    "roiFront": "975,238,85,45",
+    "roiBack": "752,208,408,100",
+    "method": "Template matching",
+    "threshold": 0.6,
+    "description": "不知道为什么有的时候这个会有一个蝴蝶在上面飞"
+  },
+  {
+    "itemName": "main_goto_town_2",
+    "imageName": "main2_main_goto_town_2.png",
+    "roiFront": "783,328,47,60",
+    "roiBack": "608,310,398,86",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "pet_house_2",
+    "imageName": "main2_pet_house_2.png",
+    "roiFront": "1243,458,29,40",
+    "roiBack": "1198,396,81,147",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/Component/Costume/main2/main2_check_main_2.png


BIN
tasks/Component/Costume/main2/main2_main_goto_exploration_2.png


BIN
tasks/Component/Costume/main2/main2_main_goto_summon_2.png


BIN
tasks/Component/Costume/main2/main2_main_goto_town_2.png


BIN
tasks/Component/Costume/main2/main2_pet_house_2.png


+ 47 - 0
tasks/Component/Costume/main3/image.json

@@ -0,0 +1,47 @@
+[
+  {
+    "itemName": "check_main_3",
+    "imageName": "main3_check_main_3.png",
+    "roiFront": "390,122,48,55",
+    "roiBack": "149,108,1002,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_exploration_3",
+    "imageName": "main3_main_goto_exploration_3.png",
+    "roiFront": "785,127,50,54",
+    "roiBack": "413,113,847,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_summon_3",
+    "imageName": "main3_main_goto_summon_3.png",
+    "roiFront": "1072,165,50,62",
+    "roiBack": "589,146,659,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": ""
+  },
+  {
+    "itemName": "main_goto_town_3",
+    "imageName": "main3_main_goto_town_3.png",
+    "roiFront": "659,263,47,60",
+    "roiBack": "512,242,555,86",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "pet_house_3",
+    "imageName": "main3_pet_house_3.png",
+    "roiFront": "1136,423,29,40",
+    "roiBack": "1038,409,241,73",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/Component/Costume/main3/main3_check_main_3.png


BIN
tasks/Component/Costume/main3/main3_main_goto_exploration_3.png


BIN
tasks/Component/Costume/main3/main3_main_goto_summon_3.png


BIN
tasks/Component/Costume/main3/main3_main_goto_town_3.png


BIN
tasks/Component/Costume/main3/main3_pet_house_3.png


+ 47 - 0
tasks/Component/Costume/main4/image.json

@@ -0,0 +1,47 @@
+[
+  {
+    "itemName": "check_main_4",
+    "imageName": "main4_check_main_4.png",
+    "roiFront": "513,139,48,55",
+    "roiBack": "149,108,1068,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_exploration_4",
+    "imageName": "main4_main_goto_exploration_4.png",
+    "roiFront": "434,233,43,56",
+    "roiBack": "148,201,847,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_summon_4",
+    "imageName": "main4_main_goto_summon_4.png",
+    "roiFront": "959,215,41,62",
+    "roiBack": "556,187,659,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": ""
+  },
+  {
+    "itemName": "main_goto_town_4",
+    "imageName": "main4_main_goto_town_4.png",
+    "roiFront": "814,242,47,60",
+    "roiBack": "524,228,555,82",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "pet_house_4",
+    "imageName": "main4_pet_house_4.png",
+    "roiFront": "977,387,29,40",
+    "roiBack": "922,371,241,73",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/Component/Costume/main4/main4_check_main_4.png


BIN
tasks/Component/Costume/main4/main4_main_goto_exploration_4.png


BIN
tasks/Component/Costume/main4/main4_main_goto_summon_4.png


BIN
tasks/Component/Costume/main4/main4_main_goto_town_4.png


BIN
tasks/Component/Costume/main4/main4_pet_house_4.png


+ 47 - 0
tasks/Component/Costume/main5/image.json

@@ -0,0 +1,47 @@
+[
+  {
+    "itemName": "check_main_5",
+    "imageName": "main5_check_main_5.png",
+    "roiFront": "760,119,240,55",
+    "roiBack": "149,108,1068,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_exploration_5",
+    "imageName": "main5_main_goto_exploration_5.png",
+    "roiFront": "633,107,46,79",
+    "roiBack": "278,101,847,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_summon_5",
+    "imageName": "main5_main_goto_summon_5.png",
+    "roiFront": "1072,171,58,62",
+    "roiBack": "532,151,659,100",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": ""
+  },
+  {
+    "itemName": "main_goto_town_5",
+    "imageName": "main5_main_goto_town_5.png",
+    "roiFront": "871,281,60,51",
+    "roiBack": "524,261,555,82",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "pet_house_5",
+    "imageName": "main5_pet_house_5.png",
+    "roiFront": "1135,533,29,40",
+    "roiBack": "1008,512,241,73",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/Component/Costume/main5/main5_check_main_5.png


BIN
tasks/Component/Costume/main5/main5_main_goto_exploration_5.png


BIN
tasks/Component/Costume/main5/main5_main_goto_summon_5.png


BIN
tasks/Component/Costume/main5/main5_main_goto_town_5.png


BIN
tasks/Component/Costume/main5/main5_pet_house_5.png


+ 47 - 0
tasks/Component/Costume/main6/image.json

@@ -0,0 +1,47 @@
+[
+  {
+    "itemName": "check_main_6",
+    "imageName": "main6_check_main_6.png",
+    "roiFront": "760,119,240,66",
+    "roiBack": "149,108,1068,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_exploration_6",
+    "imageName": "main6_main_goto_exploration_6.png",
+    "roiFront": "535,150,46,79",
+    "roiBack": "237,136,904,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_summon_6",
+    "imageName": "main6_main_goto_summon_6.png",
+    "roiFront": "1123,250,43,62",
+    "roiBack": "601,232,669,100",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": ""
+  },
+  {
+    "itemName": "main_goto_town_6",
+    "imageName": "main6_main_goto_town_6.png",
+    "roiFront": "535,378,60,61",
+    "roiBack": "313,365,666,82",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "pet_house_6",
+    "imageName": "main6_pet_house_6.png",
+    "roiFront": "1101,516,29,40",
+    "roiBack": "987,497,241,73",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/Component/Costume/main6/main6_check_main_6.png


BIN
tasks/Component/Costume/main6/main6_main_goto_exploration_6.png


BIN
tasks/Component/Costume/main6/main6_main_goto_summon_6.png


BIN
tasks/Component/Costume/main6/main6_main_goto_town_6.png


BIN
tasks/Component/Costume/main6/main6_pet_house_6.png


+ 47 - 0
tasks/Component/Costume/main7/image.json

@@ -0,0 +1,47 @@
+[
+  {
+    "itemName": "check_main_7",
+    "imageName": "main7_check_main_7.png",
+    "roiFront": "843,116,240,64",
+    "roiBack": "149,108,1078,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_exploration_7",
+    "imageName": "main7_main_goto_exploration_7.png",
+    "roiFront": "653,150,47,79",
+    "roiBack": "237,137,904,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_summon_7",
+    "imageName": "main7_main_goto_summon_7.png",
+    "roiFront": "1110,264,43,59",
+    "roiBack": "701,232,779,100",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": ""
+  },
+  {
+    "itemName": "main_goto_town_7",
+    "imageName": "main7_main_goto_town_7.png",
+    "roiFront": "712,314,56,51",
+    "roiBack": "300,295,777,82",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "pet_house_7",
+    "imageName": "main7_pet_house_7.png",
+    "roiFront": "1163,468,50,40",
+    "roiBack": "1033,444,241,73",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/Component/Costume/main7/main7_check_main_7.png


BIN
tasks/Component/Costume/main7/main7_main_goto_exploration_7.png


BIN
tasks/Component/Costume/main7/main7_main_goto_summon_7.png


BIN
tasks/Component/Costume/main7/main7_main_goto_town_7.png


BIN
tasks/Component/Costume/main7/main7_pet_house_7.png


+ 47 - 0
tasks/Component/Costume/main8/image.json

@@ -0,0 +1,47 @@
+[
+  {
+    "itemName": "check_main_8",
+    "imageName": "main8_check_main_8.png",
+    "roiFront": "843,116,240,64",
+    "roiBack": "149,108,1088,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_exploration_8",
+    "imageName": "main8_main_goto_exploration_8.png",
+    "roiFront": "665,141,59,61",
+    "roiBack": "239,125,904,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "main_goto_summon_8",
+    "imageName": "main8_main_goto_summon_8.png",
+    "roiFront": "1236,212,39,62",
+    "roiBack": "1085,192,194,119",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": ""
+  },
+  {
+    "itemName": "main_goto_town_8",
+    "imageName": "main8_main_goto_town_8.png",
+    "roiFront": "671,434,56,51",
+    "roiBack": "308,409,888,82",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "pet_house_8",
+    "imageName": "main8_pet_house_8.png",
+    "roiFront": "1110,499,50,40",
+    "roiBack": "1033,469,241,83",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/Component/Costume/main8/main8_check_main_8.png


BIN
tasks/Component/Costume/main8/main8_main_goto_exploration_8.png


BIN
tasks/Component/Costume/main8/main8_main_goto_summon_8.png


BIN
tasks/Component/Costume/main8/main8_main_goto_town_8.png


BIN
tasks/Component/Costume/main8/main8_pet_house_8.png


+ 19 - 0
tasks/Component/CostumeRealm/assets.py

@@ -0,0 +1,19 @@
+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 ./dev_tools/assets_extract.py.
+# Don't modify it manually.
+class CostumeRealmAssets: 
+
+
+	# Image Rule Assets
+	# description 
+	I_SHI_CARD_1 = RuleImage(roi_front=(919,295,36,66), roi_back=(868,238,141,150), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm1/realm1_shi_card_1.png")
+	# description 
+	I_SHI_DEFENSE_1 = RuleImage(roi_front=(308,294,35,100), roi_back=(197,241,247,207), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm1/realm1_shi_defense_1.png")
+
+

+ 20 - 0
tasks/Component/CostumeRealm/realm1/image.json

@@ -0,0 +1,20 @@
+[
+  {
+    "itemName": "shi_card_1",
+    "imageName": "realm1_shi_card_1.png",
+    "roiFront": "919,295,36,66",
+    "roiBack": "868,238,141,150",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "shi_defense_1",
+    "imageName": "realm1_shi_defense_1.png",
+    "roiFront": "308,294,35,100",
+    "roiBack": "197,241,247,207",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/Component/CostumeRealm/realm1/realm1_shi_card_1.png


BIN
tasks/Component/CostumeRealm/realm1/realm1_shi_defense_1.png


+ 2 - 3
tasks/DailyTrifles/script_task.py

@@ -89,7 +89,7 @@ class ScriptTask(GameUi, Summon, DailyTriflesAssets):
             self.ui_goto(page_main)
             return
 
-        if self.ui_get_reward(self.I_GIFT_SIGN):
+        if self.ui_get_reward(self.I_GIFT_SIGN, click_interval=2.5):
             logger.info('Get reward of gift sign')
 
         self.ui_click(self.I_UI_BACK_YELLOW, self.I_CHECK_MALL)
@@ -103,11 +103,10 @@ class ScriptTask(GameUi, Summon, DailyTriflesAssets):
 if __name__ == '__main__':
     from module.config.config import Config
     from module.device.device import Device
-    from memory_profiler import profile
 
     c = Config('oas1')
     d = Device(c)
     t = ScriptTask(c, d)
 
-    t.run_store_sign()
+    t.run()
 

+ 5 - 0
tasks/Exploration/script_task.py

@@ -231,6 +231,11 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, ExplorationAssets):
         # 自动添加候补式神
         if self.config.exploration.exploration_config.auto_rotate == AutoRotate.yes:
             self.enter_settings_and_do_operations()
+        
+        # 修复卡结算问题
+        # 卡结算是因为没有设置锁定队伍,修改后无论是否锁定都不会因为没有锁定队伍而卡在结算界面
+        if not self.config.exploration.general_battle_config.lock_team_enable:
+            self.config.exploration.general_battle_config.lock_team_enable = True
 
         # 进入战斗环节
         self.do_battle()

+ 2 - 0
tasks/GlobalGame/config.py

@@ -6,6 +6,7 @@ from pydantic import BaseModel, Field
 
 from tasks.GlobalGame.config_emergency import Emergency
 from tasks.Component.config_base import ConfigBase
+from tasks.Component.Costume.config import CostumeConfig
 
 class Transport(str, Enum):
     TCP = 'TCP'
@@ -24,5 +25,6 @@ class TeamFlow(BaseModel):
 
 class GlobalGame(BaseModel):
     emergency: Emergency = Field(default_factory=Emergency)
+    costume_config: CostumeConfig = Field(default_factory=CostumeConfig)
     team_flow: TeamFlow = Field(default_factory=TeamFlow)
 

BIN
tasks/KekkaiActivation/a/a_a_demount.png


BIN
tasks/KekkaiActivation/a/a_a_invite.png


+ 11 - 2
tasks/KekkaiActivation/a/image.json

@@ -83,8 +83,8 @@
   {
     "itemName": "a_invite",
     "imageName": "a_a_invite.png",
-    "roiFront": "1040,552,100,100",
-    "roiBack": "1040,552,100,100",
+    "roiFront": "1045,559,100,100",
+    "roiBack": "1014,538,182,162",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "邀请"
@@ -196,5 +196,14 @@
     "method": "Template matching",
     "threshold": 0.7,
     "description": "太阴3"
+  },
+  {
+    "itemName": "a_demount",
+    "imageName": "a_a_demount.png",
+    "roiFront": "939,575,55,47",
+    "roiBack": "903,551,107,91",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "卸下"
   }
 ]

+ 8 - 6
tasks/KekkaiActivation/assets.py

@@ -19,7 +19,7 @@ class KekkaiActivationAssets:
 
 	# Ocr Rule Assets
 	# 这张卡一共有多少小时 
-	O_CARD_ALL_TIME = RuleOcr(roi=(926,262,95,31), area=(926,262,95,31), mode="Single", method="Default", keyword="", name="card_all_time")
+	O_CARD_ALL_TIME = RuleOcr(roi=(926,262,95,31), area=(926,262,95,31), mode="Duration", method="Default", keyword="", name="card_all_time")
 
 
 	# Swipe Rule Assets
@@ -47,7 +47,7 @@ class KekkaiActivationAssets:
 	# 其他变异 
 	I_A_CARD_OTHER = RuleImage(roi_front=(353,502,173,61), roi_back=(353,502,173,61), threshold=0.9, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_card_other.png")
 	# 邀请 
-	I_A_INVITE = RuleImage(roi_front=(1040,552,100,100), roi_back=(1040,552,100,100), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_invite.png")
+	I_A_INVITE = RuleImage(roi_front=(1045,559,100,100), roi_back=(1014,538,182,162), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_invite.png")
 	# 自动邀请 
 	I_A_AUTO_INVITE = RuleImage(roi_front=(1071,456,53,51), roi_back=(1071,456,53,51), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_auto_invite.png")
 	# description 
@@ -72,17 +72,19 @@ class KekkaiActivationAssets:
 	I_A_HARVEST_FISH_6 = RuleImage(roi_front=(898,159,45,38), roi_back=(869,131,100,100), threshold=0.7, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_fish_6.png")
 	# 太阴3 
 	I_A_HARVEST_MOON_3 = RuleImage(roi_front=(897,159,46,40), roi_back=(869,127,100,100), threshold=0.7, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_harvest_moon_3.png")
+	# 卸下 
+	I_A_DEMOUNT = RuleImage(roi_front=(939,575,55,47), roi_back=(903,551,107,91), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/a/a_a_demount.png")
 
 
 	# Image Rule Assets
 	# description 
-	I_CARDS_KAIKO_6 = RuleImage(roi_front=(191,216,89,73), roi_back=(169,148,130,501), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/cards/cards_cards_kaiko_6.png")
+	I_CARDS_KAIKO_6 = RuleImage(roi_front=(193,192,89,73), roi_back=(169,148,130,501), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/cards/cards_cards_kaiko_6.png")
 	# description 
-	I_CARDS_KAIKO_5 = RuleImage(roi_front=(192,255,88,22), roi_back=(172,162,126,488), threshold=0.9, method="Template matching", file="./tasks/KekkaiActivation/cards/cards_cards_kaiko_5.png")
+	I_CARDS_KAIKO_5 = RuleImage(roi_front=(191,345,88,58), roi_back=(172,162,126,488), threshold=0.9, method="Template matching", file="./tasks/KekkaiActivation/cards/cards_cards_kaiko_5.png")
 	# description 
-	I_CARDS_KAIKO_4 = RuleImage(roi_front=(191,248,90,22), roi_back=(179,165,116,482), threshold=0.9, method="Template matching", file="./tasks/KekkaiActivation/cards/cards_cards_kaiko_4.png")
+	I_CARDS_KAIKO_4 = RuleImage(roi_front=(192,354,90,22), roi_back=(179,165,116,482), threshold=0.9, method="Template matching", file="./tasks/KekkaiActivation/cards/cards_cards_kaiko_4.png")
 	# description 
-	I_CARDS_KAIKO_3 = RuleImage(roi_front=(191,370,89,66), roi_back=(183,169,109,474), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/cards/cards_cards_kaiko_3.png")
+	I_CARDS_KAIKO_3 = RuleImage(roi_front=(192,187,89,66), roi_back=(183,169,109,474), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/cards/cards_cards_kaiko_3.png")
 	# description 
 	I_CARDS_FISH_6 = RuleImage(roi_front=(193,183,87,91), roi_back=(178,169,110,474), threshold=0.8, method="Template matching", file="./tasks/KekkaiActivation/cards/cards_cards_fish_6.png")
 	# description 

BIN
tasks/KekkaiActivation/cards/cards_cards_kaiko_3.png


BIN
tasks/KekkaiActivation/cards/cards_cards_kaiko_4.png


BIN
tasks/KekkaiActivation/cards/cards_cards_kaiko_5.png


BIN
tasks/KekkaiActivation/cards/cards_cards_kaiko_6.png


+ 8 - 8
tasks/KekkaiActivation/cards/image.json

@@ -2,7 +2,7 @@
   {
     "itemName": "cards_kaiko_6",
     "imageName": "cards_cards_kaiko_6.png",
-    "roiFront": "191,216,89,73",
+    "roiFront": "193,192,89,73",
     "roiBack": "169,148,130,501",
     "method": "Template matching",
     "threshold": 0.8,
@@ -11,25 +11,25 @@
   {
     "itemName": "cards_kaiko_5",
     "imageName": "cards_cards_kaiko_5.png",
-    "roiFront": "192,255,88,22",
+    "roiFront": "191,345,88,58",
     "roiBack": "172,162,126,488",
     "method": "Template matching",
-    "threshold": 0.90,
+    "threshold": 0.9,
     "description": "description"
   },
   {
     "itemName": "cards_kaiko_4",
     "imageName": "cards_cards_kaiko_4.png",
-    "roiFront": "191,248,90,22",
+    "roiFront": "192,354,90,22",
     "roiBack": "179,165,116,482",
     "method": "Template matching",
-    "threshold": 0.90,
+    "threshold": 0.9,
     "description": "description"
   },
   {
     "itemName": "cards_kaiko_3",
     "imageName": "cards_cards_kaiko_3.png",
-    "roiFront": "191,370,89,66",
+    "roiFront": "192,187,89,66",
     "roiBack": "183,169,109,474",
     "method": "Template matching",
     "threshold": 0.8,
@@ -50,7 +50,7 @@
     "roiFront": "192,358,88,21",
     "roiBack": "176,155,105,492",
     "method": "Template matching",
-    "threshold": 0.90,
+    "threshold": 0.9,
     "description": "description"
   },
   {
@@ -59,7 +59,7 @@
     "roiFront": "192,409,87,21",
     "roiBack": "176,175,118,473",
     "method": "Template matching",
-    "threshold": 0.90,
+    "threshold": 0.9,
     "description": "description"
   },
   {

+ 1 - 1
tasks/KekkaiActivation/ocr.json

@@ -3,7 +3,7 @@
     "itemName": "card_all_time",
     "roiFront": "926,262,95,31",
     "roiBack": "926,262,95,31",
-    "mode": "Single",
+    "mode": "Duration",
     "method": "Default",
     "keyword": "",
     "description": "这张卡一共有多少小时"

+ 8 - 2
tasks/KekkaiActivation/script_task.py

@@ -104,7 +104,12 @@ class ScriptTask(KU, KekkaiActivationAssets):
             # 不稳定太,等待动画结束
             if not card_status and not card_effect:
                 # 黄色的 ”激活“
-                if self.appear(self.I_A_ACTIVATE_YELLOW, threshold=0.99):
+                if self.appear(self.I_A_ACTIVATE_YELLOW, threshold=0.95):
+                    continue
+                if self.appear(self.I_A_DEMOUNT):
+                    # 现在在动画里面
+                    logger.info('Now in the animation')
+                    logger.info('Now there is no card')
                     continue
             # 如果这张卡生效着,在使用中
             if card_status and card_effect:
@@ -244,7 +249,7 @@ class ScriptTask(KU, KekkaiActivationAssets):
                 self.screenshot()
                 if self.appear(target_class):
                     break
-            if self.click(self.C_A_SELECT_CARD_LIST, interval=1):
+            if self.click(self.C_A_SELECT_CARD_LIST, interval=2.5):
                 continue
         logger.info('Appear card class: {}'.format(card_class))
         while 1:
@@ -262,6 +267,7 @@ class ScriptTask(KU, KekkaiActivationAssets):
             self.screenshot()
             current_best = self._current_select_best(card_best)
             if current_best is None:
+                logger.warning('There is no card in the list')
                 break
 
             if current_best == self.order_cards[0]:

+ 14 - 8
tasks/KekkaiUtilize/assets.py

@@ -29,19 +29,19 @@ class KekkaiUtilizeAssets:
 
 	# Image Rule Assets
 	# 育成 
-	I_SHI_GROWN = RuleImage(roi_front=(595,291,35,38), roi_back=(540,264,155,167), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_shi_grown.png")
+	I_SHI_GROWN = RuleImage(roi_front=(595,291,35,38), roi_back=(530,254,181,198), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_shi_grown.png")
 	# 结界卡 
-	I_SHI_CARD = RuleImage(roi_front=(886,290,44,56), roi_back=(806,271,183,128), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_shi_card.png")
+	I_SHI_CARD = RuleImage(roi_front=(886,290,44,56), roi_back=(801,259,215,175), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_shi_card.png")
 	# description 
-	I_SHI_DEFENSE = RuleImage(roi_front=(294,298,49,56), roi_back=(255,262,131,146), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_shi_defense.png")
+	I_SHI_DEFENSE = RuleImage(roi_front=(294,298,49,56), roi_back=(215,207,208,221), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_shi_defense.png")
 	# 收取经验(没有满的图) 
-	I_CARD_EXP = RuleImage(roi_front=(889,151,57,54), roi_back=(863,118,124,121), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_card_exp.png")
+	I_CARD_EXP = RuleImage(roi_front=(889,151,57,54), roi_back=(829,107,199,185), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_card_exp.png")
 	# 收取体力(没有满) 
-	I_BOX_AP = RuleImage(roi_front=(815,435,57,51), roi_back=(778,411,130,100), threshold=0.7, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_box_ap.png")
+	I_BOX_AP = RuleImage(roi_front=(815,435,57,51), roi_back=(744,336,202,204), threshold=0.7, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_box_ap.png")
 	# 收取盒子的经验(没有满) 
-	I_BOX_EXP = RuleImage(roi_front=(893,440,42,45), roi_back=(866,407,100,100), threshold=0.7, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_box_exp.png")
+	I_BOX_EXP = RuleImage(roi_front=(893,440,42,45), roi_back=(862,396,147,127), threshold=0.7, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_box_exp.png")
 	# 结界皮肤 
-	I_REALM_SHIN = RuleImage(roi_front=(175,460,54,58), roi_back=(147,443,100,100), threshold=0.9, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_realm_shin.png")
+	I_REALM_SHIN = RuleImage(roi_front=(175,460,54,58), roi_back=(22,380,393,308), threshold=0.9, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_realm_shin.png")
 	# 寄养别人的经验 
 	I_UTILIZE_EXP = RuleImage(roi_front=(583,144,58,43), roi_back=(531,112,156,123), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_utilize_exp.png")
 	# 取出 
@@ -49,7 +49,7 @@ class KekkaiUtilizeAssets:
 	# 提取 
 	I_EXP_EXTRACT = RuleImage(roi_front=(592,448,100,73), roi_back=(592,448,100,73), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_exp_extract.png")
 	# 盒子经验满 
-	I_BOX_EXP_MAX = RuleImage(roi_front=(886,425,61,64), roi_back=(886,425,61,64), threshold=0.7, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_box_exp_max.png")
+	I_BOX_EXP_MAX = RuleImage(roi_front=(889,430,61,64), roi_back=(829,372,228,186), threshold=0.7, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_box_exp_max.png")
 
 
 	# Image Rule Assets
@@ -104,6 +104,12 @@ class KekkaiUtilizeAssets:
 	I_U_MOON_3 = RuleImage(roi_front=(549,305,53,53), roi_back=(535,173,77,430), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/utilize/utilize_u_moon_3.png")
 	# description 
 	I_U_MOON_2 = RuleImage(roi_front=(552,313,46,44), roi_back=(542,174,81,437), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/utilize/utilize_u_moon_2.png")
+	# description 
+	I_CHECK_FRIEND_REALM_1 = RuleImage(roi_front=(1059,17,90,21), roi_back=(1050,4,107,65), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/utilize/utilize_check_friend_realm_1.png")
+	# description 
+	I_CHECK_FRIEND_REALM_2 = RuleImage(roi_front=(590,143,44,52), roi_back=(538,106,161,158), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/utilize/utilize_check_friend_realm_2.png")
+	# 好友寄养 
+	I_CHECK_FRIEND_REALM_3 = RuleImage(roi_front=(900,23,22,120), roi_back=(884,11,271,160), threshold=0.9, method="Template matching", file="./tasks/KekkaiUtilize/utilize/utilize_check_friend_realm_3.png")
 
 
 	# Ocr Rule Assets

+ 9 - 9
tasks/KekkaiUtilize/realm/image.json

@@ -3,7 +3,7 @@
     "itemName": "shi_grown",
     "imageName": "realm_shi_grown.png",
     "roiFront": "595,291,35,38",
-    "roiBack": "540,264,155,167",
+    "roiBack": "530,254,181,198",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "育成"
@@ -12,7 +12,7 @@
     "itemName": "shi_card",
     "imageName": "realm_shi_card.png",
     "roiFront": "886,290,44,56",
-    "roiBack": "806,271,183,128",
+    "roiBack": "801,259,215,175",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "结界卡"
@@ -21,7 +21,7 @@
     "itemName": "shi_defense",
     "imageName": "realm_shi_defense.png",
     "roiFront": "294,298,49,56",
-    "roiBack": "255,262,131,146",
+    "roiBack": "215,207,208,221",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -30,7 +30,7 @@
     "itemName": "card_exp",
     "imageName": "realm_card_exp.png",
     "roiFront": "889,151,57,54",
-    "roiBack": "863,118,124,121",
+    "roiBack": "829,107,199,185",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "收取经验(没有满的图)"
@@ -39,7 +39,7 @@
     "itemName": "box_ap",
     "imageName": "realm_box_ap.png",
     "roiFront": "815,435,57,51",
-    "roiBack": "778,411,130,100",
+    "roiBack": "744,336,202,204",
     "method": "Template matching",
     "threshold": 0.7,
     "description": "收取体力(没有满)"
@@ -48,7 +48,7 @@
     "itemName": "box_exp",
     "imageName": "realm_box_exp.png",
     "roiFront": "893,440,42,45",
-    "roiBack": "866,407,100,100",
+    "roiBack": "862,396,147,127",
     "method": "Template matching",
     "threshold": 0.7,
     "description": "收取盒子的经验(没有满)"
@@ -57,7 +57,7 @@
     "itemName": "realm_shin",
     "imageName": "realm_realm_shin.png",
     "roiFront": "175,460,54,58",
-    "roiBack": "147,443,100,100",
+    "roiBack": "22,380,393,308",
     "method": "Template matching",
     "threshold": 0.9,
     "description": "结界皮肤"
@@ -92,8 +92,8 @@
   {
     "itemName": "box_exp_max",
     "imageName": "realm_box_exp_max.png",
-    "roiFront": "886,425,61,64",
-    "roiBack": "886,425,61,64",
+    "roiFront": "889,430,61,64",
+    "roiBack": "829,372,228,186",
     "method": "Template matching",
     "threshold": 0.7,
     "description": "盒子经验满"

+ 8 - 5
tasks/KekkaiUtilize/script_task.py

@@ -406,13 +406,16 @@ class ScriptTask(GameUi, ReplaceShikigami, KekkaiUtilizeAssets):
             return
         while 1:
             self.screenshot()
-
-            if not self.appear(self.I_U_ENTER_REALM):
-                # 用不显示原按键来判断是否进入是很蠢的
-                time.sleep(0.5)
+            if self.appear(self.I_CHECK_FRIEND_REALM_1) \
+                    or self.appear(self.I_CHECK_FRIEND_REALM_3):
+                logger.info('Appear enter friend realm button')
                 break
 
-            if self.appear_then_click(self.I_U_ENTER_REALM, interval=1):
+            if self.appear_then_click(self.I_CHECK_FRIEND_REALM_2, interval=1.5):
+                logger.info('Click too fast to enter the friend\'s realm pool')
+                continue
+            if self.appear_then_click(self.I_U_ENTER_REALM, interval=2.5):
+                time.sleep(0.5)
                 continue
         logger.info('Enter friend realm')
 

+ 27 - 0
tasks/KekkaiUtilize/utilize/image_2.json

@@ -43,5 +43,32 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
+  },
+  {
+    "itemName": "check_friend_realm_1",
+    "imageName": "utilize_check_friend_realm_1.png",
+    "roiFront": "1059,17,90,21",
+    "roiBack": "1050,4,107,65",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "check_friend_realm_2",
+    "imageName": "utilize_check_friend_realm_2.png",
+    "roiFront": "590,143,44,52",
+    "roiBack": "538,106,161,158",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "check_friend_realm_3",
+    "imageName": "utilize_check_friend_realm_3.png",
+    "roiFront": "900,23,22,120",
+    "roiBack": "884,11,271,160",
+    "method": "Template matching",
+    "threshold": 0.9,
+    "description": "好友寄养"
   }
 ]

BIN
tasks/KekkaiUtilize/utilize/utilize_check_friend_realm_1.png


BIN
tasks/KekkaiUtilize/utilize/utilize_check_friend_realm_2.png


BIN
tasks/KekkaiUtilize/utilize/utilize_check_friend_realm_3.png


+ 2 - 2
tasks/Orochi/assets.py

@@ -16,9 +16,9 @@ class OrochiAssets:
 	# 组队 
 	I_FORM_TEAM = RuleImage(roi_front=(937,591,100,100), roi_back=(937,591,100,100), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_form_team.png")
 	# description 
-	I_OROCHI_LOCK = RuleImage(roi_front=(557,563,31,32), roi_back=(548,554,101,54), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_orochi_lock.png")
+	I_OROCHI_LOCK = RuleImage(roi_front=(575,561,22,26), roi_back=(548,546,109,62), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_orochi_lock.png")
 	# description 
-	I_OROCHI_UNLOCK = RuleImage(roi_front=(562,564,26,29), roi_back=(550,553,100,51), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_orochi_unlock.png")
+	I_OROCHI_UNLOCK = RuleImage(roi_front=(575,561,21,21), roi_back=(550,544,121,60), threshold=0.8, method="Template matching", file="./tasks/Orochi/o/o_orochi_unlock.png")
 	# 点击挑战 
 	I_OROCHI_FIRE = RuleImage(roi_front=(1095,577,131,124), roi_back=(1095,577,131,124), threshold=0.6, method="Template matching", file="./tasks/Orochi/o/o_orochi_fire.png")
 	# 式神录 

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

@@ -20,8 +20,8 @@
   {
     "itemName": "orochi_lock",
     "imageName": "o_orochi_lock.png",
-    "roiFront": "557,563,31,32",
-    "roiBack": "548,554,101,54",
+    "roiFront": "575,561,22,26",
+    "roiBack": "548,546,109,62",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -29,8 +29,8 @@
   {
     "itemName": "orochi_unlock",
     "imageName": "o_orochi_unlock.png",
-    "roiFront": "562,564,26,29",
-    "roiBack": "550,553,100,51",
+    "roiFront": "575,561,21,21",
+    "roiBack": "550,544,121,60",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"

BIN
tasks/Orochi/o/o_orochi_lock.png


BIN
tasks/Orochi/o/o_orochi_unlock.png


+ 1 - 15
tasks/Orochi/script_task.py

@@ -476,26 +476,12 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
 if __name__ == '__main__':
     from module.config.config import Config
     from module.device.device import Device
-    from memory_profiler import profile
-    c = Config('test')
+    c = Config('oas1')
     d = Device(c)
     t = ScriptTask(c, d)
 
     t.run()
 
-    # t.check_layer('悲')
-
-    from module.base.timer import timer
-
-    @timer
-    @profile
-    def test_memory():
-        t.screenshot()
-        print(t.ocr_appear(t.O_O_TEST_OCR))
-        print(t.L_LAYER_LIST.image_appear(t.device.image, '悲'))
-    for i in range(4):
-        test_memory()
-        print('=====================')
 
 
 

+ 6 - 6
tasks/Restart/assets.py

@@ -12,15 +12,15 @@ class RestartAssets:
 
 	# Image Rule Assets
 	# 点击勾玉 
-	I_HARVEST_JADE = RuleImage(roi_front=(732,489,34,33), roi_back=(177,451,963,100), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_jade.png")
+	I_HARVEST_JADE = RuleImage(roi_front=(732,489,34,33), roi_back=(177,451,973,141), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_jade.png")
 	# 签到小图标 
-	I_HARVEST_SIGN = RuleImage(roi_front=(295,496,32,43), roi_back=(70,481,889,71), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign.png")
+	I_HARVEST_SIGN = RuleImage(roi_front=(397,500,24,34), roi_back=(70,471,889,89), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign.png")
 	# description 
 	I_HARVEST_SIGN_2 = RuleImage(roi_front=(592,135,100,252), roi_back=(592,135,100,252), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign_2.png")
 	# 999签到福袋 
-	I_HARVEST_SIGN_999 = RuleImage(roi_front=(345,494,23,29), roi_back=(51,459,888,92), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign_999.png")
+	I_HARVEST_SIGN_999 = RuleImage(roi_front=(345,494,23,29), roi_back=(51,459,888,103), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign_999.png")
 	# 邮件小图标 
-	I_HARVEST_MAIL = RuleImage(roi_front=(337,505,37,25), roi_back=(38,476,880,78), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_mail.png")
+	I_HARVEST_MAIL = RuleImage(roi_front=(337,505,37,25), roi_back=(38,465,880,89), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_mail.png")
 	# 全部收取 
 	I_HARVEST_MAIL_ALL = RuleImage(roi_front=(80,622,75,64), roi_back=(80,622,75,64), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_mail_all.png")
 	# 有些邮件需要点击一次 
@@ -32,11 +32,11 @@ class RestartAssets:
 	# 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")
+	I_HARVEST_AP = RuleImage(roi_front=(721,486,31,38), roi_back=(206,462,970,134), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_ap.png")
 	# 打开聊天频道会自动关闭 
 	I_HARVEST_CHAT_CLOSE = RuleImage(roi_front=(639,309,35,100), roi_back=(639,309,35,100), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_chat_close.png")
 	# 签到 
-	I_HARVEST_SIGN_3 = RuleImage(roi_front=(291,495,33,36), roi_back=(100,473,1014,70), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign_3.png")
+	I_HARVEST_SIGN_3 = RuleImage(roi_front=(291,495,33,36), roi_back=(100,473,1014,91), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign_3.png")
 	# description 
 	I_HARVEST_SIGN_4 = RuleImage(roi_front=(587,151,100,228), roi_back=(547,123,185,281), threshold=0.8, method="Template matching", file="./tasks/Restart/harvest/harvest_harvest_sign_4.png")
 

BIN
tasks/Restart/harvest/harvest_harvest_sign.png


+ 7 - 7
tasks/Restart/harvest/image.json

@@ -3,7 +3,7 @@
     "itemName": "harvest_jade",
     "imageName": "harvest_harvest_jade.png",
     "roiFront": "732,489,34,33",
-    "roiBack": "177,451,963,100",
+    "roiBack": "177,451,973,141",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "点击勾玉"
@@ -11,8 +11,8 @@
   {
     "itemName": "harvest_sign",
     "imageName": "harvest_harvest_sign.png",
-    "roiFront": "295,496,32,43",
-    "roiBack": "70,481,889,71",
+    "roiFront": "397,500,24,34",
+    "roiBack": "70,471,889,89",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "签到小图标"
@@ -30,7 +30,7 @@
     "itemName": "harvest_sign_999",
     "imageName": "harvest_harvest_sign_999.png",
     "roiFront": "345,494,23,29",
-    "roiBack": "51,459,888,92",
+    "roiBack": "51,459,888,103",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "999签到福袋"
@@ -39,7 +39,7 @@
     "itemName": "harvest_mail",
     "imageName": "harvest_harvest_mail.png",
     "roiFront": "337,505,37,25",
-    "roiBack": "38,476,880,78",
+    "roiBack": "38,465,880,89",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "邮件小图标"
@@ -93,7 +93,7 @@
     "itemName": "harvest_ap",
     "imageName": "harvest_harvest_ap.png",
     "roiFront": "721,486,31,38",
-    "roiBack": "206,462,999,81",
+    "roiBack": "206,462,970,134",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -111,7 +111,7 @@
     "itemName": "harvest_sign_3",
     "imageName": "harvest_harvest_sign_3.png",
     "roiFront": "291,495,33,36",
-    "roiBack": "100,473,1014,70",
+    "roiBack": "100,473,1014,91",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "签到"

+ 2 - 2
tasks/Restart/login.py

@@ -34,7 +34,7 @@ class LoginHandler(BaseTask, RestartAssets):
             self.screenshot()
 
             # 确认进入庭院
-            if self.appear_then_click(self.I_LOGIN_SCROOLL_CLOSE, interval=2, threshold=0.85):
+            if self.appear_then_click(self.I_LOGIN_SCROOLL_CLOSE, interval=2, threshold=0.9):
                 logger.info('Open scroll')
                 continue
             if self.appear(self.I_LOGIN_SCROOLL_OPEN, interval=0.2):
@@ -102,7 +102,7 @@ class LoginHandler(BaseTask, RestartAssets):
                 continue
 
         logger.critical('Login failed more than 3')
-        logger.critical('Azur Lane server may be under maintenance, or you may lost network connection')
+        logger.critical('Onmyoji server may be under maintenance, or you may lost network connection')
         raise RequestHumanTakeover
 
 

+ 4 - 3
tasks/Restart/script_task.py

@@ -50,11 +50,12 @@ if __name__ == '__main__':
     from module.config.config import Config
     from module.device.device import Device
 
-    config = Config('oas2')
+    config = Config('oas1')
     device = Device(config)
     task = ScriptTask(config, device)
-    task.app_restart()
-
+    task.harvest()
+    # task.screenshot()
+    # print(task.appear_then_click(task.I_LOGIN_SCROOLL_CLOSE, threshold=0.9))
 
 
 

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