Преглед изворни кода

Merge branch 'runhey:dev' into dev

LHY пре 8 месеци
родитељ
комит
91061ce664
100 измењених фајлова са 1395 додато и 687 уклоњено
  1. 3 0
      .gitignore
  2. 14 1
      assets/i18n/zh-CN.json
  3. 15 0
      config/template.json
  4. 74 4
      module/atom/image.py
  5. 1 1
      module/config/config_manual.py
  6. 1 1
      module/config/config_menu.py
  7. 2 0
      module/config/config_model.py
  8. 0 0
      module/config/i18n/en_US.xml
  9. 2 0
      module/config/i18n/zh_CN.xml
  10. 6 1
      requirements-in.txt
  11. 9 5
      requirements.txt
  12. BIN
      tasks/ActivityShikigami/as/as_check_battle_boss.png
  13. BIN
      tasks/ActivityShikigami/as/as_to_battle_boss.png
  14. BIN
      tasks/ActivityShikigami/as/as_to_battle_main.png
  15. 6 6
      tasks/ActivityShikigami/as/pages.json
  16. 3 3
      tasks/ActivityShikigami/assets.py
  17. 4 1
      tasks/ActivityShikigami/script_task.py
  18. 12 0
      tasks/AutoCheckinBigGod/assets.py
  19. 18 0
      tasks/AutoCheckinBigGod/config.py
  20. 1115 0
      tasks/AutoCheckinBigGod/script_task.py
  21. 12 8
      tasks/Component/Costume/config.py
  22. 1 34
      tasks/Component/Costume/costume_base.py
  23. 12 7
      tasks/Component/CostumeCarpBanner/assets.py
  24. BIN
      tasks/Component/CostumeCarpBanner/cb1/cb1_card_exp_1.png
  25. BIN
      tasks/Component/CostumeCarpBanner/cb1/cb1_shi_card_1.png
  26. BIN
      tasks/Component/CostumeCarpBanner/cb1/cb1_shi_defense_1.png
  27. BIN
      tasks/Component/CostumeCarpBanner/cb1/cb1_shi_grown_1.png
  28. BIN
      tasks/Component/CostumeCarpBanner/cb1/cb1_utilize_exp_1.png
  29. 9 27
      tasks/Component/CostumeCarpBanner/cb1/image.json
  30. BIN
      tasks/Component/CostumeCarpBanner/cb2/cb2_shi_card_2.png
  31. BIN
      tasks/Component/CostumeCarpBanner/cb2/cb2_shi_defense_2.png
  32. BIN
      tasks/Component/CostumeCarpBanner/cb2/cb2_shi_grown_2.png
  33. 29 0
      tasks/Component/CostumeCarpBanner/cb2/image.json
  34. 0 30
      tasks/Component/CostumeRealm/README.md
  35. 0 117
      tasks/Component/CostumeRealm/assets.py
  36. 0 83
      tasks/Component/CostumeRealm/realm1/image.json
  37. BIN
      tasks/Component/CostumeRealm/realm1/realm1_box_ap_1.png
  38. BIN
      tasks/Component/CostumeRealm/realm1/realm1_box_exp_1.png
  39. BIN
      tasks/Component/CostumeRealm/realm1/realm1_box_exp_max_1.png
  40. BIN
      tasks/Component/CostumeRealm/realm1/realm1_card_exp_1.png
  41. BIN
      tasks/Component/CostumeRealm/realm1/realm1_realm_shin_1.png
  42. BIN
      tasks/Component/CostumeRealm/realm1/realm1_shi_card_1.png
  43. BIN
      tasks/Component/CostumeRealm/realm1/realm1_shi_defense_1.png
  44. BIN
      tasks/Component/CostumeRealm/realm1/realm1_shi_grown_1.png
  45. BIN
      tasks/Component/CostumeRealm/realm1/realm1_utilize_exp_1.png
  46. 0 83
      tasks/Component/CostumeRealm/realm2/image.json
  47. BIN
      tasks/Component/CostumeRealm/realm2/realm2_box_ap_2.png
  48. BIN
      tasks/Component/CostumeRealm/realm2/realm2_box_exp_2.png
  49. BIN
      tasks/Component/CostumeRealm/realm2/realm2_box_exp_max_2.png
  50. BIN
      tasks/Component/CostumeRealm/realm2/realm2_card_exp_2.png
  51. BIN
      tasks/Component/CostumeRealm/realm2/realm2_realm_shin_2.png
  52. BIN
      tasks/Component/CostumeRealm/realm2/realm2_shi_card_2.png
  53. BIN
      tasks/Component/CostumeRealm/realm2/realm2_shi_defense_2.png
  54. BIN
      tasks/Component/CostumeRealm/realm2/realm2_shi_grown_2.png
  55. BIN
      tasks/Component/CostumeRealm/realm2/realm2_utilize_exp_2.png
  56. 0 83
      tasks/Component/CostumeRealm/realm3/image.json
  57. BIN
      tasks/Component/CostumeRealm/realm3/realm3_box_ap_3.png
  58. BIN
      tasks/Component/CostumeRealm/realm3/realm3_box_exp_3.png
  59. BIN
      tasks/Component/CostumeRealm/realm3/realm3_box_exp_max_3.png
  60. BIN
      tasks/Component/CostumeRealm/realm3/realm3_card_exp_3.png
  61. BIN
      tasks/Component/CostumeRealm/realm3/realm3_realm_shin_3.png
  62. BIN
      tasks/Component/CostumeRealm/realm3/realm3_shi_card_3.png
  63. BIN
      tasks/Component/CostumeRealm/realm3/realm3_shi_defense_3.png
  64. BIN
      tasks/Component/CostumeRealm/realm3/realm3_shi_grown_3.png
  65. BIN
      tasks/Component/CostumeRealm/realm3/realm3_utilize_exp_3.png
  66. 0 83
      tasks/Component/CostumeRealm/realm4/image.json
  67. BIN
      tasks/Component/CostumeRealm/realm4/realm4_box_ap_4.png
  68. BIN
      tasks/Component/CostumeRealm/realm4/realm4_box_exp_4.png
  69. BIN
      tasks/Component/CostumeRealm/realm4/realm4_box_exp_max_4.png
  70. BIN
      tasks/Component/CostumeRealm/realm4/realm4_card_exp_4.png
  71. BIN
      tasks/Component/CostumeRealm/realm4/realm4_realm_shin_4.png
  72. BIN
      tasks/Component/CostumeRealm/realm4/realm4_shi_card_4.png
  73. BIN
      tasks/Component/CostumeRealm/realm4/realm4_shi_defense_4.png
  74. BIN
      tasks/Component/CostumeRealm/realm4/realm4_shi_grown_4.png
  75. BIN
      tasks/Component/CostumeRealm/realm4/realm4_utilize_exp_4.png
  76. 0 83
      tasks/Component/CostumeRealm/realm5/image.json
  77. BIN
      tasks/Component/CostumeRealm/realm5/realm5_box_ap_5.png
  78. BIN
      tasks/Component/CostumeRealm/realm5/realm5_box_exp_5.png
  79. BIN
      tasks/Component/CostumeRealm/realm5/realm5_box_exp_max_5.png
  80. BIN
      tasks/Component/CostumeRealm/realm5/realm5_card_exp_5.png
  81. BIN
      tasks/Component/CostumeRealm/realm5/realm5_realm_shin_5.png
  82. BIN
      tasks/Component/CostumeRealm/realm5/realm5_shi_card_5.png
  83. BIN
      tasks/Component/CostumeRealm/realm5/realm5_shi_defense_5.png
  84. BIN
      tasks/Component/CostumeRealm/realm5/realm5_shi_grown_5.png
  85. BIN
      tasks/Component/CostumeRealm/realm5/realm5_utilize_exp_5.png
  86. 7 7
      tasks/Component/CostumeShikigami/assets.py
  87. 14 14
      tasks/Component/CostumeShikigami/sk6/image.json
  88. BIN
      tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_1_6.png
  89. BIN
      tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_2_6.png
  90. BIN
      tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_3_6.png
  91. BIN
      tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_4_6.png
  92. BIN
      tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_5_6.png
  93. BIN
      tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_6_6.png
  94. BIN
      tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_7_6.png
  95. 1 3
      tasks/Component/GeneralInvite/assets.py
  96. 2 2
      tasks/Component/GeneralInvite/gi/image.json
  97. 4 0
      tasks/Component/SwitchOnmyoji/assets.py
  98. 1 0
      tasks/Component/SwitchOnmyoji/config.py
  99. 18 0
      tasks/Component/SwitchOnmyoji/so/image.json
  100. BIN
      tasks/Component/SwitchOnmyoji/so/so_michinaga_battle.png

+ 3 - 0
.gitignore

@@ -272,3 +272,6 @@ adb_port.ini
 *.zip
 console.bat
 .vscode/*
+.claude/settings.local.json
+tasks/AutoCheckinBigGod/frida-server-17.6.2-android-x86_64
+oas.bat

+ 14 - 1
assets/i18n/zh-CN.json

@@ -6,7 +6,20 @@
   "hya_onmyoji_help": "",
   "skill_mode": "技能本模式",
   "costume_shikigami_6": "月下火舞",
-  "costume_shikigami_7": "赤溟幽界"
+  "costume_shikigami_7": "赤溟幽界",
+  "costume_carpbanner_type": "鲤鱼旗皮肤",
+  "costume_carpbanner_default": "吉鲤游风",
+  "costume_carpbanner_1": "无垢莲台",
+  "costume_carpbanner_2": "萤灯月夜",
+  "costume_carpbanner_type_help": "多数结界通用",
+  "costume_battle_10": "流焰蝶舞",
+  "costume_battle_11": "辰烁奇夜",
+  "enable_courtyard_affairs": "庭院事务",
+  "AutoCheckinBigGod": "大神签到",
+  "auto_checkin_big_god": "大神签到",
+  "checkin_config": "签到配置",
+  "Usage": "使用说明",
+  "checkin_big_god_usage_help": "自动领取网易大神APP的阴阳师福利礼包。\n\n使用前准备:\n1. 开启模拟器的Root模式\n2. 模拟器中安装并登录「网易大神」APP\n3. 在大神APP中绑定阴阳师角色\n\nFrida Server 会自动推送到模拟器并启动,无需手动操作。"
 }
 
 

+ 15 - 0
config/template.json

@@ -533,6 +533,21 @@
       "team_name": ""
     }
   },
+  "auto_checkin_big_god": {
+    "scheduler": {
+      "enable": false,
+      "next_run": "2023-01-01 00:00:00",
+      "priority": 5,
+      "success_interval": "01 00:00:00",
+      "failure_interval": "01 00:00:00",
+      "server_update": "09:00:00",
+      "delay_date": 1,
+      "float_time": "00:00:00"
+    },
+    "checkin_config": {
+      "usage": ""
+    }
+  },
   "orochi": {
     "scheduler": {
       "enable": false,

+ 74 - 4
module/atom/image.py

@@ -154,8 +154,8 @@ class RuleImage(RuleImageMallResourceMixin):
         mat = self.image
 
         if mat is None or mat.shape[0] == 0 or mat.shape[1] == 0:
-            logger.error(f"Template image is invalid: {mat.shape}") #检测模板尺寸,不合法则不进行匹配,避免两次截图画面完全相同造成模板不合法
-            return True  # 如果模板图像无效,直接返回 True
+            logger.error(f"Template image is invalid: {mat.shape}")
+            return False  # 模板无效,匹配失败
 
         res = cv2.matchTemplate(source, mat, cv2.TM_CCOEFF_NORMED)
         min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(res)  # 最小匹配度,最大匹配度,最小匹配度的坐标,最大匹配度的坐标
@@ -169,6 +169,77 @@ class RuleImage(RuleImageMallResourceMixin):
         else:
             return False
 
+    def match_multi_scale(self, image: np.array, threshold: float = None,
+                          scales: list = None, scale_range: tuple = None) -> bool:
+        """
+        多尺度模板匹配,自动尝试多个缩放比例以适应图片大小的变化
+        :param image: 原始截图
+        :param threshold: 匹配阈值
+        :param scales: 缩放比例列表
+        :param scale_range: 缩放范围 (start, end, step),例如 (0.8, 1.2, 0.1),step 默认为 0.1
+        :return: 匹配是否成功
+        """
+        if threshold is None:
+            threshold = self.threshold
+
+        # 如果指定了 scale_range,自动生成 scales 列表
+        if scale_range is not None:
+            start, end = scale_range[:2]
+            step = scale_range[2] if len(scale_range) > 2 else 0.1
+            scales = sorted(set(round(x, 1) for x in np.arange(start, end + step, step)))
+
+        if scales is None:
+            scales = [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2]
+        else:
+            scales = sorted(set(round(x, 1) for x in scales))
+
+        source = self.corp(image)
+        mat = self.image
+
+        if mat is None or mat.shape[0] == 0 or mat.shape[1] == 0:
+            logger.error(f"Template image is invalid: {mat.shape}")
+            return False
+
+        # 预计算模板尺寸
+        mat_h, mat_w = mat.shape[:2]
+        source_h, source_w = source.shape[:2]
+
+        best_score = 0
+        best_loc = None
+        best_scale = 1.0
+
+        for scale in scales:
+            scaled_w = int(mat_w * scale)
+            scaled_h = int(mat_h * scale)
+
+            # 跳过无效缩放
+            if scaled_w < 10 or scaled_h < 10:
+                continue
+
+            try:
+                scaled_mat = cv2.resize(mat, (scaled_w, scaled_h))
+                res = cv2.matchTemplate(source, scaled_mat, cv2.TM_CCOEFF_NORMED)
+                _, max_val, _, max_loc = cv2.minMaxLoc(res)
+
+                if max_val > best_score:
+                    best_score = max_val
+                    best_loc = max_loc
+                    best_scale = scale
+            except Exception as e:
+                continue
+
+        if self.debug_mode:
+            logger.attr(self.name, f'best scale: {best_scale:.2f}, best score: {best_score:.5f}')
+
+        if best_score > threshold and best_loc is not None:
+            self.roi_front[0] = best_loc[0] + self.roi_back[0]
+            self.roi_front[1] = best_loc[1] + self.roi_back[1]
+            self.roi_front[2] = scaled_w
+            self.roi_front[3] = scaled_h
+            return True
+        else:
+            return False
+
     def match_all(self, image: np.array, threshold: float = None, roi: list = None) -> list[tuple]:
         """
         区别于match,这个是返回所有的匹配结果
@@ -357,5 +428,4 @@ if __name__ == "__main__":
 
     detect_image(IMAGE_FILE, jade)
     detect_image(IMAGE_FILE, sign)
-    print(jade.roi_front)
-
+    print(jade.roi_front)

+ 1 - 1
module/config/config_manual.py

@@ -10,7 +10,7 @@ class ConfigManual:
     SCHEDULER_PRIORITY = """
         Restart > SoulsTidy
         > KekkaiUtilize > KekkaiActivation > DemonEncounter
-        > AreaBoss > GoldYoukai > ExperienceYoukai > Nian > Tako > RealmRaid > RyouToppa > DailyTrifles > Exploration
+        > AreaBoss > GoldYoukai > ExperienceYoukai > Nian > Tako > AutoCheckinBigGod > RealmRaid > RyouToppa > DailyTrifles > Exploration
         > Dokan > AbyssShadows > Hunt > GuildBanquet > DemonRetreat
         > Orochi > OrochiMoans > OrochiJudgement > Sougenbi > FallenSun > EternitySea > SixRealms
         > ActivityShikigami > WantedQuests

+ 1 - 1
module/config/config_menu.py

@@ -23,7 +23,7 @@ class ConfigMenu:
         # 日常的任务
         self.menu["Daily Task"] = ['DailyTrifles', 'AreaBoss', 'GoldYoukai', 'ExperienceYoukai', 'Nian',
                                    'TalismanPass', 'DemonEncounter', 'Pets', 'SoulsTidy', 'Delegation', 'WantedQuests',
-                                   'Tako']
+                                   'Tako', 'AutoCheckinBigGod']
         # 很肝的任务
         self.menu["Liver Emperor Exclusive"] = [
             "BondlingFairyland",

+ 2 - 0
module/config/config_model.py

@@ -35,6 +35,7 @@ from tasks.SoulsTidy.config import SoulsTidy
 from tasks.Delegation.config import Delegation
 from tasks.WantedQuests.config import WantedQuests
 from tasks.Tako.config import Tako
+from tasks.AutoCheckinBigGod.config import AutoCheckinBigGod
 # ----------------------------------------------------------------------------------------------------------------------
 from tasks.Orochi.config import Orochi
 from tasks.OrochiMoans.config import OrochiMoans
@@ -103,6 +104,7 @@ class ConfigModel(ConfigBase):
     exploration: Exploration = Field(default_factory=Exploration)
     wanted_quests: WantedQuests = Field(default_factory=WantedQuests)
     tako: Tako = Field(default_factory=Tako)
+    auto_checkin_big_god: AutoCheckinBigGod = Field(default_factory=AutoCheckinBigGod)
 
     # 这些是刷御魂的
     orochi: Orochi = Field(default_factory=Orochi)

+ 0 - 0
module/config/i18n/en_US.ts → module/config/i18n/en_US.xml


+ 2 - 0
module/config/i18n/zh_CN.ts → module/config/i18n/zh_CN.xml

@@ -202,6 +202,7 @@
 	<message><source>Duel</source><translation>斗技</translation></message>
 	<message><source>WantedQuests</source><translation>悬赏封印</translation></message>
 	<message><source>Tako</source><translation>石距</translation></message>
+	<message><source>AutoCheckinBigGod</source><translation>大神签到</translation></message>
 </context>
 <context>
     <name>TaskList</name>
@@ -249,6 +250,7 @@
 	<message><source>Duel</source><translation>斗技</translation></message>
 	<message><source>WantedQuests</source><translation>悬赏封印</translation></message>
 	<message><source>Tako</source><translation>石距</translation></message>
+	<message><source>AutoCheckinBigGod</source><translation>大神签到</translation></message>
 </context>
 <context>
     <name>Args</name>

+ 6 - 1
requirements-in.txt

@@ -18,7 +18,7 @@ cn2an==0.5.23
 paho-mqtt==1.6.1
 fastapi==0.104.1
 uvicorn==0.38.0
-websockets==11.0.3
+websockets==13.1
 zerorpc==0.6.3
 pydantic==2.10.0
 
@@ -31,7 +31,12 @@ cryptography>=42.0.7
 onepush==1.3.0
 inflection==0.5.1
 
+# Frida (for AutoCheckinBigGod)
+frida==17.6.2
+frida-tools==14.5.2
+
 oashya
+oas-checkin-biggod
 
 # For dev
 #

+ 9 - 5
requirements.txt

@@ -4,7 +4,6 @@
 #
 #    pip-compile --annotation-style=line --output-file=requirements.txt requirements-in.txt
 #
-
 adbutils==0.11.0          # via -r requirements-in.txt, uiautomator2
 annotated-types==0.7.0    # via pydantic
 anyio==3.7.1              # via fastapi, starlette
@@ -17,7 +16,7 @@ charset-normalizer==3.3.2  # via requests
 cigam==0.0.3              # via apkutils2
 click==8.1.7              # via uvicorn
 cn2an==0.5.23             # via -r requirements-in.txt
-colorama==0.4.6           # via click, logzero, tqdm
+colorama==0.4.6           # via click, frida-tools, logzero, tqdm
 coloredlogs==15.0.1       # via onnxruntime
 cryptography==42.0.8      # via -r requirements-in.txt
 decorator==5.1.1          # via retry
@@ -27,6 +26,8 @@ exceptiongroup==1.2.0     # via anyio
 fastapi==0.104.1          # via -r requirements-in.txt
 filelock==3.13.1          # via uiautomator2
 flatbuffers==23.5.26      # via onnxruntime
+frida==17.6.2             # via -r requirements-in.txt, frida-tools
+frida-tools==14.5.2       # via -r requirements-in.txt
 future==0.18.3            # via zerorpc
 gevent==23.9.1            # via zerorpc
 greenlet==3.0.3           # via gevent
@@ -41,6 +42,7 @@ mdurl==0.1.2              # via markdown-it-py
 mpmath==1.3.0             # via sympy
 msgpack==1.0.7            # via zerorpc
 numpy==1.24.3             # via -r requirements-in.txt, onnxruntime, opencv-python, ppocr-onnx, shapely
+oas-checkin-biggod==0.0.1  # via -r requirements-in.txt
 oashya==0.0.7             # via -r requirements-in.txt
 onepush==1.3.0            # via -r requirements-in.txt
 onnxruntime==1.16.3       # via ppocr-onnx
@@ -51,6 +53,7 @@ pillow==10.2.0            # via ppocr-onnx, uiautomator2
 ppocr-onnx==0.0.3.9       # via -r requirements-in.txt
 proces==0.1.7             # via cn2an
 progress==1.6             # via uiautomator2
+prompt-toolkit==3.0.52    # via frida-tools
 protobuf==4.25.1          # via onnxruntime
 psutil==6.1.1             # via -r requirements-in.txt
 py==1.11.0                # via retry
@@ -60,7 +63,7 @@ pycryptodome==3.21.0      # via onepush
 pydantic==2.10.0          # via -r requirements-in.txt, fastapi
 pydantic-core==2.27.0     # via pydantic
 pyelftools==0.30          # via apkutils2
-pygments==2.17.2          # via rich
+pygments==2.17.2          # via frida-tools, rich
 pyparsing==3.1.1          # via packaging
 pyreadline3==3.4.1        # via humanfriendly
 pywin32==306              # via -r requirements-in.txt
@@ -75,12 +78,13 @@ sniffio==1.3.0            # via anyio
 starlette==0.27.0         # via fastapi
 sympy==1.12               # via onnxruntime
 tqdm==4.65.0              # via -r requirements-in.txt
-typing-extensions==4.12.2  # via fastapi, pydantic, pydantic-core, uvicorn
+typing-extensions==4.12.2  # via fastapi, frida, pydantic, pydantic-core, uvicorn
 uiautomator2==2.16.17     # via -r requirements-in.txt
 uiautomator2cache==0.3.0.1  # via -r requirements-in.txt
 urllib3==2.1.0            # via requests
 uvicorn==0.38.0           # via -r requirements-in.txt
-websockets==11.0.3        # via -r requirements-in.txt
+wcwidth==0.6.0            # via prompt-toolkit
+websockets==13.1          # via -r requirements-in.txt, frida-tools
 whichcraft==0.6.1         # via adbutils, uiautomator2
 wrapt==1.15.0             # via -r requirements-in.txt, deprecated
 xmltodict==0.13.0         # via apkutils2

BIN
tasks/ActivityShikigami/as/as_check_battle_boss.png


BIN
tasks/ActivityShikigami/as/as_to_battle_boss.png


BIN
tasks/ActivityShikigami/as/as_to_battle_main.png


+ 6 - 6
tasks/ActivityShikigami/as/pages.json

@@ -38,8 +38,8 @@
   {
     "itemName": "to_battle_main",
     "imageName": "as_to_battle_main.png",
-    "roiFront": "267,277,39,176",
-    "roiBack": "238,242,100,241",
+    "roiFront": "141,310,39,176",
+    "roiBack": "100,242,238,269",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "进入主要的战斗界面"
@@ -47,8 +47,8 @@
   {
     "itemName": "to_battle_boss",
     "imageName": "as_to_battle_boss.png",
-    "roiFront": "974,327,37,136",
-    "roiBack": "934,317,100,219",
+    "roiFront": "1093,293,37,136",
+    "roiBack": "934,209,234,327",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "点击进入boss战斗页面"
@@ -65,8 +65,8 @@
   {
     "itemName": "check_battle_boss",
     "imageName": "as_check_battle_boss.png",
-    "roiFront": "0,0,100,100",
-    "roiBack": "0,0,100,100",
+    "roiFront": "34,365,45,35",
+    "roiBack": "20,328,100,100",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"

+ 3 - 3
tasks/ActivityShikigami/assets.py

@@ -46,13 +46,13 @@ class ActivityShikigamiAssets:
 	# 红色退出 
 	I_RED_EXIT = RuleImage(roi_front=(1162,96,39,38), roi_back=(1120,49,110,135), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_red_exit.png")
 	# 进入主要的战斗界面 
-	I_TO_BATTLE_MAIN = RuleImage(roi_front=(267,277,39,176), roi_back=(238,242,100,241), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_to_battle_main.png")
+	I_TO_BATTLE_MAIN = RuleImage(roi_front=(141,310,39,176), roi_back=(100,242,238,269), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_to_battle_main.png")
 	# 点击进入boss战斗页面 
-	I_TO_BATTLE_BOSS = RuleImage(roi_front=(974,327,37,136), roi_back=(934,317,100,219), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_to_battle_boss.png")
+	I_TO_BATTLE_BOSS = RuleImage(roi_front=(1093,293,37,136), roi_back=(934,209,234,327), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_to_battle_boss.png")
 	# description 
 	I_CHECK_BATTLE_MAIN = RuleImage(roi_front=(34,639,39,46), roi_back=(12,597,264,105), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_check_battle_main.png")
 	# description 
-	I_CHECK_BATTLE_BOSS = RuleImage(roi_front=(0,0,100,100), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_check_battle_boss.png")
+	I_CHECK_BATTLE_BOSS = RuleImage(roi_front=(34,365,45,35), roi_back=(20,328,100,100), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_check_battle_boss.png")
 	# 从main进入到式神录 
 	I_BATTLE_MAIN_TO_RECORDS = RuleImage(roi_front=(1017,572,39,42), roi_back=(976,539,146,100), threshold=0.8, method="Template matching", file="./tasks/ActivityShikigami/as/as_battle_main_to_records.png")
 	# description 

+ 4 - 1
tasks/ActivityShikigami/script_task.py

@@ -301,8 +301,11 @@ class ScriptTask(StateMachine, GameUi, BaseActivity, SwitchSoul, ActivityShikiga
                 logger.info('Win battle')
                 while 1:
                     self.screenshot()
-                    appear_reward = self.appear_then_click(self.I_REWARD)
+                    # appear_reward = self.appear_then_click(self.I_REWARD)
                     appear_reward_purple_snake_skin = self.appear(self.I_REWARD_PURPLE_SNAKE_SKIN)
+                    appear_reward = self.appear(self.I_REWARD)
+                    if appear_reward:
+                        self.click(self.I_REWARD, interval=0.9)
                     if not appear_reward and not appear_reward_purple_snake_skin:
                         break
                     if appear_reward or appear_reward_purple_snake_skin:

+ 12 - 0
tasks/AutoCheckinBigGod/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 ./dev_tools/assets_extract.py.
+# Don't modify it manually.
+class AutoCheckinBigGodAssets: 
+	pass
+

+ 18 - 0
tasks/AutoCheckinBigGod/config.py

@@ -0,0 +1,18 @@
+# This Python file uses the following encoding: utf-8
+from pydantic import BaseModel, Field
+
+from tasks.Component.config_scheduler import Scheduler
+from tasks.Component.config_base import ConfigBase, MultiLine
+
+
+class CheckinBigGodConfig(BaseModel):
+    usage: MultiLine = Field(
+        title='Usage',
+        default='',
+        description='checkin_big_god_usage_help'
+    )
+
+
+class AutoCheckinBigGod(ConfigBase):
+    scheduler: Scheduler = Field(default_factory=Scheduler)
+    checkin_config: CheckinBigGodConfig = Field(default_factory=CheckinBigGodConfig)

+ 1115 - 0
tasks/AutoCheckinBigGod/script_task.py

@@ -0,0 +1,1115 @@
+# This Python file uses the following encoding: utf-8
+import subprocess
+import tempfile
+import threading
+import lzma
+import os
+import sys
+import time
+import json
+import random
+
+# 直接运行本脚本时,需要先将项目根目录加入 Python 路径
+if __name__ == '__main__' and 'tasks' not in sys.modules:
+    sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..'))
+
+import requests
+import urllib3
+
+from tasks.base_task import BaseTask
+from module.logger import logger
+from module.exception import TaskEnd
+
+try:
+    from oas_checkin_biggod import FRIDA_SERVER_XZ, ADB_PATH
+except ImportError:
+    raise ImportError(
+        "oas-checkin-biggod is not installed. "
+        "Run: ./toolkit/python.exe -m pip install oas-checkin-biggod"
+    )
+
+urllib3.disable_warnings()
+os.environ['MSYS_NO_PATHCONV'] = '1'
+
+WELFARE_BASE = "https://god-welfare.gameyw.netease.com"
+LOGIN_BASE = "https://god.gameyw.netease.com"
+GL_PACKAGE = "com.netease.gl"
+SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
+FRIDA_SERVER_LOCAL = os.path.join(SCRIPT_DIR, "frida-server-17.6.2-android-x86_64")
+FRIDA_SERVER_REMOTE = "/data/local/tmp/frida-server"
+
+APP_KEY = "g37"
+GL_VERSION = "4.12.0"  # 默认值,运行时会从APP动态获取
+GL_CLIENTTYPE = "50"
+_NO_WINDOW = subprocess.CREATE_NO_WINDOW if sys.platform == 'win32' else 0
+
+
+class ScriptTask(BaseTask):
+
+    def run(self):
+        self.gl_uid = ""
+        self.gl_token = ""
+        self.gl_deviceid = ""
+        self.gl_source = "URS"
+        self.gl_version = GL_VERSION
+        self.role_id = ""
+        self.server = ""
+        self.app_key = APP_KEY
+        self.frida_pid = None
+        self._frida_session = None  # 常驻 frida.exe 子进程
+        self._frida_attached_pid = None  # REPL 当前 attach 的 PID
+
+        self.session = requests.Session()
+        self.session.verify = False
+
+        logger.hr('AutoCheckinBigGod', level=1)
+
+        # [1/5] 检查运行环境
+        logger.info('[1/5] 检查运行环境...')
+        if not self._check_adb_connection():
+            logger.error('未检测到ADB设备,请确保模拟器已启动并已连接ADB')
+            self.set_next_run('AutoCheckinBigGod', success=False, finish=True)
+            raise TaskEnd('AutoCheckinBigGod')
+        logger.info('ADB已连接')
+
+        if not self._ensure_frida_server_running():
+            logger.error('Frida Server启动失败,请检查模拟器环境')
+            self.set_next_run('AutoCheckinBigGod', success=False, finish=True)
+            raise TaskEnd('AutoCheckinBigGod')
+        logger.info('Frida Server运行中')
+
+        # [2/5] 启动大神APP
+        logger.info('[2/5] 启动大神APP...')
+        pid = self._launch_app()
+        if not pid:
+            logger.error('无法启动大神APP,请确保模拟器中已安装大神APP')
+            self.set_next_run('AutoCheckinBigGod', success=False, finish=True)
+            raise TaskEnd('AutoCheckinBigGod')
+        self.frida_pid = pid
+        logger.info(f'大神APP已运行 (PID: {pid})')
+
+        # [3/5] 获取Token
+        logger.info('[3/5] 获取Token...')
+
+        # 优先通过 ADB 读取 auth 数据库 + HTTP API 登录(速度快)
+        token_data = None
+        new_pid, login_token = self._auto_login(pid)
+        if new_pid:
+            pid = new_pid
+            self.frida_pid = pid
+        if login_token:
+            token_data = login_token
+
+        # 回退:从内存提取(数据库无数据时)
+        if not token_data:
+            logger.warning('自动登录失败,尝试从内存提取Token...')
+            token_data = self._try_extract_token(pid)
+
+        if not token_data:
+            logger.error('无法获取Token,请确保已登录大神APP并绑定阴阳师角色')
+            self.set_next_run('AutoCheckinBigGod', success=False, finish=True)
+            raise TaskEnd('AutoCheckinBigGod')
+
+        self.gl_uid = token_data.get('GL_UID', '')
+        self.gl_token = token_data.get('GL_TOKEN', '')
+        self.gl_deviceid = token_data.get('GL_DEVICEID', '')
+        self.gl_source = token_data.get('GL_SOURCE', 'URS')
+        if token_data.get('GL_VERSION'):
+            self.gl_version = token_data['GL_VERSION']
+            logger.info(f'APP版本: {self.gl_version}')
+        logger.info(f'Token获取成功! 用户ID: {self.gl_uid[:16]}...')
+
+        # Token已获取,将大神APP切到后台,减少对用户的干扰
+        try:
+            self._adb_shell(['input', 'keyevent', 'KEYCODE_HOME'])
+        except Exception:
+            pass
+
+        # 通过API获取角色信息
+        logger.info('通过API获取角色信息...')
+        role_info = self._get_role_info()
+        if role_info:
+            self.role_id = role_info.get('roleId', '')
+            self.server = role_info.get('server', '')
+            logger.info(f'角色信息: {self.role_id} @ {self.server}')
+        else:
+            logger.warning('未能获取角色信息,请确保已在大神APP中绑定阴阳师角色')
+
+        # [4/5] 获取礼包列表
+        logger.info('[4/5] 获取礼包列表...')
+        rewards = self._get_rewards()
+
+        if not rewards:
+            logger.info('没有可领取的礼包')
+            self._cleanup()
+            self.set_next_run('AutoCheckinBigGod', success=True, finish=True)
+            raise TaskEnd('AutoCheckinBigGod')
+
+        # [5/5] 领取礼包
+        logger.info(f'[5/5] 领取 {len(rewards)} 个礼包...')
+        success_count = 0
+        for r in rewards:
+            if self._claim_reward(r['id'], r['title']):
+                success_count += 1
+            time.sleep(0.5)
+
+        logger.info(f'完成! 成功领取 {success_count}/{len(rewards)} 个礼包')
+        self._cleanup()
+        self.set_next_run('AutoCheckinBigGod', success=True, finish=True)
+        raise TaskEnd('AutoCheckinBigGod')
+
+    # ======================== 清理 ========================
+
+    def _cleanup(self):
+        logger.info('清理:关闭大神APP和Frida Server...')
+        try:
+            if self._frida_session is not None:
+                self._frida_session.kill()
+        except Exception:
+            pass
+        self._frida_session = None
+        self._frida_attached_pid = None
+        try:
+            self._adb_shell(['am', 'force-stop', GL_PACKAGE])
+        except Exception:
+            pass
+        try:
+            self._adb_shell(['su -c "killall frida-server"'])
+        except Exception:
+            pass
+
+    # ======================== ADB 操作 ========================
+
+    def _adb_cmd(self, args, timeout=10):
+        # 如果有设备序列号且命令不是 connect/devices,则添加 -s 参数指定设备
+        cmd = [ADB_PATH]
+        if hasattr(self, '_adb_serial') and self._adb_serial and args[0] not in ['connect', 'devices']:
+            cmd.extend(['-s', self._adb_serial])
+        cmd.extend(args)
+        result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout,
+                                creationflags=_NO_WINDOW)
+        return result.stdout.strip()
+
+    def _adb_shell(self, cmd, timeout=15):
+        return self._adb_cmd(['shell'] + cmd, timeout=timeout)
+
+    def _get_app_pid(self):
+        try:
+            output = self._adb_shell(['pidof', GL_PACKAGE])
+            if output:
+                return int(output.split()[0])
+        except Exception as e:
+            logger.warning(f'获取PID失败: {e}')
+        return None
+
+    def _launch_app(self):
+        """启动大神APP。如果已在运行则直接返回PID,不会force-stop。"""
+        try:
+            # 先检查是否已在运行
+            pid = self._get_app_pid()
+            if pid:
+                logger.info('大神APP已在运行,无需重启')
+                return pid
+
+            # 优先通过 ContentProvider 后台启动(不显示UI,需要 su 权限)
+            logger.info('后台启动大神APP进程...')
+            try:
+                subprocess.run(
+                    [ADB_PATH] + (['-s', self._adb_serial] if getattr(self, '_adb_serial', None) else []) +
+                    ['shell', 'su', '0', 'content', 'query', '--uri',
+                     f'content://{GL_PACKAGE}.utilcode.provider/'],
+                    capture_output=True, timeout=20, creationflags=_NO_WINDOW
+                )
+            except subprocess.TimeoutExpired:
+                pass
+
+            # 等待进程启动
+            for _ in range(10):
+                time.sleep(2)
+                pid = self._get_app_pid()
+                if pid:
+                    return pid
+
+            # 后台启动失败,用 monkey 前台启动后立即按 HOME 切回后台
+            logger.info('后台启动失败,前台启动后切回后台...')
+            self._adb_shell([
+                'monkey', '-p', GL_PACKAGE,
+                '-c', 'android.intent.category.LAUNCHER', '1'
+            ])
+            for _ in range(15):
+                time.sleep(2)
+                pid = self._get_app_pid()
+                if pid:
+                    # 立即按 HOME 键切到后台
+                    try:
+                        self._adb_shell(['input', 'keyevent', 'KEYCODE_HOME'])
+                    except Exception:
+                        pass
+                    return pid
+            return None
+        except Exception as e:
+            logger.warning(f'启动APP失败: {e}')
+            return None
+
+    # ======================== Frida Server 管理 ========================
+
+    def _check_adb_connection(self):
+        try:
+            serial = str(self.config.script.device.serial)
+            if serial and serial != 'auto':
+                logger.info(f'专用ADB连接到 {serial}...')
+                result = self._adb_cmd(['connect', serial], timeout=10)
+                if 'connected' not in result.lower() and 'already connected' not in result.lower():
+                    logger.warning(f'ADB连接失败: {result}')
+                    return False
+                # 保存设备序列号,用于后续命令指定设备
+                # adb connect 不带端口时会自动补 :5555,需要从 devices 列表中获取实际名称
+                # 因为 Frida -D 参数需要精确匹配 adb devices 中的设备名
+                self._adb_serial = serial
+            else:
+                self._adb_serial = None
+
+            output = self._adb_cmd(['devices'])
+            lines = [l for l in output.strip().split('\n')[1:] if l.strip() and '\tdevice' in l]
+
+            if len(lines) == 0:
+                logger.warning('未检测到任何设备')
+                return False
+
+            # 从 adb devices 输出中获取实际的设备 serial(可能带端口号)
+            # 例如用户配置 192.168.1.66,adb devices 中显示 192.168.1.66:5555
+            if self._adb_serial:
+                for l in lines:
+                    actual_serial = l.split('\t')[0].strip()
+                    if actual_serial.startswith(self._adb_serial):
+                        if actual_serial != self._adb_serial:
+                            logger.info(f'设备实际名称: {actual_serial}')
+                        self._adb_serial = actual_serial
+                        break
+
+            # 如果没有指定 serial 且只有一个设备,自动使用该设备
+            if not self._adb_serial and len(lines) == 1:
+                device_line = lines[0].split('\t')[0]
+                self._adb_serial = device_line.strip()
+                logger.info(f'自动使用设备: {self._adb_serial}')
+
+            return True
+        except Exception as e:
+            logger.warning(f'ADB连接检查失败: {e}')
+            return False
+
+    def _is_frida_server_running(self):
+        try:
+            output = self._adb_shell(['ps | grep frida-server'])
+            if 'frida-server' not in output:
+                return False
+            # 确保是以 root 身份运行,否则无法 attach 进程
+            for line in output.strip().split('\n'):
+                if 'frida-server' in line and 'grep' not in line:
+                    if line.strip().startswith('root'):
+                        return True
+            # frida-server 存在但不是 root 运行,杀掉重启
+            logger.warning('Frida Server未以root运行,正在重启...')
+            try:
+                self._adb_shell(['killall', 'frida-server'])
+            except Exception:
+                pass
+            return False
+        except Exception:
+            return False
+
+    def _is_frida_server_installed(self):
+        try:
+            output = self._adb_shell(['ls', '-l', FRIDA_SERVER_REMOTE])
+            return 'No such file' not in output and FRIDA_SERVER_REMOTE in output
+        except Exception:
+            return False
+
+    def _ensure_frida_local(self):
+        if os.path.exists(FRIDA_SERVER_LOCAL):
+            return True
+        if not os.path.exists(FRIDA_SERVER_XZ):
+            logger.error(f'找不到Frida Server压缩文件: {FRIDA_SERVER_XZ}')
+            return False
+        logger.info('解压Frida Server...')
+        try:
+            with lzma.open(FRIDA_SERVER_XZ, 'rb') as f_in:
+                with open(FRIDA_SERVER_LOCAL, 'wb') as f_out:
+                    f_out.write(f_in.read())
+            logger.info('Frida Server解压完成')
+            return True
+        except Exception as e:
+            logger.error(f'解压失败: {e}')
+            return False
+
+    def _push_frida_server(self):
+        if not self._ensure_frida_local():
+            return False
+        logger.info('推送Frida Server到模拟器...')
+        try:
+            # 先删除旧文件(如果存在)
+            try:
+                self._adb_shell(['rm', '-f', FRIDA_SERVER_REMOTE])
+            except:
+                pass
+
+            # 推送文件
+            self._adb_cmd(['push', FRIDA_SERVER_LOCAL, FRIDA_SERVER_REMOTE], timeout=60)
+
+            # 验证推送是否成功(检查文件大小)
+            local_size = os.path.getsize(FRIDA_SERVER_LOCAL)
+            remote_check = self._adb_shell(['ls', '-l', FRIDA_SERVER_REMOTE])
+
+            if 'No such file' in remote_check:
+                logger.error('推送失败: 文件未找到')
+                return False
+
+            # 从 ls -l 输出提取文件大小(格式如:-rwxr-xr-x 1 root root 105123456 ...)
+            try:
+                parts = remote_check.split()
+                if len(parts) >= 5:
+                    remote_size = int(parts[4])
+                    if remote_size != local_size:
+                        logger.error(f'推送失败: 文件大小不匹配 (本地: {local_size}, 远程: {remote_size})')
+                        return False
+            except:
+                pass
+
+            self._adb_shell(['chmod', '755', FRIDA_SERVER_REMOTE])
+            logger.info('Frida Server推送完成')
+            return True
+        except subprocess.TimeoutExpired:
+            logger.error('推送超时,请检查网络连接和模拟器状态')
+            return False
+        except Exception as e:
+            logger.error(f'推送失败: {e}')
+            return False
+
+    def _start_frida_server(self):
+        logger.info('启动Frida Server...')
+        # 使用 su + nohup 以 root 身份后台启动,否则无权 attach 其他进程
+        # 将 stdout/stderr 重定向到 /dev/null 避免阻塞
+        start_cmd = f'su -c "nohup {FRIDA_SERVER_REMOTE} > /dev/null 2>&1 &"'
+        try:
+            self._adb_shell([start_cmd], timeout=5)
+        except subprocess.TimeoutExpired:
+            # su 启动可能超时,但进程已经在后台运行了
+            pass
+        except Exception:
+            pass
+        # 轮询检测启动状态,最多等10秒
+        for _ in range(5):
+            time.sleep(2)
+            if self._is_frida_server_running():
+                logger.info('Frida Server已启动')
+                return True
+        logger.error('Frida Server启动失败,请确保模拟器已开启Root模式')
+        return False
+
+    def _ensure_frida_server_running(self):
+        if self._is_frida_server_running():
+            return True
+        if not self._is_frida_server_installed():
+            if not self._push_frida_server():
+                return False
+        return self._start_frida_server()
+
+    # ======================== Frida 脚本执行 ========================
+
+    def _get_frida_exe(self):
+        """获取 frida 可执行文件路径"""
+        python_dir = os.path.dirname(sys.executable)
+        frida_exe = os.path.join(python_dir, 'Scripts', 'frida.exe')
+        if os.path.exists(frida_exe):
+            return frida_exe
+        # 回退:依赖 PATH
+        return 'frida'
+
+    def _ensure_frida_repl(self, pid):
+        """确保有一个常驻的 frida REPL 进程 attach 到目标 PID。
+        首次调用启动进程(~3-5秒),后续调用直接复用。
+        如果 PID 变了(APP重启),则关闭旧进程并重新 attach。
+        """
+        if self._frida_session is not None:
+            if self._frida_session.poll() is None:
+                # PID 没变,直接复用
+                if self._frida_attached_pid == pid:
+                    return self._frida_session
+                # PID 变了,需要重新 attach
+                logger.info(f'目标PID变更 ({self._frida_attached_pid} -> {pid}),重新attach...')
+                try:
+                    self._frida_session.kill()
+                except Exception:
+                    pass
+            else:
+                logger.warning('Frida REPL 进程已退出,重新启动...')
+            self._frida_session = None
+            self._frida_attached_pid = None
+
+        frida_exe = self._get_frida_exe()
+        if hasattr(self, '_adb_serial') and self._adb_serial:
+            cmd = [frida_exe, '-D', self._adb_serial, '-p', str(pid)]
+        else:
+            cmd = [frida_exe, '-U', '-p', str(pid)]
+
+        try:
+            proc = subprocess.Popen(
+                cmd,
+                stdin=subprocess.PIPE,
+                stdout=subprocess.PIPE,
+                stderr=subprocess.STDOUT,
+                creationflags=_NO_WINDOW,
+            )
+            self._frida_session = proc
+
+            # 等待 frida attach 完成后再发 ping
+            # frida.exe 启动到可接受 JS 输入通常需要 3-5 秒
+            for wait_sec in (3, 3, 4):
+                time.sleep(wait_sec)
+                if proc.poll() is not None:
+                    out = proc.stdout.read().decode('utf-8', errors='ignore')
+                    logger.warning(f'Frida REPL 进程提前退出: {out[:300]}')
+                    self._frida_session = None
+                    return None
+
+                # 直接向 stdin 写 ping,不走 _run_frida_script 避免副作用
+                if self._ping_frida_repl(proc):
+                    self._frida_attached_pid = pid
+                    logger.info('Frida REPL 已就绪')
+                    return proc
+                logger.info('Frida REPL 尚未就绪,继续等待...')
+
+            # 所有重试都失败
+            logger.warning('Frida REPL 启动超时')
+            try:
+                proc.kill()
+            except Exception:
+                pass
+            self._frida_session = None
+            return None
+        except Exception as e:
+            logger.warning(f'启动Frida REPL失败: {e}')
+            self._frida_session = None
+            return None
+
+    def _ping_frida_repl(self, proc, timeout=8):
+        """向 frida REPL 发送 ping 并等待回显,验证 REPL 已就绪。
+        直接操作 proc 的 stdin/stdout,不经过 _run_frida_script。
+        返回 True/False。
+        """
+        # 使用唯一标记避免多次重试时 reader 线程之间的竞争
+        marker = f'__PING_{id(proc)}_{time.monotonic_ns()}__'
+        ping_js = f'console.log("{marker}"); console.log("__DONE__");\n'
+        try:
+            proc.stdin.write(ping_js.encode('utf-8'))
+            proc.stdin.flush()
+        except (BrokenPipeError, OSError):
+            return False
+
+        got_ready = False
+
+        def _read():
+            nonlocal got_ready
+            try:
+                while True:
+                    raw = proc.stdout.readline()
+                    if not raw:
+                        break
+                    line = raw.decode('utf-8', errors='ignore').strip()
+                    # 跳过 REPL 回显行(包含 ]-> ),避免 JS 代码中的标记被误判
+                    if ']->' in line:
+                        continue
+                    if marker in line:
+                        got_ready = True
+                    if '__DONE__' in line:
+                        break
+            except Exception:
+                pass
+
+        reader = threading.Thread(target=_read, daemon=True)
+        reader.start()
+        reader.join(timeout=timeout)
+        return got_ready
+
+    def _run_frida_script(self, pid, script_content, timeout=10):
+        """通过常驻 frida.exe REPL 子进程执行 JS 脚本,返回 console.log 输出。
+        首次调用自动启动 REPL(~3-5秒),后续调用复用同一进程(~毫秒级)。
+
+        脚本必须在最后一步打印 __DONE__ 来标记执行完成。
+        """
+
+        # 确保 REPL 进程存活
+        if self._frida_session is None or self._frida_session.poll() is not None:
+            if not self._ensure_frida_repl(pid):
+                logger.warning('无法建立Frida REPL连接,回退到单次执行模式')
+                return self._run_frida_script_oneshot(pid, script_content, timeout)
+
+        proc = self._frida_session
+
+        try:
+            # 写入 stdin — 将多行 JS 压成单行(frida REPL 按行执行)
+            line = script_content.replace('\n', ' ').replace('\r', '') + '\n'
+            proc.stdin.write(line.encode('utf-8'))
+            proc.stdin.flush()
+        except (BrokenPipeError, OSError) as e:
+            logger.warning(f'Frida REPL stdin写入失败: {e}')
+            self._frida_session = None
+            return self._run_frida_script_oneshot(pid, script_content, timeout)
+
+        # 从 stdout 读取直到看到 __DONE__ 标记或超时
+        output_lines = []
+        timed_out = threading.Event()
+
+        def _read_until_done():
+            try:
+                while True:
+                    if timed_out.is_set():
+                        break
+                    raw = proc.stdout.readline()
+                    if not raw:
+                        break
+                    line_decoded = raw.decode('utf-8', errors='ignore').rstrip('\n').rstrip('\r')
+                    # 先过滤 REPL 回显行(包含 ]-> ),避免 JS 代码中的标记被误判
+                    if ']->' in line_decoded:
+                        continue
+                    if '__DONE__' in line_decoded:
+                        break
+                    if line_decoded.strip():
+                        output_lines.append(line_decoded)
+            except Exception:
+                pass
+
+        reader = threading.Thread(target=_read_until_done, daemon=True)
+        reader.start()
+        reader.join(timeout=timeout)
+
+        if reader.is_alive():
+            timed_out.set()
+            logger.warning(f'Frida REPL 读取超时 ({timeout}s)')
+
+        return '\n'.join(output_lines) if output_lines else ''
+
+    def _run_frida_script_oneshot(self, pid, script_content, timeout=10):
+        """回退方案:每次启动新 frida.exe 进程执行单个脚本"""
+        with tempfile.NamedTemporaryFile(mode='w', suffix='.js', delete=False, encoding='utf-8') as f:
+            f.write(script_content)
+            script_path = f.name
+        try:
+            frida_exe = self._get_frida_exe()
+
+            if hasattr(self, '_adb_serial') and self._adb_serial:
+                frida_cmd = [frida_exe, '-D', self._adb_serial, '-p', str(pid), '-l', script_path, '-q']
+            else:
+                frida_cmd = [frida_exe, '-U', '-p', str(pid), '-l', script_path, '-q']
+
+            process = subprocess.Popen(
+                frida_cmd,
+                stdin=subprocess.PIPE,
+                stdout=subprocess.PIPE,
+                stderr=subprocess.PIPE,
+                creationflags=_NO_WINDOW,
+            )
+            time.sleep(2)
+
+            process.stdin.close()
+            try:
+                stdout_bytes, stderr_bytes = process.communicate(timeout=timeout)
+            except subprocess.TimeoutExpired:
+                process.kill()
+                stdout_bytes, stderr_bytes = process.communicate()
+
+            stdout = stdout_bytes.decode('utf-8', errors='ignore') if stdout_bytes else ''
+            stderr = stderr_bytes.decode('utf-8', errors='ignore') if stderr_bytes else ''
+            return stdout + stderr
+        except Exception as e:
+            logger.warning(f'Frida脚本执行失败: {e}')
+            return None
+        finally:
+            try:
+                os.unlink(script_path)
+            except:
+                pass
+
+    def _try_extract_token(self, pid):
+        """尝试多次从内存提取 Token(GL_UID/GL_TOKEN/GL_DEVICEID),返回 dict 或 None。"""
+        for attempt in range(1, 4):
+            token_data = self._extract_token(pid)
+            if token_data:
+                return token_data
+            logger.warning(f'第{attempt}次获取Token失败,等待3秒后重试...')
+            if attempt < 3:
+                time.sleep(3)
+                new_pid = self._get_app_pid()
+                if new_pid:
+                    pid = new_pid
+                    self.frida_pid = pid
+        return None
+
+    def _extract_token(self, pid):
+        """通过 Frida 从内存中提取 GL 认证信息(UID/Token/DeviceId/Source)"""
+        script = """
+Java.perform(function() {
+    try {
+        var YXFDeviceInfo = Java.use('com.netease.gl.glbase.build.YXFDeviceInfo');
+        console.log('GL_DEVICEID:' + YXFDeviceInfo.getDeviceId());
+    } catch(e) {}
+
+    Java.choose('com.netease.gl.serviceaccount.proto.auth.GLAuth$Authed', {
+        onMatch: function(instance) {
+            var uid = instance.getUid();
+            var token = instance.getToken();
+            var source = instance.getSource();
+            if (uid && token) {
+                console.log('GL_UID:' + uid);
+                console.log('GL_TOKEN:' + token);
+                console.log('GL_SOURCE:' + source);
+            }
+        },
+        onComplete: function() {
+            console.log('__DONE__');
+        }
+    });
+});
+"""
+        output = self._run_frida_script(pid, script, timeout=15)
+        if not output:
+            logger.warning('Frida脚本无输出')
+            return None
+
+        data = {}
+        for line in output.split('\n'):
+            if 'GL_UID:' in line:
+                data['GL_UID'] = line.split('GL_UID:')[1].strip()
+            elif 'GL_TOKEN:' in line and 'GL_TOKEN' not in data:
+                data['GL_TOKEN'] = line.split('GL_TOKEN:')[1].strip()
+            elif 'GL_DEVICEID:' in line:
+                data['GL_DEVICEID'] = line.split('GL_DEVICEID:')[1].strip()
+            elif 'GL_SOURCE:' in line:
+                data['GL_SOURCE'] = line.split('GL_SOURCE:')[1].strip()
+
+        if data.get('GL_UID') and data.get('GL_TOKEN'):
+            # 版本号通过 ADB 获取
+            version = self._get_app_version()
+            if version:
+                data['GL_VERSION'] = version
+            return data
+        return None
+
+    def _frida_sign(self, url, body, headers=None):
+        if not self.frida_pid:
+            self.frida_pid = self._get_app_pid()
+        if not self.frida_pid:
+            logger.error('无法获取APP PID,请确保大神APP已打开')
+            return None
+
+        headers_code = ""
+        if headers:
+            for k, v in headers.items():
+                v = v.replace("'", "\\'")
+                headers_code += f"map.put('{k}', '{v}');\n"
+
+        body_escaped = body.replace("\\", "\\\\").replace("'", "\\'")
+
+        script = f"""
+Java.perform(function() {{
+    var Tools = Java.use('com.netease.nep.Tools');
+    var HashMap = Java.use('java.util.HashMap');
+    var map = HashMap.$new();
+    {headers_code}
+    var result = Tools.getPostMethodSignatures('{url}', '{body_escaped}', map);
+    console.log('SIGNED_URL:' + result);
+    console.log('__DONE__');
+}});
+"""
+        output = self._run_frida_script(self.frida_pid, script, timeout=15)
+        if not output:
+            return None
+
+        for line in output.split('\n'):
+            if 'SIGNED_URL:' in line:
+                return line.split('SIGNED_URL:')[1].strip()
+        return None
+
+    # ======================== 自动登录(读取auth数据库 + HTTP API) ========================
+
+    def _auto_login(self, pid):
+        """
+        自动登录流程:
+        1. 通过 ADB + sqlite3 直接读取 APP 的 auth 数据库,获取缓存的 URS 凭据
+        2. 使用 URS 凭据调用 login-by-urs-token API 获取新的 GL Token
+        前提:用户至少手动登录过一次(数据库中有缓存账号)。
+        返回 (pid, token_data) 元组。token_data 为 dict 或 None。
+        """
+        # 第1步:从 auth 数据库读取 URS 凭据
+        logger.info('从APP数据库读取URS凭据...')
+        urs_creds = self._get_urs_credentials(pid)
+        if not urs_creds:
+            logger.error('无法读取URS凭据,请确保已手动登录过大神APP')
+            return pid, None
+
+        logger.info(f'获取到URS凭据,账号: {urs_creds.get("AUTH_ACCOUNT", "unknown")}')
+        if urs_creds.get('GL_VERSION'):
+            self.gl_version = urs_creds['GL_VERSION']
+            logger.info(f'APP版本: {self.gl_version}')
+
+        # 第2步:调用 login-by-urs-token API
+        logger.info('调用登录API...')
+        token_data = self._login_by_urs_token(pid, urs_creds)
+        if token_data:
+            logger.info('自动登录成功!')
+            return self._get_app_pid(), token_data
+
+        logger.warning('登录API调用失败')
+        return self._get_app_pid(), None
+
+    def _get_urs_credentials(self, pid):
+        """通过 ADB 直接从 auth 数据库读取 URS 凭据(不需要 Frida)"""
+        try:
+            # 直接通过 ADB + su + sqlite3 读取 auth 数据库
+            sql = 'SELECT uid, token, account, ursAuthedToken, ursAuhtedId, authType FROM userauths LIMIT 1'
+            db_path = f'/data/data/{GL_PACKAGE}/databases/auth'
+            # 用单条字符串传给 adb shell,避免参数拆分导致 SQL 断裂
+            shell_cmd = f'su 0 sqlite3 {db_path} "{sql}"'
+            result = subprocess.run(
+                [ADB_PATH] + (['-s', self._adb_serial] if getattr(self, '_adb_serial', None) else []) +
+                ['shell', shell_cmd],
+                capture_output=True, text=True, timeout=10, creationflags=_NO_WINDOW
+            )
+            row = result.stdout.strip()
+            if not row or '|' not in row:
+                logger.warning('auth数据库为空或不可读')
+                return None
+
+            fields = row.split('|')
+            if len(fields) < 6:
+                logger.warning(f'auth数据库字段不足: {len(fields)}')
+                return None
+
+            data = {
+                'AUTH_UID': fields[0],
+                'AUTH_TOKEN': fields[1],
+                'AUTH_ACCOUNT': fields[2],
+                'AUTH_URS_TOKEN': fields[3],
+                'AUTH_URS_ID': fields[4],
+                'AUTH_TYPE': fields[5],
+            }
+
+            # 通过 ADB 获取 UDID (android_id)
+            udid = self._adb_shell(['settings', 'get', 'secure', 'android_id'])
+            if udid:
+                data['UDID'] = udid
+
+            # 通过 ADB 获取 APP 版本号
+            version = self._get_app_version()
+            if version:
+                data['GL_VERSION'] = version
+
+            # DeviceId 通过 Frida 获取
+            device_id = self._get_device_id(pid)
+            if device_id:
+                data['GL_DEVICEID'] = device_id
+
+            if data.get('AUTH_URS_TOKEN') and data.get('AUTH_URS_ID'):
+                return data
+
+            logger.warning('数据库中无有效的URS凭据')
+            return None
+        except Exception as e:
+            logger.warning(f'读取URS凭据失败: {e}')
+            return None
+
+    def _get_app_version(self):
+        """通过 ADB dumpsys 获取 APP 版本号"""
+        try:
+            output = self._adb_shell([
+                f'dumpsys package {GL_PACKAGE} | grep versionName'
+            ])
+            for line in output.split('\n'):
+                if 'versionName=' in line:
+                    return line.split('versionName=')[1].strip()
+        except Exception:
+            pass
+        return None
+
+    def _get_device_id(self, pid):
+        """通过 Frida 获取 DeviceId"""
+        script = """
+Java.perform(function() {
+    try {
+        var YXFDeviceInfo = Java.use('com.netease.gl.glbase.build.YXFDeviceInfo');
+        console.log('GL_DEVICEID:' + YXFDeviceInfo.getDeviceId());
+    } catch(e) {}
+    console.log('__DONE__');
+});
+"""
+        output = self._run_frida_script(pid, script, timeout=10)
+        if output:
+            for line in output.split('\n'):
+                if 'GL_DEVICEID:' in line:
+                    return line.split('GL_DEVICEID:')[1].strip()
+        return None
+
+    def _login_by_urs_token(self, pid, urs_creds):
+        """使用 URS 凭据调用 login-by-urs-token API 获取新的 GL Token"""
+        base_url = f"{LOGIN_BASE}/v1/app/base/user/login-by-urs-token"
+        device_id = urs_creds.get('GL_DEVICEID', '')
+        udid = urs_creds.get('UDID', '')
+
+        payload = {
+            "urs": {
+                "id": urs_creds['AUTH_URS_ID'],
+                "token": urs_creds['AUTH_URS_TOKEN'],
+                "type": int(urs_creds.get('AUTH_TYPE', '30'))
+            },
+            "account": urs_creds['AUTH_ACCOUNT'],
+            "clientType": int(GL_CLIENTTYPE),
+            "deviceId": device_id,
+            "os": "android",
+            "version": self.gl_version,
+            "osVersion": "12",
+            "device": "SDY-AN00",
+            "udid": udid,
+            "unisdkDeviceId": udid,
+            "autoLogin": False
+        }
+
+        body_str = json.dumps(payload)
+        nonce = self._generate_nonce()
+        sign_headers = {
+            "GL-ClientType": GL_CLIENTTYPE,
+            "GL-DeviceId": device_id,
+            "GL-Nonce": nonce,
+        }
+
+        # 需要 Frida 签名
+        self.frida_pid = pid
+        signed_url = self._frida_sign(base_url, body_str, sign_headers)
+        if not signed_url:
+            logger.warning('登录请求签名失败')
+            return None
+
+        headers = {
+            "Content-Type": "application/json; charset=utf-8",
+            "User-Agent": "okhttp/4.9.1",
+            "gl-clienttype": GL_CLIENTTYPE,
+            "gl-deviceid": device_id,
+            "gl-version": self.gl_version,
+            "gl-nonce": nonce,
+            "gl-curtime": str(int(time.time())),
+        }
+
+        try:
+            resp = self.session.post(signed_url, json=payload, headers=headers, timeout=15)
+            data = resp.json()
+
+            if data.get('code') == 200:
+                result = data.get('result', {})
+                token = result.get('token', '')
+                uid = result.get('userInfo', {}).get('user', {}).get('uid', '')
+                source = result.get('source', 'URS')
+                if uid and token:
+                    logger.info(f'登录成功! Token: {token[:16]}...')
+                    return {
+                        'GL_UID': uid,
+                        'GL_TOKEN': token,
+                        'GL_SOURCE': source,
+                        'GL_DEVICEID': device_id,
+                    }
+                logger.warning('登录API返回200但缺少uid或token')
+                return None
+            else:
+                logger.warning(f'登录失败: code={data.get("code")}, msg={data.get("errmsg")}')
+                return None
+        except Exception as e:
+            logger.warning(f'登录请求异常: {e}')
+            return None
+
+    # ======================== HTTP API ========================
+
+    def _get_role_info(self):
+        """通过大神API获取绑定的阴阳师角色信息"""
+        url = f"{LOGIN_BASE}/v1/app/gameRole/getBindList"
+        payload = {"uid": self.gl_uid}
+
+        try:
+            resp = self.session.post(url, json=payload, headers=self._build_headers(), timeout=15)
+            data = resp.json()
+            if data.get('code') != 200:
+                logger.warning(f'获取角色信息失败: {data.get("errmsg")}')
+                return None
+
+            roles = data.get('result', [])
+            for role in roles:
+                if role.get('appKey') == self.app_key:
+                    role_id = role.get('roleId', '')
+                    server = role.get('server', '')
+                    if role_id:
+                        logger.info(f'API获取角色成功: {role_id} @ {server}')
+                        return {'roleId': role_id, 'server': server}
+
+            if roles:
+                logger.warning(f'找到 {len(roles)} 个绑定角色,但无 appKey={self.app_key} 的角色')
+            else:
+                logger.warning('未找到任何绑定角色')
+            return None
+        except Exception as e:
+            logger.warning(f'获取角色信息异常: {e}')
+            return None
+
+    def _is_token_expired(self, code, msg):
+        """判断API返回是否表示Token已过期"""
+        if code in [802, 805]:
+            return True
+        if msg and ('其他设备' in msg or '登录' in msg or '过期' in msg or '失效' in msg):
+            return True
+        return False
+
+    def _relogin(self):
+        """Token过期时重新登录,更新 self 上的凭据。返回是否成功。"""
+        logger.warning('Token已失效,尝试重新登录...')
+        pid = self.frida_pid or self._get_app_pid()
+        if not pid:
+            logger.error('重新登录失败:APP未运行')
+            return False
+        _, token_data = self._auto_login(pid)
+        if not token_data:
+            logger.error('重新登录失败')
+            return False
+        self.gl_uid = token_data.get('GL_UID', '')
+        self.gl_token = token_data.get('GL_TOKEN', '')
+        self.gl_deviceid = token_data.get('GL_DEVICEID', self.gl_deviceid)
+        self.gl_source = token_data.get('GL_SOURCE', 'URS')
+        logger.info(f'重新登录成功! 新Token: {self.gl_token[:16]}...')
+        return True
+
+    def _generate_nonce(self):
+        return str(random.randint(-9000000000000000000, 9000000000000000000))
+
+    def _build_headers(self, nonce=None):
+        if not nonce:
+            nonce = self._generate_nonce()
+        return {
+            "Content-Type": "application/json",
+            "Accept": "application/json",
+            "User-Agent": "okhttp/4.9.1",
+            "gl-version": self.gl_version,
+            "gl-source": self.gl_source,
+            "gl-deviceid": self.gl_deviceid,
+            "gl-token": self.gl_token,
+            "gl-clienttype": GL_CLIENTTYPE,
+            "gl-uid": self.gl_uid,
+            "gl-nonce": nonce,
+            "Origin": "https://act.ds.163.com",
+            "Referer": "https://act.ds.163.com/",
+        }
+
+    def _get_rewards(self):
+        url = f"{WELFARE_BASE}/v1/welfare/getAppInfos"
+        payload = {
+            "appKey": self.app_key,
+            "roleId": self.role_id,
+            "server": self.server,
+        }
+        try:
+            resp = self.session.post(url, json=payload, headers=self._build_headers(), timeout=15)
+            data = resp.json()
+
+            code = data.get('code')
+            msg = data.get('errmsg', '')
+
+            # Token过期,重新登录后重试
+            if code != 200 and self._is_token_expired(code, msg):
+                if self._relogin():
+                    resp = self.session.post(url, json=payload, headers=self._build_headers(), timeout=15)
+                    data = resp.json()
+                    code = data.get('code')
+                    msg = data.get('errmsg', '')
+
+            if code != 200:
+                logger.warning(f'获取礼包失败: {msg}')
+                return []
+
+            rewards = []
+            for app_info in data.get('result', []):
+                for bag in app_info.get('rewardBags', []):
+                    bag_id = bag.get('id')
+                    title = bag.get('title', '')
+                    completed = bag.get('completed', False)
+                    has_apply = bag.get('hasApplay', False)
+                    desc = bag.get('fixedRewardDesc', '')
+
+                    if has_apply:
+                        logger.info(f'  [已领取] {title}')
+                    elif completed:
+                        logger.info(f'  [可领取] {title} - {desc}')
+                        rewards.append({'id': bag_id, 'title': title})
+                    else:
+                        logger.info(f'  [未完成] {title}')
+
+            return rewards
+
+        except Exception as e:
+            logger.error(f'获取礼包请求异常: {e}')
+            return []
+
+    def _claim_reward(self, bag_id, title):
+        base_url = f"{WELFARE_BASE}/v1/welfare/applyRewardV2"
+        payload = {
+            "appKey": self.app_key,
+            "rewardBagId": bag_id,
+            "roleId": self.role_id,
+            "server": self.server,
+        }
+
+        nonce = self._generate_nonce()
+        sign_headers = {
+            "GL-ClientType": GL_CLIENTTYPE,
+            "GL-DeviceId": self.gl_deviceid,
+            "GL-Nonce": nonce,
+            "GL-Token": self.gl_token,
+            "GL-Uid": self.gl_uid,
+        }
+
+        logger.info(f'  正在领取: {title}...')
+        signed_url = self._frida_sign(base_url, json.dumps(payload), sign_headers)
+
+        if not signed_url:
+            logger.warning(f'  签名失败: {title}')
+            return False
+
+        try:
+            headers = self._build_headers(nonce)
+            resp = self.session.post(signed_url, json=payload, headers=headers, timeout=15)
+            data = resp.json()
+
+            code = data.get('code')
+            msg = data.get('errmsg', '')
+
+            if code == 200:
+                logger.info(f'  领取成功: {title}')
+                return True
+            elif code == 801 or '已领取' in msg:
+                logger.info(f'  已领取过: {title}')
+            elif self._is_token_expired(code, msg):
+                # Token过期,重新登录后重试
+                if self._relogin():
+                    logger.info(f'  重试领取: {title}...')
+                    nonce = self._generate_nonce()
+                    sign_headers["GL-Token"] = self.gl_token
+                    sign_headers["GL-Nonce"] = nonce
+                    signed_url = self._frida_sign(base_url, json.dumps(payload), sign_headers)
+                    if signed_url:
+                        resp2 = self.session.post(signed_url, json=payload,
+                                                  headers=self._build_headers(nonce), timeout=15)
+                        data2 = resp2.json()
+                        if data2.get('code') == 200:
+                            logger.info(f'  领取成功: {title}')
+                            return True
+                        logger.warning(f'  重试失败: {title} - {data2.get("errmsg")}')
+            else:
+                logger.warning(f'  领取失败: {title} - {msg}')
+
+        except Exception as e:
+            logger.error(f'  领取异常: {title} - {e}')
+
+        return False

+ 12 - 8
tasks/Component/Costume/config.py

@@ -1,7 +1,7 @@
 # This Python file uses the following encoding: utf-8
 # @author runhey
 # github https://github.com/runhey
-from pydantic import BaseModel, Field
+from pydantic import BaseModel, Field, field_validator
 from enum import Enum
 
 # 庭院皮肤
@@ -24,16 +24,12 @@ class MainType(str, Enum):
 # 结界皮肤
 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'  # 花海繁生
-    COSTUME_REALM_5 = 'costume_realm_5'  # 莲心梦乡
 
 # 鲤鱼旗皮肤
 class CarpBannerType(str, Enum):
     COSTUME_CARPBANNER_DEFAULT = 'costume_carpbanner_default'  # 吉鲤游风
-    COSTUME_CARPBANNER_1 = 'costume_carpbanner_1'  # 无垢莲台(仅适配莲心梦乡)
+    COSTUME_CARPBANNER_1 = 'costume_carpbanner_1'  # 无垢莲台
+    COSTUME_CARPBANNER_2 = 'costume_carpbanner_2'  # 萤灯月夜
 
 # 主题,就是庭院最右下角的展开按钮
 class ThemeType(str, Enum):
@@ -77,12 +73,20 @@ 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_carpbanner_type: CarpBannerType = Field(default=CarpBannerType.COSTUME_CARPBANNER_DEFAULT,description='costume_realm_type_help')
+    costume_carpbanner_type: CarpBannerType = Field(default=CarpBannerType.COSTUME_CARPBANNER_DEFAULT,description='costume_carpbanner_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')
 
+    @field_validator('costume_realm_type', mode='after')
+    @classmethod
+    def validator_realm(cls, v: RealmType) -> RealmType:
+        return RealmType.COSTUME_REALM_DEFAULT
+
+
+
+
 
 
 

+ 1 - 34
tasks/Component/Costume/costume_base.py

@@ -8,7 +8,6 @@ from module.logger import logger
 from tasks.Component.Costume.config import (MainType, CostumeConfig, RealmType,
                                             ThemeType, ShikigamiType, SignType, BattleType, CarpBannerType)
 from tasks.Component.Costume.assets import CostumeAssets
-from tasks.Component.CostumeRealm.assets import CostumeRealmAssets
 from tasks.Component.CostumeBattle.assets import CostumeBattleAssets
 from tasks.Component.CostumeShikigami.assets import CostumeShikigamiAssets
 from tasks.Component.CostumeCarpBanner.assets import CostumeCarpBannerAssets
@@ -26,31 +25,13 @@ main_costume_model = {
 }
 
 
-# 结界皮肤
-realm_costume_model = {
-    getattr(RealmType, f"COSTUME_REALM_{i}"): {
-        'I_SHI_CARD': f'I_SHI_CARD_{i}',
-        'I_SHI_DEFENSE': f'I_SHI_DEFENSE_{i}',
-        'I_SHI_GROWN': f'I_SHI_GROWN_{i}',
-        'I_CARD_EXP': f'I_CARD_EXP_{i}',
-        'I_BOX_AP': f'I_BOX_AP_{i}',
-        'I_BOX_EXP': f'I_BOX_EXP_{i}',
-        'I_REALM_SHIN': f'I_REALM_SHIN_{i}',
-        'I_UTILIZE_EXP': f'I_UTILIZE_EXP_{i}',
-        'I_BOX_EXP_MAX': f'I_BOX_EXP_MAX_{i}',
-    } for i in range(1, 6)
-}
-
-
 # 鲤鱼旗皮肤
 carpbanner_costume_model = {
     getattr(CarpBannerType, f"COSTUME_CARPBANNER_{i}"): {
         'I_SHI_CARD': f'I_SHI_CARD_{i}',
         'I_SHI_DEFENSE': f'I_SHI_DEFENSE_{i}',
         'I_SHI_GROWN': f'I_SHI_GROWN_{i}',
-        'I_CARD_EXP': f'I_CARD_EXP_{i}',
-        'I_UTILIZE_EXP': f'I_UTILIZE_EXP_{i}',
-    } for i in range(1, 2)
+    } for i in range(1, 3)
 }
 
 
@@ -104,7 +85,6 @@ class CostumeBase:
         if config is None:
             config: CostumeConfig = self.config.model.global_game.costume_config
         self.check_costume_main(config.costume_main_type)
-        self.check_costume_realm(config.costume_realm_type)
         self.check_costume_carpbanner(config.costume_carpbanner_type)
         self.check_costume_battle(config.costume_battle_type)
         self.check_costume_shikigami(config.costume_shikigami_type)
@@ -146,19 +126,6 @@ class CostumeBase:
             # 执行替换(覆盖结界皮肤的同名key)
             self.replace_img(key, assert_value)
 
-    def check_costume_realm(self, realm_type: RealmType):
-        if realm_type == RealmType.COSTUME_REALM_DEFAULT:
-            return
-        logger.info(f'Switch realm theme {realm_type}')
-        costume_realm_assets = CostumeRealmAssets()
-        model = realm_costume_model.get(realm_type, {})
-        for key, value in model.items():
-            if not hasattr(costume_realm_assets, value):
-                logger.warning(f'Realm asset {value} not found, skip')
-                continue
-            assert_value: RuleImage = getattr(costume_realm_assets, value)
-            self.replace_img(key, assert_value)
-
     def check_costume_battle(self, battle_type: BattleType):
         if battle_type == BattleType.COSTUME_BATTLE_DEFAULT:
             return

+ 12 - 7
tasks/Component/CostumeCarpBanner/assets.py

@@ -12,14 +12,19 @@ class CostumeCarpBannerAssets:
 
 	# Image Rule Assets
 	# 育成 
-	I_SHI_GROWN_1 = RuleImage(roi_front=(602,339,26,37), roi_back=(524,269,181,198), threshold=0.6, method="Template matching", file="./tasks/Component/CostumeCarpBanner/cb1/cb1_shi_grown_1.png")
+	I_SHI_GROWN_1 = RuleImage(roi_front=(572,272,21,33), roi_back=(530,220,202,267), threshold=0.5, method="Template matching", file="./tasks/Component/CostumeCarpBanner/cb1/cb1_shi_grown_1.png")
 	# 结界卡 
-	I_SHI_CARD_1 = RuleImage(roi_front=(887,335,15,35), roi_back=(854,306,87,120), threshold=0.6, method="Template matching", file="./tasks/Component/CostumeCarpBanner/cb1/cb1_shi_card_1.png")
+	I_SHI_CARD_1 = RuleImage(roi_front=(911,262,20,33), roi_back=(823,210,252,297), threshold=0.5, method="Template matching", file="./tasks/Component/CostumeCarpBanner/cb1/cb1_shi_card_1.png")
 	# 防守 
-	I_SHI_DEFENSE_1 = RuleImage(roi_front=(269,335,24,46), roi_back=(200,277,154,166), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeCarpBanner/cb1/cb1_shi_defense_1.png")
-	# 收取经验(没有满的图) 
-	I_CARD_EXP_1 = RuleImage(roi_front=(875,181,57,54), roi_back=(803,111,199,185), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeCarpBanner/cb1/cb1_card_exp_1.png")
-	# 寄养别人的经验 
-	I_UTILIZE_EXP_1 = RuleImage(roi_front=(589,187,58,43), roi_back=(539,144,156,123), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeCarpBanner/cb1/cb1_utilize_exp_1.png")
+	I_SHI_DEFENSE_1 = RuleImage(roi_front=(216,258,22,33), roi_back=(178,209,261,274), threshold=0.6, method="Template matching", file="./tasks/Component/CostumeCarpBanner/cb1/cb1_shi_defense_1.png")
+
+
+	# Image Rule Assets
+	# 育成 
+	I_SHI_GROWN_2 = RuleImage(roi_front=(585,336,21,38), roi_back=(519,212,220,281), threshold=0.5, method="Template matching", file="./tasks/Component/CostumeCarpBanner/cb2/cb2_shi_grown_2.png")
+	# 结界卡 
+	I_SHI_CARD_2 = RuleImage(roi_front=(871,341,20,36), roi_back=(823,210,252,297), threshold=0.5, method="Template matching", file="./tasks/Component/CostumeCarpBanner/cb2/cb2_shi_card_2.png")
+	# 防守 
+	I_SHI_DEFENSE_2 = RuleImage(roi_front=(287,343,19,38), roi_back=(178,209,261,274), threshold=0.5, method="Template matching", file="./tasks/Component/CostumeCarpBanner/cb2/cb2_shi_defense_2.png")
 
 

BIN
tasks/Component/CostumeCarpBanner/cb1/cb1_card_exp_1.png


BIN
tasks/Component/CostumeCarpBanner/cb1/cb1_shi_card_1.png


BIN
tasks/Component/CostumeCarpBanner/cb1/cb1_shi_defense_1.png


BIN
tasks/Component/CostumeCarpBanner/cb1/cb1_shi_grown_1.png


BIN
tasks/Component/CostumeCarpBanner/cb1/cb1_utilize_exp_1.png


+ 9 - 27
tasks/Component/CostumeCarpBanner/cb1/image.json

@@ -2,46 +2,28 @@
   {
     "itemName": "shi_grown_1",
     "imageName": "cb1_shi_grown_1.png",
-    "roiFront": "602,339,26,37",
-    "roiBack": "524,269,181,198",
+    "roiFront": "572,272,21,33",
+    "roiBack": "530,220,202,267",
     "method": "Template matching",
-    "threshold": 0.6,
+    "threshold": 0.5,
     "description": "育成"
   },
   {
     "itemName": "shi_card_1",
     "imageName": "cb1_shi_card_1.png",
-    "roiFront": "887,335,15,35",
-    "roiBack": "854,306,87,120",
+    "roiFront": "911,262,20,33",
+    "roiBack": "823,210,252,297",
     "method": "Template matching",
-    "threshold": 0.6,
+    "threshold": 0.5,
     "description": "结界卡"
   },
   {
     "itemName": "shi_defense_1",
     "imageName": "cb1_shi_defense_1.png",
-    "roiFront": "269,335,24,46",
-    "roiBack": "200,277,154,166",
+    "roiFront": "216,258,22,33",
+    "roiBack": "178,209,261,274",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.6,
     "description": "防守"
-  },
-  {
-    "itemName": "card_exp_1",
-    "imageName": "cb1_card_exp_1.png",
-    "roiFront": "875,181,57,54",
-    "roiBack": "803,111,199,185",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "收取经验(没有满的图)"
-  },
-  {
-    "itemName": "utilize_exp_1",
-    "imageName": "cb1_utilize_exp_1.png",
-    "roiFront": "589,187,58,43",
-    "roiBack": "539,144,156,123",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "寄养别人的经验"
   }
 ]

BIN
tasks/Component/CostumeCarpBanner/cb2/cb2_shi_card_2.png


BIN
tasks/Component/CostumeCarpBanner/cb2/cb2_shi_defense_2.png


BIN
tasks/Component/CostumeCarpBanner/cb2/cb2_shi_grown_2.png


+ 29 - 0
tasks/Component/CostumeCarpBanner/cb2/image.json

@@ -0,0 +1,29 @@
+[
+  {
+    "itemName": "shi_grown_2",
+    "imageName": "cb2_shi_grown_2.png",
+    "roiFront": "585,336,21,38",
+    "roiBack": "519,212,220,281",
+    "method": "Template matching",
+    "threshold": 0.5,
+    "description": "育成"
+  },
+  {
+    "itemName": "shi_card_2",
+    "imageName": "cb2_shi_card_2.png",
+    "roiFront": "871,341,20,36",
+    "roiBack": "823,210,252,297",
+    "method": "Template matching",
+    "threshold": 0.5,
+    "description": "结界卡"
+  },
+  {
+    "itemName": "shi_defense_2",
+    "imageName": "cb2_shi_defense_2.png",
+    "roiFront": "287,343,19,38",
+    "roiBack": "178,209,261,274",
+    "method": "Template matching",
+    "threshold": 0.5,
+    "description": "防守"
+  }
+]

+ 0 - 30
tasks/Component/CostumeRealm/README.md

@@ -1,30 +0,0 @@
-
-用于存放测试结果,但是这样也不是办法
-### 1
-```
-Image                  Count
-REALM_SHI_GROWN        4 times
-REALM1_SHI_CARD_1      5 times
-REALM1_SHI_DEFENSE_1   5 times
-REALM_REALM_SHIN       5 times
-REALM_CARD_EXP         5 times
-REALM_BOX_AP           5 times
-REALM_BOX_EXP          5 times
-REALM_BOX_EXP_MAX      0 times
-REALM_UTILIZE_EXP      0 times
-```
-
-### 2
-```
-Image                  Count
-REALM2_SHI_GROWN_2     4 times
-REALM2_SHI_CARD_2      5 times
-REALM2_SHI_DEFENSE_2   5 times
-REALM_REALM_SHIN       5 times
-REALM_CARD_EXP         5 times
-REALM2_BOX_AP_2        5 times
-REALM2_BOX_EXP_2       5 times
-REALM_BOX_EXP_MAX      0 times
-REALM_UTILIZE_EXP      0 times
-```
-

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

@@ -1,117 +0,0 @@
-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
-	# 育成 
-	I_SHI_GROWN_1 = RuleImage(roi_front=(621,300,35,38), roi_back=(553,253,181,198), threshold=0.6, method="Template matching", file="./tasks/Component/CostumeRealm/realm1/realm1_shi_grown_1.png")
-	# 结界卡 
-	I_SHI_CARD_1 = RuleImage(roi_front=(923,302,38,56), roi_back=(902,288,87,120), threshold=0.6, method="Template matching", file="./tasks/Component/CostumeRealm/realm1/realm1_shi_card_1.png")
-	# 防守 
-	I_SHI_DEFENSE_1 = RuleImage(roi_front=(309,299,31,62), roi_back=(252,266,154,166), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm1/realm1_shi_defense_1.png")
-	# 收取经验(没有满的图) 
-	I_CARD_EXP_1 = RuleImage(roi_front=(918,142,57,54), roi_back=(849,86,199,185), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm1/realm1_card_exp_1.png")
-	# 收取体力(没有满) 
-	I_BOX_AP_1 = RuleImage(roi_front=(813,384,51,46), roi_back=(735,305,202,204), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm1/realm1_box_ap_1.png")
-	# 收取盒子的经验(没有满) 
-	I_BOX_EXP_1 = RuleImage(roi_front=(899,390,42,45), roi_back=(854,348,147,127), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm1/realm1_box_exp_1.png")
-	# 结界皮肤 
-	I_REALM_SHIN_1 = RuleImage(roi_front=(161,389,54,58), roi_back=(0,273,360,276), threshold=0.9, method="Template matching", file="./tasks/Component/CostumeRealm/realm1/realm1_realm_shin_1.png")
-	# 寄养别人的经验 
-	I_UTILIZE_EXP_1 = RuleImage(roi_front=(616,143,58,43), roi_back=(566,101,156,123), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm1/realm1_utilize_exp_1.png")
-	# 盒子经验满 
-	I_BOX_EXP_MAX_1 = RuleImage(roi_front=(893,376,56,61), roi_back=(803,317,228,186), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm1/realm1_box_exp_max_1.png")
-
-
-	# Image Rule Assets
-	# 育成 
-	I_SHI_GROWN_2 = RuleImage(roi_front=(665,354,35,38), roi_back=(588,299,181,198), threshold=0.6, method="Template matching", file="./tasks/Component/CostumeRealm/realm2/realm2_shi_grown_2.png")
-	# 结界卡 
-	I_SHI_CARD_2 = RuleImage(roi_front=(935,354,32,56), roi_back=(913,329,87,120), threshold=0.6, method="Template matching", file="./tasks/Component/CostumeRealm/realm2/realm2_shi_card_2.png")
-	# 防守 
-	I_SHI_DEFENSE_2 = RuleImage(roi_front=(371,368,31,62), roi_back=(300,321,154,166), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm2/realm2_shi_defense_2.png")
-	# 收取经验(没有满的图) 
-	I_CARD_EXP_2 = RuleImage(roi_front=(935,223,57,54), roi_back=(873,151,199,185), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm2/realm2_card_exp_2.png")
-	# 收取体力(没有满) 
-	I_BOX_AP_2 = RuleImage(roi_front=(927,448,51,46), roi_back=(863,367,202,204), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm2/realm2_box_ap_2.png")
-	# 收取盒子的经验(没有满) 
-	I_BOX_EXP_2 = RuleImage(roi_front=(990,457,42,45), roi_back=(953,414,147,127), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm2/realm2_box_exp_2.png")
-	# 结界皮肤 
-	I_REALM_SHIN_2 = RuleImage(roi_front=(157,503,54,58), roi_back=(7,386,360,276), threshold=0.9, method="Template matching", file="./tasks/Component/CostumeRealm/realm2/realm2_realm_shin_2.png")
-	# 寄养别人的经验 
-	I_UTILIZE_EXP_2 = RuleImage(roi_front=(659,218,58,43), roi_back=(609,174,156,123), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm2/realm2_utilize_exp_2.png")
-	# 盒子经验满 
-	I_BOX_EXP_MAX_2 = RuleImage(roi_front=(991,443,48,51), roi_back=(893,378,228,186), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm2/realm2_box_exp_max_2.png")
-
-
-	# Image Rule Assets
-	# 育成 
-	I_SHI_GROWN_3 = RuleImage(roi_front=(605,304,35,38), roi_back=(530,247,181,198), threshold=0.6, method="Template matching", file="./tasks/Component/CostumeRealm/realm3/realm3_shi_grown_3.png")
-	# 结界卡 
-	I_SHI_CARD_3 = RuleImage(roi_front=(935,295,38,56), roi_back=(910,282,87,120), threshold=0.6, method="Template matching", file="./tasks/Component/CostumeRealm/realm3/realm3_shi_card_3.png")
-	# 防守 
-	I_SHI_DEFENSE_3 = RuleImage(roi_front=(253,309,31,62), roi_back=(200,269,154,166), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm3/realm3_shi_defense_3.png")
-	# 收取经验(没有满的图) 
-	I_CARD_EXP_3 = RuleImage(roi_front=(939,147,50,54), roi_back=(864,86,199,185), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm3/realm3_card_exp_3.png")
-	# 收取体力(没有满) 
-	I_BOX_AP_3 = RuleImage(roi_front=(949,376,51,46), roi_back=(872,298,202,204), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm3/realm3_box_ap_3.png")
-	# 收取盒子的经验(没有满) 
-	I_BOX_EXP_3 = RuleImage(roi_front=(1012,390,42,45), roi_back=(962,347,147,127), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm3/realm3_box_exp_3.png")
-	# 结界皮肤 
-	I_REALM_SHIN_3 = RuleImage(roi_front=(160,401,54,58), roi_back=(0,290,360,276), threshold=0.9, method="Template matching", file="./tasks/Component/CostumeRealm/realm3/realm3_realm_shin_3.png")
-	# 寄养别人的经验 
-	I_UTILIZE_EXP_3 = RuleImage(roi_front=(595,151,58,43), roi_back=(543,113,156,123), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm3/realm3_utilize_exp_3.png")
-	# 盒子经验满 
-	I_BOX_EXP_MAX_3 = RuleImage(roi_front=(1012,374,49,50), roi_back=(919,317,228,186), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm3/realm3_box_exp_max_3.png")
-
-
-	# Image Rule Assets
-	# 育成 
-	I_SHI_GROWN_4 = RuleImage(roi_front=(609,323,27,38), roi_back=(532,250,181,198), threshold=0.6, method="Template matching", file="./tasks/Component/CostumeRealm/realm4/realm4_shi_grown_4.png")
-	# 结界卡 
-	I_SHI_CARD_4 = RuleImage(roi_front=(929,315,38,56), roi_back=(904,299,87,120), threshold=0.6, method="Template matching", file="./tasks/Component/CostumeRealm/realm4/realm4_shi_card_4.png")
-	# 防守 
-	I_SHI_DEFENSE_4 = RuleImage(roi_front=(242,320,31,62), roi_back=(184,276,154,166), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm4/realm4_shi_defense_4.png")
-	# 收取经验(没有满的图) 
-	I_CARD_EXP_4 = RuleImage(roi_front=(930,181,57,54), roi_back=(855,111,199,185), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm4/realm4_card_exp_4.png")
-	# 收取体力(没有满) 
-	I_BOX_AP_4 = RuleImage(roi_front=(958,386,51,46), roi_back=(889,313,202,204), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm4/realm4_box_ap_4.png")
-	# 收取盒子的经验(没有满) 
-	I_BOX_EXP_4 = RuleImage(roi_front=(1022,394,32,45), roi_back=(968,353,147,127), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm4/realm4_box_exp_4.png")
-	# 结界皮肤 
-	I_REALM_SHIN_4 = RuleImage(roi_front=(228,406,54,58), roi_back=(60,293,360,276), threshold=0.9, method="Template matching", file="./tasks/Component/CostumeRealm/realm4/realm4_realm_shin_4.png")
-	# 寄养别人的经验 
-	I_UTILIZE_EXP_4 = RuleImage(roi_front=(596,181,58,43), roi_back=(545,144,156,123), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm4/realm4_utilize_exp_4.png")
-	# 盒子经验满 
-	I_BOX_EXP_MAX_4 = RuleImage(roi_front=(1026,381,41,51), roi_back=(934,323,228,186), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm4/realm4_box_exp_max_4.png")
-
-
-	# Image Rule Assets
-	# 育成 
-	I_SHI_GROWN_5 = RuleImage(roi_front=(642,356,35,38), roi_back=(568,295,181,198), threshold=0.6, method="Template matching", file="./tasks/Component/CostumeRealm/realm5/realm5_shi_grown_5.png")
-	# 结界卡 
-	I_SHI_CARD_5 = RuleImage(roi_front=(925,358,38,56), roi_back=(901,333,87,120), threshold=0.6, method="Template matching", file="./tasks/Component/CostumeRealm/realm5/realm5_shi_card_5.png")
-	# 防守 
-	I_SHI_DEFENSE_5 = RuleImage(roi_front=(312,356,31,62), roi_back=(257,310,154,166), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm5/realm5_shi_defense_5.png")
-	# 收取经验(没有满的图) 
-	I_CARD_EXP_5 = RuleImage(roi_front=(922,216,57,54), roi_back=(850,145,199,185), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm5/realm5_card_exp_5.png")
-	# 收取体力(没有满) 
-	I_BOX_AP_5 = RuleImage(roi_front=(981,420,51,46), roi_back=(925,345,202,204), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm5/realm5_box_ap_5.png")
-	# 收取盒子的经验(没有满) 
-	I_BOX_EXP_5 = RuleImage(roi_front=(1050,430,42,45), roi_back=(996,382,147,127), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm5/realm5_box_exp_5.png")
-	# 结界皮肤 
-	I_REALM_SHIN_5 = RuleImage(roi_front=(237,411,54,58), roi_back=(95,303,360,276), threshold=0.9, method="Template matching", file="./tasks/Component/CostumeRealm/realm5/realm5_realm_shin_5.png")
-	# 寄养别人的经验 
-	I_UTILIZE_EXP_5 = RuleImage(roi_front=(632,216,58,43), roi_back=(582,172,156,123), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeRealm/realm5/realm5_utilize_exp_5.png")
-	# 盒子经验满 
-	I_BOX_EXP_MAX_5 = RuleImage(roi_front=(1048,420,48,56), roi_back=(958,353,228,186), threshold=0.7, method="Template matching", file="./tasks/Component/CostumeRealm/realm5/realm5_box_exp_max_5.png")
-
-

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

@@ -1,83 +0,0 @@
-[
-  {
-    "itemName": "shi_grown_1",
-    "imageName": "realm1_shi_grown_1.png",
-    "roiFront": "621,300,35,38",
-    "roiBack": "553,253,181,198",
-    "method": "Template matching",
-    "threshold": 0.6,
-    "description": "育成"
-  },
-  {
-    "itemName": "shi_card_1",
-    "imageName": "realm1_shi_card_1.png",
-    "roiFront": "923,302,38,56",
-    "roiBack": "902,288,87,120",
-    "method": "Template matching",
-    "threshold": 0.6,
-    "description": "结界卡"
-  },
-  {
-    "itemName": "shi_defense_1",
-    "imageName": "realm1_shi_defense_1.png",
-    "roiFront": "309,299,31,62",
-    "roiBack": "252,266,154,166",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "防守"
-  },
-  {
-    "itemName": "card_exp_1",
-    "imageName": "realm1_card_exp_1.png",
-    "roiFront": "918,142,57,54",
-    "roiBack": "849,86,199,185",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "收取经验(没有满的图)"
-  },
-  {
-    "itemName": "box_ap_1",
-    "imageName": "realm1_box_ap_1.png",
-    "roiFront": "813,384,51,46",
-    "roiBack": "735,305,202,204",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "收取体力(没有满)"
-  },
-  {
-    "itemName": "box_exp_1",
-    "imageName": "realm1_box_exp_1.png",
-    "roiFront": "899,390,42,45",
-    "roiBack": "854,348,147,127",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "收取盒子的经验(没有满)"
-  },
-  {
-    "itemName": "realm_shin_1",
-    "imageName": "realm1_realm_shin_1.png",
-    "roiFront": "161,389,54,58",
-    "roiBack": "0,273,360,276",
-    "method": "Template matching",
-    "threshold": 0.9,
-    "description": "结界皮肤"
-  },
-  {
-    "itemName": "utilize_exp_1",
-    "imageName": "realm1_utilize_exp_1.png",
-    "roiFront": "616,143,58,43",
-    "roiBack": "566,101,156,123",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "寄养别人的经验"
-  },
-  {
-    "itemName": "box_exp_max_1",
-    "imageName": "realm1_box_exp_max_1.png",
-    "roiFront": "893,376,56,61",
-    "roiBack": "803,317,228,186",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "盒子经验满"
-  }
-]

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


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


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


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


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


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


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


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


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


+ 0 - 83
tasks/Component/CostumeRealm/realm2/image.json

@@ -1,83 +0,0 @@
-[
-  {
-    "itemName": "shi_grown_2",
-    "imageName": "realm2_shi_grown_2.png",
-    "roiFront": "665,354,35,38",
-    "roiBack": "588,299,181,198",
-    "method": "Template matching",
-    "threshold": 0.6,
-    "description": "育成"
-  },
-  {
-    "itemName": "shi_card_2",
-    "imageName": "realm2_shi_card_2.png",
-    "roiFront": "935,354,32,56",
-    "roiBack": "913,329,87,120",
-    "method": "Template matching",
-    "threshold": 0.6,
-    "description": "结界卡"
-  },
-  {
-    "itemName": "shi_defense_2",
-    "imageName": "realm2_shi_defense_2.png",
-    "roiFront": "371,368,31,62",
-    "roiBack": "300,321,154,166",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "防守"
-  },
-  {
-    "itemName": "card_exp_2",
-    "imageName": "realm2_card_exp_2.png",
-    "roiFront": "935,223,57,54",
-    "roiBack": "873,151,199,185",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "收取经验(没有满的图)"
-  },
-  {
-    "itemName": "box_ap_2",
-    "imageName": "realm2_box_ap_2.png",
-    "roiFront": "927,448,51,46",
-    "roiBack": "863,367,202,204",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "收取体力(没有满)"
-  },
-  {
-    "itemName": "box_exp_2",
-    "imageName": "realm2_box_exp_2.png",
-    "roiFront": "990,457,42,45",
-    "roiBack": "953,414,147,127",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "收取盒子的经验(没有满)"
-  },
-  {
-    "itemName": "realm_shin_2",
-    "imageName": "realm2_realm_shin_2.png",
-    "roiFront": "157,503,54,58",
-    "roiBack": "7,386,360,276",
-    "method": "Template matching",
-    "threshold": 0.9,
-    "description": "结界皮肤"
-  },
-  {
-    "itemName": "utilize_exp_2",
-    "imageName": "realm2_utilize_exp_2.png",
-    "roiFront": "659,218,58,43",
-    "roiBack": "609,174,156,123",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "寄养别人的经验"
-  },
-  {
-    "itemName": "box_exp_max_2",
-    "imageName": "realm2_box_exp_max_2.png",
-    "roiFront": "991,443,48,51",
-    "roiBack": "893,378,228,186",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "盒子经验满"
-  }
-]

BIN
tasks/Component/CostumeRealm/realm2/realm2_box_ap_2.png


BIN
tasks/Component/CostumeRealm/realm2/realm2_box_exp_2.png


BIN
tasks/Component/CostumeRealm/realm2/realm2_box_exp_max_2.png


BIN
tasks/Component/CostumeRealm/realm2/realm2_card_exp_2.png


BIN
tasks/Component/CostumeRealm/realm2/realm2_realm_shin_2.png


BIN
tasks/Component/CostumeRealm/realm2/realm2_shi_card_2.png


BIN
tasks/Component/CostumeRealm/realm2/realm2_shi_defense_2.png


BIN
tasks/Component/CostumeRealm/realm2/realm2_shi_grown_2.png


BIN
tasks/Component/CostumeRealm/realm2/realm2_utilize_exp_2.png


+ 0 - 83
tasks/Component/CostumeRealm/realm3/image.json

@@ -1,83 +0,0 @@
-[
-  {
-    "itemName": "shi_grown_3",
-    "imageName": "realm3_shi_grown_3.png",
-    "roiFront": "605,304,35,38",
-    "roiBack": "530,247,181,198",
-    "method": "Template matching",
-    "threshold": 0.6,
-    "description": "育成"
-  },
-  {
-    "itemName": "shi_card_3",
-    "imageName": "realm3_shi_card_3.png",
-    "roiFront": "935,295,38,56",
-    "roiBack": "910,282,87,120",
-    "method": "Template matching",
-    "threshold": 0.6,
-    "description": "结界卡"
-  },
-  {
-    "itemName": "shi_defense_3",
-    "imageName": "realm3_shi_defense_3.png",
-    "roiFront": "253,309,31,62",
-    "roiBack": "200,269,154,166",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "防守"
-  },
-  {
-    "itemName": "card_exp_3",
-    "imageName": "realm3_card_exp_3.png",
-    "roiFront": "939,147,50,54",
-    "roiBack": "864,86,199,185",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "收取经验(没有满的图)"
-  },
-  {
-    "itemName": "box_ap_3",
-    "imageName": "realm3_box_ap_3.png",
-    "roiFront": "949,376,51,46",
-    "roiBack": "872,298,202,204",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "收取体力(没有满)"
-  },
-  {
-    "itemName": "box_exp_3",
-    "imageName": "realm3_box_exp_3.png",
-    "roiFront": "1012,390,42,45",
-    "roiBack": "962,347,147,127",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "收取盒子的经验(没有满)"
-  },
-  {
-    "itemName": "realm_shin_3",
-    "imageName": "realm3_realm_shin_3.png",
-    "roiFront": "160,401,54,58",
-    "roiBack": "0,290,360,276",
-    "method": "Template matching",
-    "threshold": 0.9,
-    "description": "结界皮肤"
-  },
-  {
-    "itemName": "utilize_exp_3",
-    "imageName": "realm3_utilize_exp_3.png",
-    "roiFront": "595,151,58,43",
-    "roiBack": "543,113,156,123",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "寄养别人的经验"
-  },
-  {
-    "itemName": "box_exp_max_3",
-    "imageName": "realm3_box_exp_max_3.png",
-    "roiFront": "1012,374,49,50",
-    "roiBack": "919,317,228,186",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "盒子经验满"
-  }
-]

BIN
tasks/Component/CostumeRealm/realm3/realm3_box_ap_3.png


BIN
tasks/Component/CostumeRealm/realm3/realm3_box_exp_3.png


BIN
tasks/Component/CostumeRealm/realm3/realm3_box_exp_max_3.png


BIN
tasks/Component/CostumeRealm/realm3/realm3_card_exp_3.png


BIN
tasks/Component/CostumeRealm/realm3/realm3_realm_shin_3.png


BIN
tasks/Component/CostumeRealm/realm3/realm3_shi_card_3.png


BIN
tasks/Component/CostumeRealm/realm3/realm3_shi_defense_3.png


BIN
tasks/Component/CostumeRealm/realm3/realm3_shi_grown_3.png


BIN
tasks/Component/CostumeRealm/realm3/realm3_utilize_exp_3.png


+ 0 - 83
tasks/Component/CostumeRealm/realm4/image.json

@@ -1,83 +0,0 @@
-[
-  {
-    "itemName": "shi_grown_4",
-    "imageName": "realm4_shi_grown_4.png",
-    "roiFront": "609,323,27,38",
-    "roiBack": "532,250,181,198",
-    "method": "Template matching",
-    "threshold": 0.6,
-    "description": "育成"
-  },
-  {
-    "itemName": "shi_card_4",
-    "imageName": "realm4_shi_card_4.png",
-    "roiFront": "929,315,38,56",
-    "roiBack": "904,299,87,120",
-    "method": "Template matching",
-    "threshold": 0.6,
-    "description": "结界卡"
-  },
-  {
-    "itemName": "shi_defense_4",
-    "imageName": "realm4_shi_defense_4.png",
-    "roiFront": "242,320,31,62",
-    "roiBack": "184,276,154,166",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "防守"
-  },
-  {
-    "itemName": "card_exp_4",
-    "imageName": "realm4_card_exp_4.png",
-    "roiFront": "930,181,57,54",
-    "roiBack": "855,111,199,185",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "收取经验(没有满的图)"
-  },
-  {
-    "itemName": "box_ap_4",
-    "imageName": "realm4_box_ap_4.png",
-    "roiFront": "958,386,51,46",
-    "roiBack": "889,313,202,204",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "收取体力(没有满)"
-  },
-  {
-    "itemName": "box_exp_4",
-    "imageName": "realm4_box_exp_4.png",
-    "roiFront": "1022,394,32,45",
-    "roiBack": "968,353,147,127",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "收取盒子的经验(没有满)"
-  },
-  {
-    "itemName": "realm_shin_4",
-    "imageName": "realm4_realm_shin_4.png",
-    "roiFront": "228,406,54,58",
-    "roiBack": "60,293,360,276",
-    "method": "Template matching",
-    "threshold": 0.9,
-    "description": "结界皮肤"
-  },
-  {
-    "itemName": "utilize_exp_4",
-    "imageName": "realm4_utilize_exp_4.png",
-    "roiFront": "596,181,58,43",
-    "roiBack": "545,144,156,123",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "寄养别人的经验"
-  },
-  {
-    "itemName": "box_exp_max_4",
-    "imageName": "realm4_box_exp_max_4.png",
-    "roiFront": "1026,381,41,51",
-    "roiBack": "934,323,228,186",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "盒子经验满"
-  }
-]

BIN
tasks/Component/CostumeRealm/realm4/realm4_box_ap_4.png


BIN
tasks/Component/CostumeRealm/realm4/realm4_box_exp_4.png


BIN
tasks/Component/CostumeRealm/realm4/realm4_box_exp_max_4.png


BIN
tasks/Component/CostumeRealm/realm4/realm4_card_exp_4.png


BIN
tasks/Component/CostumeRealm/realm4/realm4_realm_shin_4.png


BIN
tasks/Component/CostumeRealm/realm4/realm4_shi_card_4.png


BIN
tasks/Component/CostumeRealm/realm4/realm4_shi_defense_4.png


BIN
tasks/Component/CostumeRealm/realm4/realm4_shi_grown_4.png


BIN
tasks/Component/CostumeRealm/realm4/realm4_utilize_exp_4.png


+ 0 - 83
tasks/Component/CostumeRealm/realm5/image.json

@@ -1,83 +0,0 @@
-[
-  {
-    "itemName": "shi_grown_5",
-    "imageName": "realm5_shi_grown_5.png",
-    "roiFront": "642,356,35,38",
-    "roiBack": "568,295,181,198",
-    "method": "Template matching",
-    "threshold": 0.6,
-    "description": "育成"
-  },
-  {
-    "itemName": "shi_card_5",
-    "imageName": "realm5_shi_card_5.png",
-    "roiFront": "925,358,38,56",
-    "roiBack": "901,333,87,120",
-    "method": "Template matching",
-    "threshold": 0.6,
-    "description": "结界卡"
-  },
-  {
-    "itemName": "shi_defense_5",
-    "imageName": "realm5_shi_defense_5.png",
-    "roiFront": "312,356,31,62",
-    "roiBack": "257,310,154,166",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "防守"
-  },
-  {
-    "itemName": "card_exp_5",
-    "imageName": "realm5_card_exp_5.png",
-    "roiFront": "922,216,57,54",
-    "roiBack": "850,145,199,185",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "收取经验(没有满的图)"
-  },
-  {
-    "itemName": "box_ap_5",
-    "imageName": "realm5_box_ap_5.png",
-    "roiFront": "981,420,51,46",
-    "roiBack": "925,345,202,204",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "收取体力(没有满)"
-  },
-  {
-    "itemName": "box_exp_5",
-    "imageName": "realm5_box_exp_5.png",
-    "roiFront": "1050,430,42,45",
-    "roiBack": "996,382,147,127",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "收取盒子的经验(没有满)"
-  },
-  {
-    "itemName": "realm_shin_5",
-    "imageName": "realm5_realm_shin_5.png",
-    "roiFront": "237,411,54,58",
-    "roiBack": "95,303,360,276",
-    "method": "Template matching",
-    "threshold": 0.9,
-    "description": "结界皮肤"
-  },
-  {
-    "itemName": "utilize_exp_5",
-    "imageName": "realm5_utilize_exp_5.png",
-    "roiFront": "632,216,58,43",
-    "roiBack": "582,172,156,123",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "寄养别人的经验"
-  },
-  {
-    "itemName": "box_exp_max_5",
-    "imageName": "realm5_box_exp_max_5.png",
-    "roiFront": "1048,420,48,56",
-    "roiBack": "958,353,228,186",
-    "method": "Template matching",
-    "threshold": 0.7,
-    "description": "盒子经验满"
-  }
-]

BIN
tasks/Component/CostumeRealm/realm5/realm5_box_ap_5.png


BIN
tasks/Component/CostumeRealm/realm5/realm5_box_exp_5.png


BIN
tasks/Component/CostumeRealm/realm5/realm5_box_exp_max_5.png


BIN
tasks/Component/CostumeRealm/realm5/realm5_card_exp_5.png


BIN
tasks/Component/CostumeRealm/realm5/realm5_realm_shin_5.png


BIN
tasks/Component/CostumeRealm/realm5/realm5_shi_card_5.png


BIN
tasks/Component/CostumeRealm/realm5/realm5_shi_defense_5.png


BIN
tasks/Component/CostumeRealm/realm5/realm5_shi_grown_5.png


BIN
tasks/Component/CostumeRealm/realm5/realm5_utilize_exp_5.png


+ 7 - 7
tasks/Component/CostumeShikigami/assets.py

@@ -245,19 +245,19 @@ class CostumeShikigamiAssets:
 	# 用于判断是否在式神录里面 
 	I_SOU_CHECK_IN_6 = RuleImage(roi_front=(269,69,50,49), roi_back=(269,69,50,49), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_in_6.png")
 	# 检查是否为第一组 
-	I_SOU_CHECK_GROUP_1_6 = RuleImage(roi_front=(1086,91,22,57), roi_back=(1086,91,22,57), threshold=0.9, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_1_6.png")
+	I_SOU_CHECK_GROUP_1_6 = RuleImage(roi_front=(1078,79,22,52), roi_back=(1078,79,22,52), threshold=0.9, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_1_6.png")
 	# description 
-	I_SOU_CHECK_GROUP_2_6 = RuleImage(roi_front=(1086,163,25,57), roi_back=(1086,163,25,57), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_2_6.png")
+	I_SOU_CHECK_GROUP_2_6 = RuleImage(roi_front=(1080,149,25,49), roi_back=(1080,149,25,49), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_2_6.png")
 	# description 
-	I_SOU_CHECK_GROUP_3_6 = RuleImage(roi_front=(1085,234,22,49), roi_back=(1085,234,22,49), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_3_6.png")
+	I_SOU_CHECK_GROUP_3_6 = RuleImage(roi_front=(1080,221,22,43), roi_back=(1080,221,22,43), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_3_6.png")
 	# description 
-	I_SOU_CHECK_GROUP_4_6 = RuleImage(roi_front=(1086,303,21,56), roi_back=(1086,303,21,56), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_4_6.png")
+	I_SOU_CHECK_GROUP_4_6 = RuleImage(roi_front=(1081,289,21,50), roi_back=(1081,289,21,50), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_4_6.png")
 	# description 
-	I_SOU_CHECK_GROUP_5_6 = RuleImage(roi_front=(1088,370,21,53), roi_back=(1088,370,21,53), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_5_6.png")
+	I_SOU_CHECK_GROUP_5_6 = RuleImage(roi_front=(1081,360,21,50), roi_back=(1081,360,21,50), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_5_6.png")
 	# description 
-	I_SOU_CHECK_GROUP_6_6 = RuleImage(roi_front=(1085,443,23,54), roi_back=(1085,443,23,54), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_6_6.png")
+	I_SOU_CHECK_GROUP_6_6 = RuleImage(roi_front=(1081,428,23,49), roi_back=(1081,428,23,49), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_6_6.png")
 	# description 
-	I_SOU_CHECK_GROUP_7_6 = RuleImage(roi_front=(1088,512,21,54), roi_back=(1088,512,21,54), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_7_6.png")
+	I_SOU_CHECK_GROUP_7_6 = RuleImage(roi_front=(1079,500,21,48), roi_back=(1079,500,21,48), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_7_6.png")
 	# 匹配队伍预设 
 	I_SOU_TEAM_PRESENT_6 = RuleImage(roi_front=(720,76,136,43), roi_back=(706,68,175,63), threshold=0.8, method="Template matching", file="./tasks/Component/CostumeShikigami/sk6/sk6_sou_team_present_6.png")
 	# 需要切换的预设按钮(颜色深一点) 

+ 14 - 14
tasks/Component/CostumeShikigami/sk6/image.json

@@ -83,8 +83,8 @@
   {
     "itemName": "sou_check_group_1_6",
     "imageName": "sk6_sou_check_group_1_6.png",
-    "roiFront": "1086,91,22,57",
-    "roiBack": "1086,91,22,57",
+    "roiFront": "1078,79,22,52",
+    "roiBack": "1078,79,22,52",
     "method": "Template matching",
     "threshold": 0.9,
     "description": "检查是否为第一组"
@@ -92,8 +92,8 @@
   {
     "itemName": "sou_check_group_2_6",
     "imageName": "sk6_sou_check_group_2_6.png",
-    "roiFront": "1086,163,25,57",
-    "roiBack": "1086,163,25,57",
+    "roiFront": "1080,149,25,49",
+    "roiBack": "1080,149,25,49",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -101,8 +101,8 @@
   {
     "itemName": "sou_check_group_3_6",
     "imageName": "sk6_sou_check_group_3_6.png",
-    "roiFront": "1085,234,22,49",
-    "roiBack": "1085,234,22,49",
+    "roiFront": "1080,221,22,43",
+    "roiBack": "1080,221,22,43",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -110,8 +110,8 @@
   {
     "itemName": "sou_check_group_4_6",
     "imageName": "sk6_sou_check_group_4_6.png",
-    "roiFront": "1086,303,21,56",
-    "roiBack": "1086,303,21,56",
+    "roiFront": "1081,289,21,50",
+    "roiBack": "1081,289,21,50",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -119,8 +119,8 @@
   {
     "itemName": "sou_check_group_5_6",
     "imageName": "sk6_sou_check_group_5_6.png",
-    "roiFront": "1088,370,21,53",
-    "roiBack": "1088,370,21,53",
+    "roiFront": "1081,360,21,50",
+    "roiBack": "1081,360,21,50",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -128,8 +128,8 @@
   {
     "itemName": "sou_check_group_6_6",
     "imageName": "sk6_sou_check_group_6_6.png",
-    "roiFront": "1085,443,23,54",
-    "roiBack": "1085,443,23,54",
+    "roiFront": "1081,428,23,49",
+    "roiBack": "1081,428,23,49",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -137,8 +137,8 @@
   {
     "itemName": "sou_check_group_7_6",
     "imageName": "sk6_sou_check_group_7_6.png",
-    "roiFront": "1088,512,21,54",
-    "roiBack": "1088,512,21,54",
+    "roiFront": "1079,500,21,48",
+    "roiBack": "1079,500,21,48",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"

BIN
tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_1_6.png


BIN
tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_2_6.png


BIN
tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_3_6.png


BIN
tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_4_6.png


BIN
tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_5_6.png


BIN
tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_6_6.png


BIN
tasks/Component/CostumeShikigami/sk6/sk6_sou_check_group_7_6.png


+ 1 - 3
tasks/Component/GeneralInvite/assets.py

@@ -14,7 +14,7 @@ class GeneralInviteAssets:
 	# 中间的邀请图片 
 	I_ADD_1 = RuleImage(roi_front=(596,241,114,51), roi_back=(569,196,186,161), threshold=0.9, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_add_1.png")
 	# 最右边的邀请 
-	I_ADD_2 = RuleImage(roi_front=(1013,249,100,100), roi_back=(970,151,193,220), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_add_2.png")
+	I_ADD_2 = RuleImage(roi_front=(1013,203,100,100), roi_back=(970,151,193,220), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_add_2.png")
 	# description 
 	I_FIRE_FAIL = RuleImage(roi_front=(1177,604,81,74), roi_back=(1177,604,81,74), threshold=0.8, method="Template matching", file="./tasks/Component/GeneralInvite/gi/gi_fire_fail.png")
 	# description 
@@ -127,5 +127,3 @@ class GeneralInviteAssets:
 	O_FRIEND_NAME_2 = RuleOcr(roi=(729,184,196,346), area=(729,184,196,346), mode="Full", method="Default", keyword="", name="friend_name_2")
 	# Ocr-description 
 	O_ONLINE = RuleOcr(roi=(790,102,124,42), area=(0,0,100,100), mode="Single", method="Default", keyword="", name="online")
-
-

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

@@ -11,7 +11,7 @@
   {
     "itemName": "add_2",
     "imageName": "gi_add_2.png",
-    "roiFront": "1013,249,100,100",
+    "roiFront": "1013,203,100,100",
     "roiBack": "970,151,193,220",
     "method": "Template matching",
     "threshold": 0.8,
@@ -377,4 +377,4 @@
     "threshold": 0.8,
     "description": "识别到寄养邀请"
   }
-]
+]

+ 4 - 0
tasks/Component/SwitchOnmyoji/assets.py

@@ -25,5 +25,9 @@ class SwitchOnmyojiAssets:
 	I_ONMYOJI_CHECK = RuleImage(roi_front=(67,622,82,58), roi_back=(58,608,100,88), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchOnmyoji/so/so_onmyoji_check.png")
 	# 阴阳术英杰页面标志 
 	I_HERO_CHECK = RuleImage(roi_front=(70,624,75,55), roi_back=(60,602,100,100), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchOnmyoji/so/so_hero_check.png")
+	# 源赖光战标志 
+	I_YORIMITSU_BATTLE = RuleImage(roi_front=(511,424,100,100), roi_back=(448,401,181,142), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchOnmyoji/so/so_yorimitsu_battle.png")
+	# 藤原道长战标志 
+	I_MICHINAGA_BATTLE = RuleImage(roi_front=(741,421,100,100), roi_back=(689,399,171,133), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchOnmyoji/so/so_michinaga_battle.png")
 
 

+ 1 - 0
tasks/Component/SwitchOnmyoji/config.py

@@ -3,6 +3,7 @@ from enum import Enum
 
 class Onmyoji(str, Enum):
     YORIMITSU = '源赖光'
+    MICHINAGA = '藤原道长'
     SEIMI = '晴明'
     KAGURA = '神乐'
     HIROMASA = '源博雅'

+ 18 - 0
tasks/Component/SwitchOnmyoji/so/image.json

@@ -61,5 +61,23 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "阴阳术英杰页面标志"
+  },
+  {
+    "itemName": "yorimitsu_battle",
+    "imageName": "so_yorimitsu_battle.png",
+    "roiFront": "511,424,100,100",
+    "roiBack": "448,401,181,142",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "源赖光战标志"
+  },
+  {
+    "itemName": "michinaga_battle",
+    "imageName": "so_michinaga_battle.png",
+    "roiFront": "741,421,100,100",
+    "roiBack": "689,399,171,133",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "藤原道长战标志"
   }
 ]

BIN
tasks/Component/SwitchOnmyoji/so/so_michinaga_battle.png


Неке датотеке нису приказане због велике количине промена