Browse Source

Merge pull request #22 from runhey/dev

Dev
huangrunheng 3 years ago
parent
commit
3b09fabdd1
100 changed files with 1825 additions and 182 deletions
  1. 1 1
      config/template.json
  2. 1 1
      module/atom/image.py
  3. 1 0
      module/config/config_manual.py
  4. 2 0
      module/config/config_menu.py
  5. 6 1
      module/config/config_model.py
  6. BIN
      module/config/i18n/zh_CN.qm
  7. 34 12
      module/config/i18n/zh_CN.ts
  8. 1 0
      requirements-in.txt
  9. 1 0
      requirements.txt
  10. 1 1
      script.py
  11. 136 0
      tasks/BondlingFairyland/assets.py
  12. BIN
      tasks/BondlingFairyland/ball/ball_ball_fire.png
  13. BIN
      tasks/BondlingFairyland/ball/ball_ball_help.png
  14. BIN
      tasks/BondlingFairyland/ball/ball_ball_lock.png
  15. BIN
      tasks/BondlingFairyland/ball/ball_ball_records.png
  16. BIN
      tasks/BondlingFairyland/ball/ball_ball_unlock.png
  17. 47 0
      tasks/BondlingFairyland/ball/image.json
  18. 86 0
      tasks/BondlingFairyland/battle.py
  19. BIN
      tasks/BondlingFairyland/bf/bf_bf_local_1_azure_basan.png
  20. BIN
      tasks/BondlingFairyland/bf/bf_bf_local_1_one.png
  21. BIN
      tasks/BondlingFairyland/bf/bf_bf_local_2_snowball.png
  22. BIN
      tasks/BondlingFairyland/bf/bf_bf_local_3_little_kuro.png
  23. BIN
      tasks/BondlingFairyland/bf/bf_bf_local_4_none.png
  24. BIN
      tasks/BondlingFairyland/bf/bf_bf_local_5_little_kuro.png
  25. BIN
      tasks/BondlingFairyland/bf/bf_bf_local_5_tomb_guard.png
  26. BIN
      tasks/BondlingFairyland/bf/bf_bf_lock.png
  27. BIN
      tasks/BondlingFairyland/bf/bf_bf_records.png
  28. BIN
      tasks/BondlingFairyland/bf/bf_bf_searsh.png
  29. BIN
      tasks/BondlingFairyland/bf/bf_bf_store.png
  30. BIN
      tasks/BondlingFairyland/bf/bf_bf_unlock.png
  31. 92 0
      tasks/BondlingFairyland/bf/image.json
  32. 56 0
      tasks/BondlingFairyland/capture/capture.json
  33. BIN
      tasks/BondlingFairyland/capture/capture_azure_basan.png
  34. BIN
      tasks/BondlingFairyland/capture/capture_c_auto_false.png
  35. BIN
      tasks/BondlingFairyland/capture/capture_c_auto_true.png
  36. BIN
      tasks/BondlingFairyland/capture/capture_c_first_disable.png
  37. BIN
      tasks/BondlingFairyland/capture/capture_c_first_enable.png
  38. BIN
      tasks/BondlingFairyland/capture/capture_c_high_false.png
  39. BIN
      tasks/BondlingFairyland/capture/capture_c_high_true.png
  40. BIN
      tasks/BondlingFairyland/capture/capture_c_low_false.png
  41. BIN
      tasks/BondlingFairyland/capture/capture_c_low_true.png
  42. BIN
      tasks/BondlingFairyland/capture/capture_c_midum_false.png
  43. BIN
      tasks/BondlingFairyland/capture/capture_c_midum_true.png
  44. BIN
      tasks/BondlingFairyland/capture/capture_cap_failure.png
  45. BIN
      tasks/BondlingFairyland/capture/capture_cap_success.png
  46. BIN
      tasks/BondlingFairyland/capture/capture_caption_ensure.png
  47. BIN
      tasks/BondlingFairyland/capture/capture_click_caption.png
  48. BIN
      tasks/BondlingFairyland/capture/capture_little_kuro.png
  49. BIN
      tasks/BondlingFairyland/capture/capture_snowball.png
  50. BIN
      tasks/BondlingFairyland/capture/capture_tomb_guard.png
  51. 110 0
      tasks/BondlingFairyland/capture/image.json
  52. 38 0
      tasks/BondlingFairyland/click.json
  53. 59 0
      tasks/BondlingFairyland/config.py
  54. 14 0
      tasks/BondlingFairyland/config_battle.py
  55. 47 0
      tasks/BondlingFairyland/ocr.json
  56. 540 0
      tasks/BondlingFairyland/script_task.py
  57. 26 0
      tasks/BondlingFairyland/stone/click.json
  58. 20 0
      tasks/BondlingFairyland/stone/image.json
  59. BIN
      tasks/BondlingFairyland/stone/stone_stone_enter.png
  60. BIN
      tasks/BondlingFairyland/stone/stone_stone_sure.png
  61. BIN
      tasks/Component/GeneralBattle/GeneralBattle_greed_ghost.png
  62. BIN
      tasks/Component/GeneralBattle/GeneralBattle_win.png
  63. 15 0
      tasks/Component/GeneralBattle/assets.py
  64. 7 7
      tasks/Component/GeneralBattle/config_general_battle.py
  65. 38 0
      tasks/Component/GeneralBattle/finish_click.json
  66. 201 154
      tasks/Component/GeneralBattle/general_battle.py
  67. BIN
      tasks/Component/GeneralBattle/res_buff.png
  68. BIN
      tasks/Component/GeneralBattle/res_buff_awaken.png
  69. BIN
      tasks/Component/GeneralBattle/res_buff_exp_100.png
  70. BIN
      tasks/Component/GeneralBattle/res_buff_exp_50.png
  71. BIN
      tasks/Component/GeneralBattle/res_buff_gold_100.png
  72. BIN
      tasks/Component/GeneralBattle/res_buff_gold_50.png
  73. BIN
      tasks/Component/GeneralBattle/res_buff_soul.png
  74. BIN
      tasks/Component/GeneralBattle/res_exit.png
  75. BIN
      tasks/Component/GeneralBattle/res_exit_ensure.png
  76. BIN
      tasks/Component/GeneralBattle/res_false.png
  77. BIN
      tasks/Component/GeneralBattle/res_local.png
  78. BIN
      tasks/Component/GeneralBattle/res_prepare_dark.png
  79. BIN
      tasks/Component/GeneralBattle/res_prepare_highlight.png
  80. BIN
      tasks/Component/GeneralBattle/res_preset.png
  81. BIN
      tasks/Component/GeneralBattle/res_preset_ensure.png
  82. BIN
      tasks/Component/GeneralBattle/res_reward.png
  83. BIN
      tasks/Component/GeneralBattle/res_statistics.png
  84. BIN
      tasks/Component/GeneralBattle/res_win.png
  85. 2 5
      tasks/Component/GeneralInvite/general_invite.py
  86. 62 0
      tasks/Component/SwitchSoul/assets.py
  87. 44 0
      tasks/Component/SwitchSoul/ss/click.json
  88. 137 0
      tasks/Component/SwitchSoul/ss/image.json
  89. BIN
      tasks/Component/SwitchSoul/ss/ss_record_soul_back.png
  90. BIN
      tasks/Component/SwitchSoul/ss/ss_sou_check_group_1.png
  91. BIN
      tasks/Component/SwitchSoul/ss/ss_sou_check_group_2.png
  92. BIN
      tasks/Component/SwitchSoul/ss/ss_sou_check_group_3.png
  93. BIN
      tasks/Component/SwitchSoul/ss/ss_sou_check_group_4.png
  94. BIN
      tasks/Component/SwitchSoul/ss/ss_sou_check_group_5.png
  95. BIN
      tasks/Component/SwitchSoul/ss/ss_sou_check_group_6.png
  96. BIN
      tasks/Component/SwitchSoul/ss/ss_sou_check_group_7.png
  97. BIN
      tasks/Component/SwitchSoul/ss/ss_sou_check_in.png
  98. BIN
      tasks/Component/SwitchSoul/ss/ss_sou_switch_1.png
  99. BIN
      tasks/Component/SwitchSoul/ss/ss_sou_switch_2.png
  100. BIN
      tasks/Component/SwitchSoul/ss/ss_sou_switch_3.png

+ 1 - 1
config/template.json

@@ -103,7 +103,7 @@
     "scheduler": {
       "enable": false,
       "next_run": "2023-01-01 00:00:00",
-      "priority": 5,
+      "priority": 6,
       "success_interval": "01 00:00:00",
       "failure_interval": "01 00:00:00",
       "server_update": "09:00:00"

+ 1 - 1
module/atom/image.py

@@ -37,7 +37,7 @@ class RuleImage:
 
         :return:
         """
-        return Path(self.file).stem
+        return Path(self.file).stem.upper()
 
     def __str__(self):
         return self.name

+ 1 - 0
module/config/config_manual.py

@@ -12,6 +12,7 @@ class ConfigManual:
         > AreaBoss > GoldYoukai > ExperienceYoukai > Nian > RealmRaid
         > Orochi > OrochiMoans > OrochiJudgement > Sougenbi > FallenSun > EternitySea
         > ActivityShikigami
+        > BondlingFairyland
         """
 
     DEVICE_OVER_HTTP = False

+ 2 - 0
module/config/config_menu.py

@@ -22,6 +22,8 @@ class ConfigMenu:
         self.menu["Daily Task"] = ['AreaBoss', 'GoldYoukai', 'ExperienceYoukai', 'Nian', 'RealmRaid']
         # 活动的任务
         self.menu["Activity Task"] = ['ActivityShikigami']
+        # 很肝的任务
+        self.menu["Liver Emperor Exclusive"] = ['BondlingFairyland']
 
         # 开发工具
         self.menu["Tools"] = ['Image Rule', 'Ocr Rule', 'Click Rule', 'Long Click Rule', 'Swipe Rule', 'List Rule']

+ 6 - 1
module/config/config_model.py

@@ -29,7 +29,9 @@ from tasks.RealmRaid.config import RealmRaid
 from tasks.ActivityShikigami.config import ActivityShikigami
 # ----------------------------------------------------------------------------------------------------------------------
 
-
+# 肝帝专属---------------------------------------------------------------------------------------------------------------
+from tasks.BondlingFairyland.config import BondlingFairyland
+# ----------------------------------------------------------------------------------------------------------------------
 
 class ConfigModel(ConfigBase):
     config_name: str = "oas"
@@ -54,6 +56,9 @@ class ConfigModel(ConfigBase):
     # 这些是活动的
     activity_shikigami: ActivityShikigami = Field(default_factory=ActivityShikigami)
 
+    # 这些是肝帝专属
+    bondling_fairyland: BondlingFairyland = Field(default_factory=BondlingFairyland)
+
 
     # @validator('script')
     # def script_validator(cls, v):

BIN
module/config/i18n/zh_CN.qm


+ 34 - 12
module/config/i18n/zh_CN.ts

@@ -214,18 +214,13 @@
         <source>EternitySea</source>
         <translation>永生之海</translation>
     </message>
-	<message>
-        <source>GlobalGame</source>
-        <translation>全局游戏设置</translation>
-    </message>
-	<message>
-        <source>RealmRaid</source>
-        <translation>个人突破</translation>
-    </message>
-	<message>
-        <source>List Rule</source>
-        <translation>列表规则</translation>
-    </message>
+	<message><source>GlobalGame</source><translation>全局游戏设置</translation></message>
+	<message><source>RealmRaid</source><translation>个人突破</translation></message>
+	<message><source>List Rule</source><translation>列表规则</translation></message>
+	<message><source>Activity Task</source><translation>限时活动</translation></message>
+	<message><source>ActivityShikigami</source><translation>当期式神爬塔</translation></message>
+	<message><source>Liver Emperor Exclusive</source><translation>肝帝专属</translation></message>
+	<message><source>BondlingFairyland</source><translation>契灵之境</translation></message>
 </context>
 <context>
     <name>Args</name>
@@ -421,4 +416,31 @@
 	<message><source>layer_help</source><translation> </translation></message>
 	<message><source>soul_buff_enable_help</source><translation>会在庭院开始的时候设置加成</translation></message>
 </context>	
+<context>
+    <name>Args</name>
+	<message><source>BondlingConfig</source><translation>契灵</translation></message>
+	<message><source>BondlingMode</source><translation>设置战斗策略</translation></message>
+	<message><source>Bondling Stone Enable</source><translation>是否使用契石召唤契灵</translation></message>
+	<message><source>BondlingClass</source><translation>使用契石时选择召唤类型</translation></message>
+	<message><source>bondling_mode_help</source><translation>mode_1是指进行探查,刷到五个契灵后结束
+mode_2策略是刷到五个契灵后一直进行结契战斗,但是选择低级盘来结契失败获取材料
+mode_3策略是刷到五个契灵后开始结契,选择高级、中级盘来进行捕获</translation></message>
+	<message><source>bondling_stone_enable_help</source><translation>会优先开启契石,之后才是探查</translation></message>
+	<message><source>BondlingSwitchSoul</source><translation>自动切换御魂</translation></message>
+	<message><source>Auto Switch Soul</source><translation>是否启用</translation></message>
+	<message><source>Tomb Guard Switch</source><translation>设置镇墓兽的御魂装配分组</translation></message>
+	<message><source>Snowball Switch</source><translation>设置茨球的御魂装配分组</translation></message>
+	<message><source>Little Kuro Switch</source><translation>设置小黑的御魂装配分组</translation></message>
+	<message><source>Azure Basan Switch</source><translation>设置火灵的御魂装配分组</translation></message>
+	<message><source>auto_switch_soul_help</source><translation>如果你有5套独立阵容,那么这一项无需开启
+否则你可以开启这一项御魂轮换(探查是默认不需要轮换的)</translation></message>
+	<message><source>tomb_guard_switch_help</source><translation>初始值是不合适的,你需要根据自己的情况设置
+"1,2"表示第一个预设组,第二个队伍
+请使用英文输入法下的逗号
+预设组支持[1-7], 预设队伍支持[1-4]</translation></message>
+	<message><source>snowball_switch_help</source><translation> </translation></message>
+	<message><source>little_kuro_switch_help</source><translation> </translation></message>
+	<message><source>azure_basan_switch_help</source><translation> </translation></message>
+	<message><source>bondling_stone_class_help</source><translation> </translation></message>
+</context>	
 </TS>

+ 1 - 0
requirements-in.txt

@@ -1,6 +1,7 @@
 pyside6==6.4.3
 adbutils==0.11.0
 uiautomator2==2.16.17
+uiautomator2cache==0.3.0.1
 
 rich==13.3.5
 pyyaml==6.0

+ 1 - 0
requirements.txt

@@ -66,6 +66,7 @@ sympy==1.12               # via onnxruntime
 tqdm==4.65.0              # via -r requirements-in.txt
 typing-extensions==4.5.0  # via pydantic
 uiautomator2==2.16.17     # via -r requirements-in.txt
+uiautomator2cache==0.3.0.1  # via -r requirements-in.txt
 urllib3==2.0.2            # via requests
 websockets==11.0.3        # via -r requirements-in.txt
 whichcraft==0.6.1         # via adbutils, uiautomator2

+ 1 - 1
script.py

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

+ 136 - 0
tasks/BondlingFairyland/assets.py

@@ -0,0 +1,136 @@
+from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+from module.atom.long_click import RuleLongClick
+from module.atom.swipe import RuleSwipe
+from module.atom.ocr import RuleOcr
+from module.atom.list import RuleList
+
+# This file was automatically generated by module/dev_tools/assets_extract.py.
+# Don't modify it manually.
+class BondlingFairylandAssets: 
+
+
+	# Click Rule Assets
+	# description 
+	C_STONE_1 = RuleClick(roi_front=(239,536,26,24), roi_back=(0,0,100,100), name="stone_1")
+	# description 
+	C_STONE_2 = RuleClick(roi_front=(417,490,26,23), roi_back=(0,0,100,100), name="stone_2")
+	# description 
+	C_STONE_3 = RuleClick(roi_front=(705,511,28,26), roi_back=(0,0,100,100), name="stone_3")
+	# description 
+	C_STONE_4 = RuleClick(roi_front=(911,487,27,24), roi_back=(0,0,100,100), name="stone_4")
+	# description 
+	C_STONE_5 = RuleClick(roi_front=(1041,494,25,25), roi_back=(0,0,100,100), name="stone_5")
+	# description 
+	C_CAP_SUCCESS = RuleClick(roi_front=(317,102,378,363), roi_back=(0,0,100,100), name="cap_success")
+
+
+	# Ocr Rule Assets
+	# Ocr-description 
+	O_B_BONDLING_CLASS = RuleOcr(roi=(266,271,79,112), area=(287,271,36,112), mode="Single", method="Default", keyword="", name="b_bondling_class")
+	# Ocr-description 
+	O_B_LOW_NUMBER = RuleOcr(roi=(490,24,98,36), area=(490,24,98,36), mode="DigitCounter", method="Default", keyword="", name="b_low_number")
+	# Ocr-description 
+	O_B_MEDIUM_NUMBER = RuleOcr(roi=(687,21,101,36), area=(687,21,101,36), mode="DigitCounter", method="Default", keyword="", name="b_medium_number")
+	# Ocr-description 
+	O_B_HIGH_NUMBER = RuleOcr(roi=(883,23,100,32), area=(883,23,100,32), mode="DigitCounter", method="Default", keyword="", name="b_high_number")
+	# Ocr-description 
+	O_B_STONE_NUMBER = RuleOcr(roi=(858,22,82,40), area=(858,22,82,40), mode="DigitCounter", method="Default", keyword="", name="b_stone_number")
+
+
+	# Image Rule Assets
+	# description 
+	I_BALL_FIRE = RuleImage(roi_front=(1140,575,100,100), roi_back=(1140,575,100,100), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/ball/ball_ball_fire.png")
+	# description 
+	I_BALL_UNLOCK = RuleImage(roi_front=(714,637,31,33), roi_back=(714,637,31,33), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/ball/ball_ball_unlock.png")
+	# description 
+	I_BALL_LOCK = RuleImage(roi_front=(715,637,29,32), roi_back=(715,637,29,32), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/ball/ball_ball_lock.png")
+	# 点击式神录 
+	I_BALL_RECORDS = RuleImage(roi_front=(856,566,38,39), roi_back=(856,566,38,39), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/ball/ball_ball_records.png")
+	# 求援 
+	I_BALL_HELP = RuleImage(roi_front=(963,571,100,100), roi_back=(963,571,100,100), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/ball/ball_ball_help.png")
+
+
+	# Image Rule Assets
+	# description 
+	I_BF_SEARSH = RuleImage(roi_front=(1133,577,100,100), roi_back=(1133,577,100,100), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/bf/bf_bf_searsh.png")
+	# description 
+	I_BF_LOCK = RuleImage(roi_front=(826,653,24,26), roi_back=(826,653,24,26), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/bf/bf_bf_lock.png")
+	# description 
+	I_BF_UNLOCK = RuleImage(roi_front=(822,651,28,28), roi_back=(822,651,28,28), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/bf/bf_bf_unlock.png")
+	# description 
+	I_BF_STORE = RuleImage(roi_front=(261,632,57,57), roi_back=(261,632,57,57), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/bf/bf_bf_store.png")
+	# 点击式神录 
+	I_BF_RECORDS = RuleImage(roi_front=(1028,566,43,42), roi_back=(1028,566,43,42), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/bf/bf_bf_records.png")
+	# 左边第一个球:截屏的时候是火灵 
+	I_BF_LOCAL_1_AZURE_BASAN = RuleImage(roi_front=(237,536,28,25), roi_back=(225,523,53,50), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/bf/bf_bf_local_1_azure_basan.png")
+	# 第二个,茨球 
+	I_BF_LOCAL_2_SNOWBALL = RuleImage(roi_front=(418,490,24,25), roi_back=(406,475,53,50), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/bf/bf_bf_local_2_snowball.png")
+	# 截图时是小黑 
+	I_BF_LOCAL_3_LITTLE_KURO = RuleImage(roi_front=(704,509,29,26), roi_back=(690,492,62,58), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/bf/bf_bf_local_3_little_kuro.png")
+	# description 
+	I_BF_LOCAL_4_NONE = RuleImage(roi_front=(911,488,26,25), roi_back=(899,468,53,56), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/bf/bf_bf_local_4_none.png")
+	# 镇墓兽 
+	I_BF_LOCAL_5_TOMB_GUARD = RuleImage(roi_front=(1039,487,31,31), roi_back=(1026,481,56,51), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/bf/bf_bf_local_5_tomb_guard.png")
+
+
+	# Image Rule Assets
+	# 镇墓兽 
+	I_TOMB_GUARD = RuleImage(roi_front=(847,518,30,31), roi_back=(832,501,64,60), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_tomb_guard.png")
+	# 茨球 
+	I_SNOWBALL = RuleImage(roi_front=(532,375,44,48), roi_back=(512,353,94,93), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_snowball.png")
+	# 小黑 
+	I_LITTLE_KURO = RuleImage(roi_front=(478,334,77,70), roi_back=(462,318,108,102), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_little_kuro.png")
+	# 火灵 
+	I_AZURE_BASAN = RuleImage(roi_front=(654,260,48,46), roi_back=(631,235,91,92), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_azure_basan.png")
+	# description 
+	I_CAP_SUCCESS = RuleImage(roi_front=(210,445,22,21), roi_back=(210,445,22,21), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_cap_success.png")
+	# description 
+	I_CAP_FAILURE = RuleImage(roi_front=(1192,608,30,39), roi_back=(1192,608,30,39), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_cap_failure.png")
+
+
+	# Image Rule Assets
+	# description 
+	I_C_AUTO_TRUE = RuleImage(roi_front=(524,175,38,35), roi_back=(524,175,38,35), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_c_auto_true.png")
+	# description 
+	I_C_AUTO_FALSE = RuleImage(roi_front=(524,174,38,37), roi_back=(524,174,38,37), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_c_auto_false.png")
+	# description 
+	I_C_LOW_TRUE = RuleImage(roi_front=(543,271,30,32), roi_back=(543,271,30,32), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_c_low_true.png")
+	# description 
+	I_C_LOW_FALSE = RuleImage(roi_front=(539,269,37,35), roi_back=(539,269,37,35), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_c_low_false.png")
+	# description 
+	I_C_MIDUM_TRUE = RuleImage(roi_front=(680,277,35,27), roi_back=(680,277,35,27), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_c_midum_true.png")
+	# description 
+	I_C_MIDUM_FALSE = RuleImage(roi_front=(681,272,31,32), roi_back=(681,272,31,32), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_c_midum_false.png")
+	# description 
+	I_C_HIGH_TRUE = RuleImage(roi_front=(819,272,37,31), roi_back=(819,272,37,31), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_c_high_true.png")
+	# description 
+	I_C_HIGH_FALSE = RuleImage(roi_front=(818,272,36,34), roi_back=(818,272,36,34), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_c_high_false.png")
+	# description 
+	I_C_FIRST_ENABLE = RuleImage(roi_front=(524,472,33,31), roi_back=(524,472,33,31), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_c_first_enable.png")
+	# description 
+	I_C_FIRST_DISABLE = RuleImage(roi_front=(713,469,38,34), roi_back=(713,469,38,34), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_c_first_disable.png")
+	# description 
+	I_CAPTION_ENSURE = RuleImage(roi_front=(690,532,129,56), roi_back=(690,532,129,56), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_caption_ensure.png")
+	# description 
+	I_CLICK_CAPTION = RuleImage(roi_front=(177,625,59,51), roi_back=(177,625,59,51), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/capture/capture_click_caption.png")
+
+
+	# Click Rule Assets
+	# description 
+	C_LEFT_1 = RuleClick(roi_front=(167,198,128,265), roi_back=(167,198,128,265), name="left_1")
+	# description 
+	C_LEFT_2 = RuleClick(roi_front=(423,190,139,277), roi_back=(423,190,139,277), name="left_2")
+	# description 
+	C_LEFT_3 = RuleClick(roi_front=(676,176,159,307), roi_back=(676,176,159,307), name="left_3")
+	# description 
+	C_LEFT_4 = RuleClick(roi_front=(923,198,155,279), roi_back=(923,198,155,279), name="left_4")
+
+
+	# Image Rule Assets
+	# description 
+	I_STONE_ENTER = RuleImage(roi_front=(1167,472,38,41), roi_back=(1167,472,38,41), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/stone/stone_stone_enter.png")
+	# description 
+	I_STONE_SURE = RuleImage(roi_front=(1152,601,75,70), roi_back=(1152,601,75,70), threshold=0.8, method="Template matching", file="./tasks/BondlingFairyland/stone/stone_stone_sure.png")
+
+

BIN
tasks/BondlingFairyland/ball/ball_ball_fire.png


BIN
tasks/BondlingFairyland/ball/ball_ball_help.png


BIN
tasks/BondlingFairyland/ball/ball_ball_lock.png


BIN
tasks/BondlingFairyland/ball/ball_ball_records.png


BIN
tasks/BondlingFairyland/ball/ball_ball_unlock.png


+ 47 - 0
tasks/BondlingFairyland/ball/image.json

@@ -0,0 +1,47 @@
+[
+  {
+    "itemName": "ball_fire",
+    "imageName": "ball_ball_fire.png",
+    "roiFront": "1140,575,100,100",
+    "roiBack": "1140,575,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "ball_unlock",
+    "imageName": "ball_ball_unlock.png",
+    "roiFront": "714,637,31,33",
+    "roiBack": "714,637,31,33",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "ball_lock",
+    "imageName": "ball_ball_lock.png",
+    "roiFront": "715,637,29,32",
+    "roiBack": "715,637,29,32",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "ball_records",
+    "imageName": "ball_ball_records.png",
+    "roiFront": "856,566,38,39",
+    "roiBack": "856,566,38,39",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "点击式神录"
+  },
+  {
+    "itemName": "ball_help",
+    "imageName": "ball_ball_help.png",
+    "roiFront": "963,571,100,100",
+    "roiBack": "963,571,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "求援"
+  }
+]

+ 86 - 0
tasks/BondlingFairyland/battle.py

@@ -0,0 +1,86 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+import random
+
+from tasks.Component.GeneralBattle.general_battle import GeneralBattle
+from tasks.BondlingFairyland.assets import BondlingFairylandAssets
+from tasks.BondlingFairyland.config_battle import BattleConfig
+
+from module.logger import logger
+
+
+
+
+class BondlingBattle(GeneralBattle, BondlingFairylandAssets):
+
+    def run_battle(self, battle_config: BattleConfig) -> bool:
+        """
+        :return: 如果结契成功返回True,否则返回False
+        """
+        logger.hr("General battle start", 2)
+        self.current_count += 1
+        logger.info(f"Current count: {self.current_count}")
+
+        if self.check_load():
+            # 首先要判断进入战斗的界面
+            self.green_mark(battle_config.green_enable, battle_config.green_mark)
+
+        # 进入战斗过程
+        return self.catch_battle_wait(battle_config.random_click_swipt_enable)
+
+
+    def check_load(self) -> bool:
+        """
+        检查战斗时候的加载动画
+        如何是还在加载种,有那个要准备的按钮,就返回True
+        如果已经进入战斗了,就返回False
+        :return:
+        """
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_BUFF):
+                return True
+            if self.appear(self.I_EXIT):
+                return False
+
+    def catch_battle_wait(self, random_click_swipt_enable: bool) -> bool:
+        """
+        重写一个 战斗等待
+        :return: 如果捕获成功返回True,否则返回False
+        """
+        self.device.stuck_record_add('BATTLE_STATUS_S')
+        # 战斗过程 随机点击和滑动 防封
+        logger.info("Start battle process")
+        win: bool = False
+        while 1:
+            self.screenshot()
+            # 如果捕获成功
+            if self.appear_then_click(self.I_CAP_SUCCESS, action=self.C_CAP_SUCCESS,  interval=1):
+                win = True
+            # 如果捕获失败
+            if self.appear_then_click(self.I_CAP_FAILURE, action=self.C_CAP_SUCCESS, interval=1):
+                win = False
+
+            # 如果领奖励
+            if self.appear(self.I_REWARD, threshold=0.6):
+                break
+            # 如果开启战斗过程随机滑动
+            if random_click_swipt_enable:
+                self.random_click_swipt()
+
+        # 确定获得奖励 无论是胜利还是失败
+        if win:
+            logger.info("Catch success")
+        else:
+            logger.info("Catch failure")
+        while 1:
+            self.screenshot()
+            # 如果出现领奖励
+            action_click = random.choice([self.C_REWARD_1, self.C_REWARD_2, self.C_REWARD_3])
+            if self.appear_then_click(self.I_REWARD, action=action_click, interval=1.5):
+                continue
+            if not self.appear(self.I_REWARD):
+                break
+        logger.info("Get reward")
+        return win

BIN
tasks/BondlingFairyland/bf/bf_bf_local_1_azure_basan.png


BIN
tasks/BondlingFairyland/bf/bf_bf_local_1_one.png


BIN
tasks/BondlingFairyland/bf/bf_bf_local_2_snowball.png


BIN
tasks/BondlingFairyland/bf/bf_bf_local_3_little_kuro.png


BIN
tasks/BondlingFairyland/bf/bf_bf_local_4_none.png


BIN
tasks/BondlingFairyland/bf/bf_bf_local_5_little_kuro.png


BIN
tasks/BondlingFairyland/bf/bf_bf_local_5_tomb_guard.png


BIN
tasks/BondlingFairyland/bf/bf_bf_lock.png


BIN
tasks/BondlingFairyland/bf/bf_bf_records.png


BIN
tasks/BondlingFairyland/bf/bf_bf_searsh.png


BIN
tasks/BondlingFairyland/bf/bf_bf_store.png


BIN
tasks/BondlingFairyland/bf/bf_bf_unlock.png


+ 92 - 0
tasks/BondlingFairyland/bf/image.json

@@ -0,0 +1,92 @@
+[
+  {
+    "itemName": "bf_searsh",
+    "imageName": "bf_bf_searsh.png",
+    "roiFront": "1133,577,100,100",
+    "roiBack": "1133,577,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "bf_lock",
+    "imageName": "bf_bf_lock.png",
+    "roiFront": "826,653,24,26",
+    "roiBack": "826,653,24,26",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "bf_unlock",
+    "imageName": "bf_bf_unlock.png",
+    "roiFront": "822,651,28,28",
+    "roiBack": "822,651,28,28",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "bf_store",
+    "imageName": "bf_bf_store.png",
+    "roiFront": "261,632,57,57",
+    "roiBack": "261,632,57,57",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "bf_records",
+    "imageName": "bf_bf_records.png",
+    "roiFront": "1028,566,43,42",
+    "roiBack": "1028,566,43,42",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "点击式神录"
+  },
+  {
+    "itemName": "bf_local_1_azure_basan",
+    "imageName": "bf_bf_local_1_azure_basan.png",
+    "roiFront": "237,536,28,25",
+    "roiBack": "225,523,53,50",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "左边第一个球:截屏的时候是火灵"
+  },
+  {
+    "itemName": "bf_local_2_snowball",
+    "imageName": "bf_bf_local_2_snowball.png",
+    "roiFront": "418,490,24,25",
+    "roiBack": "406,475,53,50",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "第二个,茨球"
+  },
+  {
+    "itemName": "bf_local_3_little_kuro",
+    "imageName": "bf_bf_local_3_little_kuro.png",
+    "roiFront": "704,509,29,26",
+    "roiBack": "690,492,62,58",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "截图时是小黑"
+  },
+  {
+    "itemName": "bf_local_4_none",
+    "imageName": "bf_bf_local_4_none.png",
+    "roiFront": "911,488,26,25",
+    "roiBack": "899,468,53,56",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "bf_local_5_tomb_guard",
+    "imageName": "bf_bf_local_5_tomb_guard.png",
+    "roiFront": "1039,487,31,31",
+    "roiBack": "1026,481,56,51",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "镇墓兽"
+  }
+]

+ 56 - 0
tasks/BondlingFairyland/capture/capture.json

@@ -0,0 +1,56 @@
+[
+  {
+    "itemName": "tomb_guard",
+    "imageName": "capture_tomb_guard.png",
+    "roiFront": "847,518,30,31",
+    "roiBack": "832,501,64,60",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "镇墓兽"
+  },
+  {
+    "itemName": "snowball",
+    "imageName": "capture_snowball.png",
+    "roiFront": "532,375,44,48",
+    "roiBack": "512,353,94,93",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "茨球"
+  },
+  {
+    "itemName": "little_kuro",
+    "imageName": "capture_little_kuro.png",
+    "roiFront": "478,334,77,70",
+    "roiBack": "462,318,108,102",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "小黑"
+  },
+  {
+    "itemName": "azure_basan",
+    "imageName": "capture_azure_basan.png",
+    "roiFront": "654,260,48,46",
+    "roiBack": "631,235,91,92",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "火灵"
+  },
+  {
+    "itemName": "cap_success",
+    "imageName": "capture_cap_success.png",
+    "roiFront": "210,445,22,21",
+    "roiBack": "210,445,22,21",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "cap_failure",
+    "imageName": "capture_cap_failure.png",
+    "roiFront": "1192,608,30,39",
+    "roiBack": "1192,608,30,39",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/BondlingFairyland/capture/capture_azure_basan.png


BIN
tasks/BondlingFairyland/capture/capture_c_auto_false.png


BIN
tasks/BondlingFairyland/capture/capture_c_auto_true.png


BIN
tasks/BondlingFairyland/capture/capture_c_first_disable.png


BIN
tasks/BondlingFairyland/capture/capture_c_first_enable.png


BIN
tasks/BondlingFairyland/capture/capture_c_high_false.png


BIN
tasks/BondlingFairyland/capture/capture_c_high_true.png


BIN
tasks/BondlingFairyland/capture/capture_c_low_false.png


BIN
tasks/BondlingFairyland/capture/capture_c_low_true.png


BIN
tasks/BondlingFairyland/capture/capture_c_midum_false.png


BIN
tasks/BondlingFairyland/capture/capture_c_midum_true.png


BIN
tasks/BondlingFairyland/capture/capture_cap_failure.png


BIN
tasks/BondlingFairyland/capture/capture_cap_success.png


BIN
tasks/BondlingFairyland/capture/capture_caption_ensure.png


BIN
tasks/BondlingFairyland/capture/capture_click_caption.png


BIN
tasks/BondlingFairyland/capture/capture_little_kuro.png


BIN
tasks/BondlingFairyland/capture/capture_snowball.png


BIN
tasks/BondlingFairyland/capture/capture_tomb_guard.png


+ 110 - 0
tasks/BondlingFairyland/capture/image.json

@@ -0,0 +1,110 @@
+[
+  {
+    "itemName": "c_auto_true",
+    "imageName": "capture_c_auto_true.png",
+    "roiFront": "524,175,38,35",
+    "roiBack": "524,175,38,35",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "c_auto_false",
+    "imageName": "capture_c_auto_false.png",
+    "roiFront": "524,174,38,37",
+    "roiBack": "524,174,38,37",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "c_low_true",
+    "imageName": "capture_c_low_true.png",
+    "roiFront": "543,271,30,32",
+    "roiBack": "543,271,30,32",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "c_low_false",
+    "imageName": "capture_c_low_false.png",
+    "roiFront": "539,269,37,35",
+    "roiBack": "539,269,37,35",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "c_midum_true",
+    "imageName": "capture_c_midum_true.png",
+    "roiFront": "680,277,35,27",
+    "roiBack": "680,277,35,27",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "c_midum_false",
+    "imageName": "capture_c_midum_false.png",
+    "roiFront": "681,272,31,32",
+    "roiBack": "681,272,31,32",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "c_high_true",
+    "imageName": "capture_c_high_true.png",
+    "roiFront": "819,272,37,31",
+    "roiBack": "819,272,37,31",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "c_high_false",
+    "imageName": "capture_c_high_false.png",
+    "roiFront": "818,272,36,34",
+    "roiBack": "818,272,36,34",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "c_first_enable",
+    "imageName": "capture_c_first_enable.png",
+    "roiFront": "524,472,33,31",
+    "roiBack": "524,472,33,31",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "c_first_disable",
+    "imageName": "capture_c_first_disable.png",
+    "roiFront": "713,469,38,34",
+    "roiBack": "713,469,38,34",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "caption_ensure",
+    "imageName": "capture_caption_ensure.png",
+    "roiFront": "690,532,129,56",
+    "roiBack": "690,532,129,56",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "click_caption",
+    "imageName": "capture_click_caption.png",
+    "roiFront": "177,625,59,51",
+    "roiBack": "177,625,59,51",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

+ 38 - 0
tasks/BondlingFairyland/click.json

@@ -0,0 +1,38 @@
+[
+  {
+    "itemName": "stone_1",
+    "roiFront": "239,536,26,24",
+    "roiBack": "0,0,100,100",
+    "description": "description"
+  },
+  {
+    "itemName": "stone_2",
+    "roiFront": "417,490,26,23",
+    "roiBack": "0,0,100,100",
+    "description": "description"
+  },
+  {
+    "itemName": "stone_3",
+    "roiFront": "705,511,28,26",
+    "roiBack": "0,0,100,100",
+    "description": "description"
+  },
+  {
+    "itemName": "stone_4",
+    "roiFront": "911,487,27,24",
+    "roiBack": "0,0,100,100",
+    "description": "description"
+  },
+  {
+    "itemName": "stone_5",
+    "roiFront": "1041,494,25,25",
+    "roiBack": "0,0,100,100",
+    "description": "description"
+  },
+  {
+    "itemName": "cap_success",
+    "roiFront": "317,102,378,363",
+    "roiBack": "0,0,100,100",
+    "description": "description"
+  }
+]

+ 59 - 0
tasks/BondlingFairyland/config.py

@@ -0,0 +1,59 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from pydantic import BaseModel, Field
+from enum import Enum
+from datetime import datetime, time
+
+from tasks.Component.config_scheduler import Scheduler
+from tasks.Component.config_base import ConfigBase
+from tasks.BondlingFairyland.config_battle import BattleConfig
+
+class BondlingMode(str, Enum):
+    MODE1 = 'mode_1'
+    MODE2 = 'mode_2'
+    MODE3 = 'mode_3'
+# 镇墓兽 Tomb Guard  tomb_guard
+# 茨球 Snowball       snowball
+# 小黑 Little Kuro  little_kuro
+# 火灵 Azure Basan azure_basan
+class BondlingClass(str, Enum):
+    TOMB_GUARD = '镇墓兽'
+    SNOWBALL = '茨球'
+    LITTLE_KURO = '小黑'
+    AZURE_BASAN = '火灵'
+
+# 契石 Bondling Stone
+# 低级契灵盘 Low Bondling Discs
+# 中级契灵盘 Medium Bondling Discs
+# 高级契灵盘 High Bondling Discs
+
+class BondlingConfig(ConfigBase):
+    bondling_mode: BondlingMode = Field(default=BondlingMode.MODE1, description='bondling_mode_help')
+    limit_time: time = Field(default=time(minute=30), description='limit_time_help')
+    limit_count: int = Field(default=30, description='limit_count_help')
+    bondling_stone_enable: bool = Field(default=False, description='bondling_stone_enable_help')
+    bondling_stone_class: BondlingClass = Field(default=BondlingClass.TOMB_GUARD, description='bondling_stone_class_help')
+
+class BondlingSwitchSoul(ConfigBase):
+    auto_switch_soul: bool = Field(default=False, description='auto_switch_soul_help')
+    # 镇墓兽 config
+    tomb_guard_switch: str = Field(default='-1,-1', description='tomb_guard_switch_help')
+    # 茨球 config
+    snowball_switch: str = Field(default='-1,-1', description='snowball_switch_help')
+    # 小黑 config
+    little_kuro_switch: str = Field(default='-1,-1', description='little_kuro_switch_help')
+    # 火灵 config
+    azure_basan_switch: str = Field(default='-1,-1', description='azure_basan_switch_help')
+
+class BondlingFairyland(ConfigBase):
+    scheduler: Scheduler = Field(default_factory=Scheduler)
+    bondling_config: BondlingConfig = Field(default_factory=BondlingConfig)
+    bondling_switch_soul: BondlingSwitchSoul = Field(default_factory=BondlingSwitchSoul)
+    battle_config: BattleConfig = Field(default_factory=BattleConfig)
+
+
+
+
+
+

+ 14 - 0
tasks/BondlingFairyland/config_battle.py

@@ -0,0 +1,14 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from pydantic import BaseModel, Field
+
+from tasks.Component.GeneralBattle.config_general_battle import GreenMarkType
+
+class BattleConfig(BaseModel):
+    # 是否开启绿标
+    green_enable: bool = Field(default=False, description='green_enable_help')
+    # 选哪一个绿标
+    green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='green_mark_help')
+    # 是否启动战斗时随机点击或者随机滑动
+    random_click_swipt_enable: bool = Field(default=False, description='random_click_swipt_enable_help')

+ 47 - 0
tasks/BondlingFairyland/ocr.json

@@ -0,0 +1,47 @@
+[
+  {
+    "itemName": "b_bondling_class",
+    "roiFront": "266,271,79,112",
+    "roiBack": "287,271,36,112",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "b_low_number",
+    "roiFront": "490,24,98,36",
+    "roiBack": "490,24,98,36",
+    "mode": "DigitCounter",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "b_medium_number",
+    "roiFront": "687,21,101,36",
+    "roiBack": "687,21,101,36",
+    "mode": "DigitCounter",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "b_high_number",
+    "roiFront": "883,23,100,32",
+    "roiBack": "883,23,100,32",
+    "mode": "DigitCounter",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "b_stone_number",
+    "roiFront": "858,22,82,40",
+    "roiBack": "858,22,82,40",
+    "mode": "DigitCounter",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  }
+]

+ 540 - 0
tasks/BondlingFairyland/script_task.py

@@ -0,0 +1,540 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+
+import numpy as np
+from time import sleep
+from cached_property import cached_property
+from datetime import datetime, timedelta
+
+from tasks.base_task import BaseTask
+from tasks.GameUi.game_ui import GameUi
+from tasks.BondlingFairyland.config import (BondlingFairyland, BondlingMode,
+                                            BondlingClass,
+                                            BondlingSwitchSoul, BondlingConfig)
+from tasks.BondlingFairyland.assets import BondlingFairylandAssets
+from tasks.BondlingFairyland.battle import BondlingBattle
+from tasks.BondlingFairyland.config_battle import BattleConfig
+from tasks.Component.SwitchSoul.switch_soul import SwitchSoul, switch_parser
+from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
+from tasks.GameUi.page import page_main, page_bondling_fairyland
+
+from module.atom.image import RuleImage
+from module.logger import logger
+from module.exception import TaskEnd
+
+class ScriptTask(GameUi, BondlingBattle, SwitchSoul, BondlingFairylandAssets):
+
+    ball_pos_list = [None, None, None, None, None]  # 用于记录每一个位置的球是否出现
+    first_catch = True  # 用于记录是否是第一次捕捉
+
+    def run(self):
+        self.ui_get_current_page()
+        self.ui_goto(page_bondling_fairyland)
+        # 引用配置
+        cong = self.config.bondling_fairyland
+        bondling_config = cong.bondling_config
+        bondling_switch_soul = cong.bondling_switch_soul
+        battle_config = cong.battle_config
+
+        current_ball = 0  # 用于记录当前捕捉的球的位置
+        while 1:
+
+            if not self.in_search_ui(screenshot=True):
+                sleep(0.4)
+                continue
+
+            if current_ball == 0:
+                if self.run_stone(bondling_config.bondling_stone_enable, bondling_config.bondling_stone_class):
+                    current_ball = 5
+                    logger.info(f'Current ball number: {current_ball} ')
+
+                if current_ball == 5:
+                    continue
+                if self.run_search(bondling_config):
+                    current_ball = 5
+                    logger.info(f'Current ball number: {current_ball} ')
+                else:
+                    break
+
+            if bondling_config.bondling_mode != BondlingMode.MODE1:
+                if self.ball_click(current_ball):
+                    pass
+                else:
+                    # 如果点击了四次还是没有进去,那可能说明这个位置没有球
+                    current_ball -= 1
+                    logger.info(f'Current ball number: {current_ball} ')
+                    continue
+                if self.run_catch(bondling_config, bondling_switch_soul, battle_config):
+                    current_ball -= 1
+                    logger.info(f'Catch successful and current ball number: {current_ball} ')
+                else:
+                    break
+            else:
+                # 否则就是模式1
+                break
+
+        # 退出的时候如果是在结契的界面,要退回到探查界面
+        while 1:
+            self.screenshot()
+            if self.in_search_ui():
+                break
+            if self.in_catch_ui():
+                self.appear_then_click(self.I_BACK_Y, interval=1)
+        logger.info('BondlingFairyland task finished')
+
+        self.ui_get_current_page()
+        self.ui_goto(page_main)
+
+        self.set_next_run(task='BondlingFairyland', finish=True, success=True)
+        raise TaskEnd
+
+
+    def run_stone(self, bondling_stone_enable: bool, bondling_stone_class: BondlingClass):
+        """
+        使用结契石 进行召唤 契灵
+        :param bondling_stone_class:
+        :return:
+        (0) 不开启使用结契石,(探查界面)返回False
+        (1) 五个球满了,(探查界面)返回True
+        (2) 没有结契石了,(探查界面)返回False
+        """
+        if not bondling_stone_enable:
+            return False
+
+        while 1:
+            self.screenshot()
+            # 检查是不是在探查界面,
+            if not self.in_search_ui(screenshot=False):
+                continue
+            # 如果没有石头了
+            cu, res, total = self.O_B_STONE_NUMBER.ocr(self.device.image)
+            if cu == 0 and cu + res == total:
+                logger.warning(f'No bondling stone')
+                return False
+            # 如果五个球满了
+            click_count = 0
+            while 1:
+                self.screenshot()
+                if click_count >= 2:
+                    logger.info(f'Ball is full')
+                    return True
+                if not self.appear(self.I_STONE_ENTER):
+                    # 这时进入到了召唤的界面
+                    self.wait_until_appear(self.I_STONE_SURE)
+                    action_click = None
+                    match bondling_stone_class:
+                        case BondlingClass.LITTLE_KURO: action_click = self.C_LEFT_1
+                        case BondlingClass.SNOWBALL: action_click = self.C_LEFT_2
+                        case BondlingClass.AZURE_BASAN: action_click = self.C_LEFT_3
+                        case BondlingClass.TOMB_GUARD: action_click = self.C_LEFT_4
+                    sleep(0.5)
+                    self.click(action_click)
+
+                    # 点击召唤
+                    while 1:
+                        self.screenshot()
+                        if not self.appear(self.I_STONE_SURE):
+                            break
+                        if self.appear_then_click(self.I_STONE_SURE, interval=1):
+                            continue
+                    break
+
+
+
+                if self.appear_then_click(self.I_STONE_ENTER, interval=1):
+                    click_count += 1
+                    continue
+
+    def run_search(self, bondling_config: BondlingConfig):
+        """
+        运行探查
+        :return:
+        (1) 超出战斗的次数的了,(探查页面)返回False
+        (2) 超过时间限制了,(探查页面)返回False
+        (3) 打满五只球了,(探查界面)返回True
+        """
+        while 1:
+            # 检查是不是在探查界面,
+            if not self.in_search_ui(screenshot=True):
+                continue
+            # 检查是否有挑战次数
+            if self.current_count >= bondling_config.limit_count:
+                logger.warning(f'No challenge count, exit')
+                return False
+            # 检查是否到了限制时间
+            if datetime.now() - self.start_time >= self.limit_time:
+                logger.warning(f'No time, exit')
+                return False
+
+            if self.click_search():
+                self.run_general_battle(self.general_battle_config)
+            else:
+                logger.warning(f'Full five ball')
+                return True
+
+    def run_catch(self, bondling_config: BondlingConfig,
+                        bondling_switch_soul: BondlingSwitchSoul,
+                        battle_config: BattleConfig):
+        """
+        执行捕捉的(确保进入了结契界面)
+        :return:
+        (1) 盘子没了,返回False (退出页面是结契界面)
+        (2) 时间到了,返回False (退出页面是结契界面)
+        (3) 挑战次数到了,返回False (退出页面是结契界面)
+        (4) 捕获成功,返回True (退出页面是捕获的页面)
+        """
+
+
+        self.lock_team()
+        if self.first_catch:
+            self.first_catch = False
+            self.capture_setting(bondling_config.bondling_mode)
+
+        target_plate = None
+        match bondling_config.bondling_mode:
+            case BondlingMode.MODE2: target_plate = self.O_B_LOW_NUMBER
+            case BondlingMode.MODE3: target_plate = self.O_B_MEDIUM_NUMBER
+        def check_plate_number(target_plate):
+            self.screenshot()
+            cu, res, total = target_plate.ocr(self.device.image)
+            if cu == 0 and cu + res == total:
+                logger.warning(f'No plate number, exit')
+                return False
+            return True
+        if not check_plate_number(target_plate):
+            return False
+
+        def switch_soul(bondling_class: BondlingClass):
+            # 按照结契的来切换御魂
+            group_team: str = None
+            match bondling_class:
+                case BondlingClass.AZURE_BASAN: group_team = bondling_switch_soul.azure_basan_switch
+                case BondlingClass.SNOWBALL: group_team = bondling_switch_soul.snowball_switch
+                case BondlingClass.LITTLE_KURO: group_team = bondling_switch_soul.little_kuro_switch
+                case BondlingClass.TOMB_GUARD: group_team = bondling_switch_soul.tomb_guard_switch
+            group_team = switch_parser(group_team)
+            if group_team == [-1, -1]:
+                logger.info(f'{bondling_class.name } switch soul is not set, skip')
+                return False
+            self.enter_shikigami_records()
+            self.run_switch_soul(tuple(group_team))
+            # 返回的时候可能会多点一次导致 返回到探查界面
+            self.exit_shikigami_records()
+
+        bondling_class = self.get_bondling_class()
+        first_switch_soul = True
+        if bondling_switch_soul.auto_switch_soul:
+            first_switch_soul = False
+            switch_soul(bondling_class)
+
+
+        # 开始执行循环
+        while 1:
+            self.screenshot()
+
+            # 如果不在结契界面,就等待
+            if not self.in_catch_ui():
+                continue
+
+            # 检查是否有盘子
+            if not check_plate_number(target_plate):
+                logger.warning(f'No plate number, exit')
+                return False
+            # 检查是否有挑战次数
+            if self.current_count >= bondling_config.limit_count:
+                logger.warning(f'No challenge count, exit')
+                return False
+            # 检查是否到了限制时间
+            if datetime.now() - self.start_time >= self.limit_time:
+                logger.warning(f'No time, exit')
+                return False
+            # ok 就进行挑战
+            self.click_fire()
+            if self.run_battle(battle_config):
+                return True
+
+
+
+
+    @cached_property
+    def balls_target(self) -> list[RuleImage]:
+        """
+        获取所有的球的图片
+        :return:
+        """
+        result = [self.I_BF_LOCAL_1_AZURE_BASAN,
+                  self.I_BF_LOCAL_2_SNOWBALL,
+                  self.I_BF_LOCAL_3_LITTLE_KURO,
+                  self.I_BF_LOCAL_5_TOMB_GUARD]
+        return result
+
+    @cached_property
+    def balls_roi(self) -> list[tuple]:
+        """
+        获取球的五个位置是识别区域
+        :return:
+        """
+        result = [self.I_BF_LOCAL_1_AZURE_BASAN.roi_back,
+                  self.I_BF_LOCAL_2_SNOWBALL.roi_back,
+                  self.I_BF_LOCAL_3_LITTLE_KURO.roi_back,
+                  self.I_BF_LOCAL_4_NONE.roi_back,
+                  self.I_BF_LOCAL_5_TOMB_GUARD.roi_back]
+        return result
+
+    def roi_appear_ball(self, roi: tuple, image: np.ndarray) -> tuple | None:
+        """
+        判断某个固定的区域是否出现了球
+        :param roi:
+        :param image:
+        :return: 如果出现了,那就返回可以点击的区域,如果没有出现,那就返回None
+        """
+        for ball in self.balls_target:
+            ball.roi_back = list(roi)
+            if ball.match(image, threshold=0.8):
+                logger.info(f'Find ball {ball.name}')
+                logger.info(f'Ball roi {ball.roi_front}')
+                return ball.roi_front
+        return None
+
+    def ball_number(self) -> int:
+        """
+        !!! 弃用,原因是发现进行探查的时候会出现: 你的阴阳师会挡住球的位置,导致识别不到球
+
+        获取当前球的数量, 探查阶段优化使用的,但是在你抓完契灵后记得清空
+        :return:
+        """
+        self.screenshot()
+        count = 0
+        for index, ball_pos in enumerate(self.ball_pos_list):
+            if ball_pos is not None:
+                count += 1
+                continue
+            appear_roi = self.roi_appear_ball(self.balls_roi[index], self.device.image)
+            if appear_roi is not None:
+                count += 1
+                self.ball_pos_list[index] = appear_roi
+
+        return count
+
+    def use_stone(self, bondling_class: BondlingClass) -> bool:
+        """
+        使用契灵石
+        :param bondling_class:
+        :return: 如果使用成功,那就返回True 如果已经有五个了返回False
+        """
+
+        return False
+
+    def ball_click(self, index: int) -> bool:
+        """
+        点击球, 进去结契战斗的界面
+        :param index:
+        :return:
+        """
+        def get_click_target(ind: int):
+            if ind > 5 or ind < 1:
+                raise ValueError('index must be 1-5')
+            match = {
+                1: self.C_STONE_1,
+                2: self.C_STONE_2,
+                3: self.C_STONE_3,
+                4: self.C_STONE_4,
+                5: self.C_STONE_5,
+            }
+            return match[ind]
+
+        click_target = get_click_target(index)
+        click_count = 0
+        logger.info(f'Click ball {index}')
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_CLICK_CAPTION):
+                return True
+            if click_count >= 4:
+                return False
+            # 点击
+            self.click(click_target, interval=1)
+            click_count += 1
+
+
+    def capture_setting(self, mode: BondlingMode) -> None:
+        """
+        第一次进入任务的时候触发这一项方法:为了确保用户的选择默认是正确的
+        在结契的跳转页面,进入结契设置,按照模式来勾选
+        :param mode:
+        :return:
+        """
+        if mode == BondlingMode.MODE1:
+            return None
+        logger.info(f'Capture setting mode: {mode}')
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_CAPTION_ENSURE):
+                break
+            if self.appear_then_click(self.I_CLICK_CAPTION, interval=1):
+                continue
+
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_C_AUTO_TRUE):
+                break
+            if self.appear_then_click(self.I_C_AUTO_FALSE, interval=1):
+                continue
+
+        target_true = None
+        target_false = None
+        target_first = None
+        if mode == BondlingMode.MODE3:
+            target_true = self.I_C_MIDUM_TRUE
+            target_false = self.I_C_MIDUM_FALSE
+            target_first = self.I_C_FIRST_ENABLE
+        elif mode == BondlingMode.MODE2:
+            target_true = self.I_C_LOW_TRUE
+            target_false = self.I_C_LOW_FALSE
+            target_first = self.I_C_FIRST_DISABLE
+        while 1:
+            self.screenshot()
+            if self.appear(target_true):
+                break
+            if self.appear_then_click(target_false, interval=1):
+                continue
+        while 1:
+            self.screenshot()
+            if not self.appear(target_first):
+                break
+            if self.appear_then_click(target_first, interval=1):
+                continue
+
+        # 点击确定退出
+        while 1:
+            self.screenshot()
+            if not self.appear(self.I_CAPTION_ENSURE):
+                break
+            if self.appear_then_click(self.I_CAPTION_ENSURE, interval=1):
+                continue
+
+    def enter_shikigami_records(self) -> None:
+        """
+        进入式神录(在探查或者是结契的界面)
+        :return:
+        """
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_CHECK_RECORDS):
+                break
+            if self.appear_then_click(self.I_BF_RECORDS, interval=1):
+                continue
+            if self.appear_then_click(self.I_BALL_RECORDS, interval=1):
+                continue
+
+    def lock_team(self):
+        """
+        锁定队伍(在探查或者是结契的界面)
+        :return:
+        """
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_BALL_LOCK):
+                break
+            if self.appear(self.I_BF_LOCK):
+                break
+            if self.appear_then_click(self.I_BALL_UNLOCK, interval=1):
+                continue
+            if self.appear_then_click(self.I_BF_UNLOCK, interval=1):
+                continue
+
+    def get_bondling_class(self) -> BondlingClass or None:
+        """
+        获取契灵的种类 (这个不应该一开始就调用因为这些会有出场动画)
+        :return:
+        """
+        self.screenshot()
+        if self.appear(self.I_TOMB_GUARD):
+            return BondlingClass.TOMB_GUARD
+        elif self.appear(self.I_SNOWBALL):
+            return BondlingClass.SNOWBALL
+        elif self.appear(self.I_LITTLE_KURO):
+            return BondlingClass.LITTLE_KURO
+        elif self.appear(self.I_AZURE_BASAN, threshold=0.7):
+            return BondlingClass.AZURE_BASAN
+        return None
+
+    @cached_property
+    def limit_time(self) -> timedelta:
+        if not self.config.bondling_fairyland.bondling_config.limit_time:
+            return timedelta(minutes=20)
+        limit_time = self.config.bondling_fairyland.bondling_config.limit_time
+        return timedelta(hours=limit_time.hour, minutes=limit_time.minute, seconds=limit_time.second)
+
+    def click_fire(self):
+        """
+        点击 挑战, 主要是结契时的挑战
+        """
+        while 1:
+            self.screenshot()
+            if not self.appear(self.I_BALL_FIRE):
+                break
+            if self.appear_then_click(self.I_BALL_FIRE, interval=1):
+                continue
+
+    def in_catch_ui(self, screenshot=False) -> bool:
+        """
+        判断是否在结契的总界面
+        :return:
+        """
+        if screenshot:
+            self.screenshot()
+        return self.appear(self.I_BALL_FIRE)
+
+    def in_search_ui(self, screenshot=False) -> bool:
+        """
+        判断是否在探查的总界面
+        :return:
+        """
+        if screenshot:
+            self.screenshot()
+        return self.appear(self.I_BF_STORE)
+
+    def click_search(self) -> bool:
+        """
+        点击探查
+        :return: 如果五个球满了 就返回False。如果进入战斗不出现点击按钮那就是返回True
+        """
+        count = 0
+        while 1:
+            self.screenshot()
+            if count >= 3:
+                return False
+            if not self.appear(self.I_BF_SEARSH):
+                return True
+            if self.appear_then_click(self.I_BF_SEARSH, interval=2):
+                count += 1
+                continue
+        return False
+
+    @cached_property
+    def general_battle_config(self):
+        gbc = GeneralBattleConfig()
+        gbc.lock_team_enable = True
+        gbc.preset_enable = False
+        gbc.green_enable = False
+        gbc.random_click_swipt_enable = False
+        return gbc
+
+if __name__ == '__main__':
+    from module.config.config import Config
+    from module.device.device import Device
+    import cv2
+
+    config = Config('oas1')
+    device = Device(config)
+    task = ScriptTask(config, device)
+    image = task.screenshot()
+    # print(task.roi_appear_ball(task.I_BF_LOCAL_3_LITTLE_KURO.roi_back, image))
+    # print(task.ball_number())
+    con = config.bondling_fairyland
+    # task.run_catch(con.bondling_config, con.bondling_switch_soul, con.battle_config)
+    # task.run_stone(True, con.bondling_config.bondling_stone_class)
+    # task.run_search(con.bondling_config)
+    task.run()

+ 26 - 0
tasks/BondlingFairyland/stone/click.json

@@ -0,0 +1,26 @@
+[
+  {
+    "itemName": "left_1",
+    "roiFront": "167,198,128,265",
+    "roiBack": "167,198,128,265",
+    "description": "description"
+  },
+  {
+    "itemName": "left_2",
+    "roiFront": "423,190,139,277",
+    "roiBack": "423,190,139,277",
+    "description": "description"
+  },
+  {
+    "itemName": "left_3",
+    "roiFront": "676,176,159,307",
+    "roiBack": "676,176,159,307",
+    "description": "description"
+  },
+  {
+    "itemName": "left_4",
+    "roiFront": "923,198,155,279",
+    "roiBack": "923,198,155,279",
+    "description": "description"
+  }
+]

+ 20 - 0
tasks/BondlingFairyland/stone/image.json

@@ -0,0 +1,20 @@
+[
+  {
+    "itemName": "stone_enter",
+    "imageName": "stone_stone_enter.png",
+    "roiFront": "1167,472,38,41",
+    "roiBack": "1167,472,38,41",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "stone_sure",
+    "imageName": "stone_stone_sure.png",
+    "roiFront": "1152,601,75,70",
+    "roiBack": "1152,601,75,70",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/BondlingFairyland/stone/stone_stone_enter.png


BIN
tasks/BondlingFairyland/stone/stone_stone_sure.png


BIN
tasks/Component/GeneralBattle/GeneralBattle_greed_ghost.png


BIN
tasks/Component/GeneralBattle/GeneralBattle_win.png


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

@@ -10,6 +10,21 @@ from module.atom.list import RuleList
 class GeneralBattleAssets: 
 
 
+	# Click Rule Assets
+	# description 
+	C_WIN_1 = RuleClick(roi_front=(175,40,1054,161), roi_back=(175,40,1054,161), name="win_1")
+	# description 
+	C_WIN_2 = RuleClick(roi_front=(22,112,210,496), roi_back=(22,112,210,496), name="win_2")
+	# description 
+	C_WIN_3 = RuleClick(roi_front=(1059,114,206,468), roi_back=(1059,114,206,468), name="win_3")
+	# description 
+	C_REWARD_1 = RuleClick(roi_front=(546,546,385,144), roi_back=(546,546,385,144), name="reward_1")
+	# description 
+	C_REWARD_2 = RuleClick(roi_front=(25,134,224,472), roi_back=(25,134,224,472), name="reward_2")
+	# description 
+	C_REWARD_3 = RuleClick(roi_front=(1092,156,168,437), roi_back=(1092,156,168,437), name="reward_3")
+
+
 	# Click Rule Assets
 	# 预设队伍1 
 	C_PRESET_TEAM_1 = RuleClick(roi_front=(196,234,464,114), roi_back=(196,234,464,114), name="preset_team_1")

+ 7 - 7
tasks/Component/GeneralBattle/config_general_battle.py

@@ -25,19 +25,19 @@ class GeneralBattleConfig(BaseModel):
     # 选哪一个队伍
     preset_team: int = Field(default=1, description='preset_team_help', ge=1, le=5)
     # 是否启动开启buff
-    buff_enable: bool = Field(default=False, description='buff_enable_help')
+    # buff_enable: bool = Field(default=False, description='buff_enable_help')
     # 是否点击觉醒Buff
-    buff_awake_click: bool = Field(default=False, description='')
+    # buff_awake_click: bool = Field(default=False, description='')
     # 是否点击御魂buff
-    buff_soul_click: bool = Field(default=False, description='')
+    # buff_soul_click: bool = Field(default=False, description='')
     # 是否点击金币50buff
-    buff_gold_50_click: bool = Field(default=False, description='')
+    # buff_gold_50_click: bool = Field(default=False, description='')
     # 是否点击金币100buff
-    buff_gold_100_click: bool = Field(default=False, description='')
+    # buff_gold_100_click: bool = Field(default=False, description='')
     # 是否点击经验50buff
-    buff_exp_50_click: bool = Field(default=False, description='')
+    # buff_exp_50_click: bool = Field(default=False, description='')
     # 是否点击经验100buff
-    buff_exp_100_click: bool = Field(default=False, description='')
+    # buff_exp_100_click: bool = Field(default=False, description='')
 
     # 是否开启绿标
     green_enable: bool = Field(default=False, description='green_enable_help')

+ 38 - 0
tasks/Component/GeneralBattle/finish_click.json

@@ -0,0 +1,38 @@
+[
+  {
+    "itemName": "win_1",
+    "roiFront": "175,40,1054,161",
+    "roiBack": "175,40,1054,161",
+    "description": "description"
+  },
+  {
+    "itemName": "win_2",
+    "roiFront": "22,112,210,496",
+    "roiBack": "22,112,210,496",
+    "description": "description"
+  },
+  {
+    "itemName": "win_3",
+    "roiFront": "1059,114,206,468",
+    "roiBack": "1059,114,206,468",
+    "description": "description"
+  },
+  {
+    "itemName": "reward_1",
+    "roiFront": "546,546,385,144",
+    "roiBack": "546,546,385,144",
+    "description": "description"
+  },
+  {
+    "itemName": "reward_2",
+    "roiFront": "25,134,224,472",
+    "roiBack": "25,134,224,472",
+    "description": "description"
+  },
+  {
+    "itemName": "reward_3",
+    "roiFront": "1092,156,168,437",
+    "roiBack": "1092,156,168,437",
+    "description": "description"
+  }
+]

+ 201 - 154
tasks/Component/GeneralBattle/general_battle.py

@@ -28,69 +28,13 @@ class GeneralBattle(BaseTask, GeneralBattleAssets):
         if config is None:
             config = GeneralBattleConfig().dict()
 
-        # if isinstance(config, GeneralBattle):
-        #     logger.error(f"config is not GeneralBattle type, config: {config}")
-        #     config = GeneralBattle().dict()
 
         # 如果没有锁定队伍。那么可以根据配置设定队伍
         if not config.lock_team_enable:
             logger.info("Lock team is not enable")
-            # 如果启动更换队伍
-            if config.preset_enable and self.current_count == 1:
-                logger.info("Preset is enable")
-                # 点击预设按钮
-                logger.info("Click preset button")
-                while 1:
-                    self.screenshot()
-                    if self.appear_then_click(self.I_PRESET, threshold=0.8):
-                        continue
-                    if self.appear(self.I_PRESET_ENSURE):
-                        break
-                # 选择预设组
-                logger.info("Select preset group")
-                x, y = None, None
-                match config.preset_group:
-                    case 1: x, y = self.C_PRESET_GROUP_1.coord()
-                    case 2: x, y = self.C_PRESET_GROUP_2.coord()
-                    case 3: x, y = self.C_PRESET_GROUP_3.coord()
-                    case 4: x, y = self.C_PRESET_GROUP_4.coord()
-                    case 5: x, y = self.C_PRESET_GROUP_5.coord()
-                    case 6: x, y = self.C_PRESET_GROUP_6.coord()
-                    case 7: x, y = self.C_PRESET_GROUP_7.coord()
-                    case _: x, y = self.C_PRESET_GROUP_1.coord()
-                self.device.click(x, y)
-
-                # 选择预设的队伍
-                logger.info("Select preset team")
-                time.sleep(0.5)
-                match config.preset_team:
-                    case 1: x, y = self.C_PRESET_TEAM_1.coord()
-                    case 2: x, y = self.C_PRESET_TEAM_2.coord()
-                    case 3: x, y = self.C_PRESET_TEAM_3.coord()
-                    case 4: x, y = self.C_PRESET_TEAM_4.coord()
-                    case _: x, y = self.C_PRESET_TEAM_1.coord()
-                self.device.click(x, y)
-
-                # 点击预设确认
-                logger.info("Click preset ensure")
-                while 1:
-                    self.screenshot()
-                    if self.appear_then_click(self.I_PRESET_ENSURE, threshold=0.8):
-                        continue
-                    if not self.appear(self.I_PRESET_ENSURE):
-                        break
-
-            # 点击buff按钮
-            if config.buff_enable and self.current_count == 1:
-                logger.info("Buff is enable")
-                logger.info("Click buff button")
-                while 1:
-                    self.screenshot()
-                    if self.appear_then_click(self.I_BUFF, interval=1.5):
-                        continue
-                    if self.appear(self.I_BUFF_AWAKEN) or self.appear(self.I_BUFF_SOUL):
-                        break
-
+            # 如果更换队伍
+            if self.current_count == 1:
+                self.switch_preset_team(config.preset_enable, config.preset_group, config.preset_team)
 
             # 点击准备按钮
             self.wait_until_appear(self.I_PREPARE_HIGHLIGHT)
@@ -106,102 +50,9 @@ class GeneralBattle(BaseTask, GeneralBattleAssets):
             time.sleep(0.1)
 
         # 绿标
-        if config.green_enable:
-            logger.info("Green is enable")
-            x, y = None, None
-            match config.green_mark:
-                case GreenMarkType.GREEN_LEFT1:
-                    x, y = self.C_GREEN_LEFT_1.coord()
-                    logger.info("Green left 1")
-                case GreenMarkType.GREEN_LEFT2:
-                    x, y = self.C_GREEN_LEFT_2.coord()
-                    logger.info("Green left 2")
-                case GreenMarkType.GREEN_LEFT3:
-                    x, y = self.C_GREEN_LEFT_3.coord()
-                    logger.info("Green left 3")
-                case GreenMarkType.GREEN_LEFT4:
-                    x, y = self.C_GREEN_LEFT_4.coord()
-                    logger.info("Green left 4")
-                case GreenMarkType.GREEN_LEFT5:
-                    x, y = self.C_GREEN_LEFT_5.coord()
-                    logger.info("Green left 5")
-                case GreenMarkType.GREEN_MAIN:
-                    x, y = self.C_GREEN_MAIN.coord()
-                    logger.info("Green main")
-
-            # 判断有无坐标的偏移
-            self.appear_then_click(self.I_LOCAL)
-            time.sleep(0.3)
-            # 点击绿标
-            self.device.click(x, y)
-
-        # 有的时候是长战斗,需要在设置stuck检测为长战斗
-        # 但是无需取消设置,因为如果有点击或者滑动的话 handle_control_check会自行取消掉
-        self.device.stuck_record_add('BATTLE_STATUS_S')
-
-        # 战斗过程 随机点击和滑动 防封
-        logger.info("Start battle process")
-        win: bool = False
-        while 1:
-            self.screenshot()
-            # 如果出现赢 就点击
-            if self.appear(self.I_WIN, threshold=0.6):
-                logger.info("Battle result is win")
-                win = True
-                break
-
-            # 如果出现失败 就点击,返回False
-            if self.appear(self.I_FALSE, threshold=0.6):
-                logger.info("Battle result is false")
-                win = False
-                break
-
-            # 如果领奖励
-            if self.appear(self.I_REWARD, threshold=0.6):
-                win = True
-                break
-            # 如果开启战斗过程随机滑动
-            if config.random_click_swipt_enable:
-                time.sleep(0.4)  # 这样的好像不对
-                if 0 <= random.randint(0, 500) <= 3:  # 百分之4的概率
-                    rand_type = random.randint(0, 2)
-                    match rand_type:
-                        case 0:
-                            self.click(self.C_RANDOM_CLICK, interval=20)
-                        case 1:
-                            self.swipe(self.S_BATTLE_RANDOM_LEFT, interval=20)
-                        case 2:
-                            self.swipe(self.S_BATTLE_RANDOM_RIGHT, interval=20)
-                    # 重新设置为长战斗
-                    self.device.stuck_record_add('BATTLE_STATUS_S')
-
-        # 再次确认战斗结果
-        logger.info("Reconfirm the results of the battle")
-        while 1:
-            self.screenshot()
-            if win:
-                # 点击赢了
-                if self.appear_then_click(self.I_WIN):
-                    continue
-                if not self.appear(self.I_WIN):
-                    break
-            else:
-                # 如果失败且 点击失败后
-                if self.appear_then_click(self.I_FALSE, threshold=0.6):
-                    continue
-                if not self.appear(self.I_FALSE, threshold=0.6):
-                    return False
-        # 最后保证能点击 获得奖励
-        self.wait_until_appear(self.I_REWARD)
-        logger.info("Get reward")
-        while 1:
-            self.screenshot()
-            # 如果出现领奖励
-            if self.appear_then_click(self.I_REWARD, interval=1.5):
-                continue
-            if not self.appear(self.I_REWARD):
-                break
+        self.green_mark(config.green_enable, config.green_mark)
 
+        win = self.battle_wait(config.random_click_swipt_enable)
         if win:
             return True
         else:
@@ -290,3 +141,199 @@ class GeneralBattle(BaseTask, GeneralBattleAssets):
         return True
 
 
+    def battle_wait(self, random_click_swipt_enable: bool) -> bool:
+        """
+        等待战斗结束
+        :param random_click_swipt_enable:
+        :return:
+        """
+        # 有的时候是长战斗,需要在设置stuck检测为长战斗
+        # 但是无需取消设置,因为如果有点击或者滑动的话 handle_control_check会自行取消掉
+        self.device.stuck_record_add('BATTLE_STATUS_S')
+        # 战斗过程 随机点击和滑动 防封
+        logger.info("Start battle process")
+        win: bool = False
+        while 1:
+            self.screenshot()
+            # 如果出现赢 就点击
+            if self.appear(self.I_WIN, threshold=0.6):
+                logger.info("Battle result is win")
+                win = True
+                break
+
+            # 如果出现失败 就点击,返回False
+            if self.appear(self.I_FALSE, threshold=0.6):
+                logger.info("Battle result is false")
+                win = False
+                break
+
+            # 如果领奖励
+            if self.appear(self.I_REWARD, threshold=0.6):
+                win = True
+                break
+            # 如果开启战斗过程随机滑动
+            if random_click_swipt_enable:
+                self.random_click_swipt()
+
+
+        # 再次确认战斗结果
+        logger.info("Reconfirm the results of the battle")
+        while 1:
+            self.screenshot()
+            if win:
+                # 点击赢了
+                action_click = random.choice([self.C_WIN_1, self.C_WIN_2, self.C_WIN_3])
+                if self.appear_then_click(self.I_WIN, action=action_click, interval=0.5):
+                    continue
+                if not self.appear(self.I_WIN):
+                    break
+            else:
+                # 如果失败且 点击失败后
+                if self.appear_then_click(self.I_FALSE, threshold=0.6):
+                    continue
+                if not self.appear(self.I_FALSE, threshold=0.6):
+                    return False
+        # 最后保证能点击 获得奖励
+        self.wait_until_appear(self.I_REWARD)
+        logger.info("Get reward")
+        while 1:
+            self.screenshot()
+            # 如果出现领奖励
+            action_click = random.choice([self.C_REWARD_1, self.C_REWARD_2, self.C_REWARD_3])
+            if self.appear_then_click(self.I_REWARD, action=action_click ,interval=1.5):
+                continue
+            if not self.appear(self.I_REWARD):
+                break
+
+        return win
+
+    def green_mark(self, enable: bool=False, mark_mode: GreenMarkType=GreenMarkType.GREEN_MAIN):
+        """
+        绿标, 如果不使能就直接返回
+        :param enable:
+        :param mark_mode:
+        :return:
+        """
+        if enable:
+            logger.info("Green is enable")
+            x, y = None, None
+            match mark_mode:
+                case GreenMarkType.GREEN_LEFT1:
+                    x, y = self.C_GREEN_LEFT_1.coord()
+                    logger.info("Green left 1")
+                case GreenMarkType.GREEN_LEFT2:
+                    x, y = self.C_GREEN_LEFT_2.coord()
+                    logger.info("Green left 2")
+                case GreenMarkType.GREEN_LEFT3:
+                    x, y = self.C_GREEN_LEFT_3.coord()
+                    logger.info("Green left 3")
+                case GreenMarkType.GREEN_LEFT4:
+                    x, y = self.C_GREEN_LEFT_4.coord()
+                    logger.info("Green left 4")
+                case GreenMarkType.GREEN_LEFT5:
+                    x, y = self.C_GREEN_LEFT_5.coord()
+                    logger.info("Green left 5")
+                case GreenMarkType.GREEN_MAIN:
+                    x, y = self.C_GREEN_MAIN.coord()
+                    logger.info("Green main")
+
+            # 等待那个准备的消失
+            while 1:
+                self.screenshot()
+                if not self.appear(self.I_PREPARE_HIGHLIGHT):
+                    break
+
+            # 判断有无坐标的偏移
+            self.appear_then_click(self.I_LOCAL)
+            time.sleep(0.3)
+            # 点击绿标
+            self.device.click(x, y)
+
+    def switch_preset_team(self, enable: bool=False, preset_group: int=1, preset_team: int=1):
+        """
+        切换预设的队伍, 要求是在不锁定队伍时的情况下
+        :param enable:
+        :param preset_group:
+        :param preset_team:
+        :return:
+        """
+        if not enable:
+            logger.info("Preset is disable")
+            return None
+
+        logger.info("Preset is enable")
+        # 点击预设按钮
+        while 1:
+            self.screenshot()
+            if self.appear_then_click(self.I_PRESET, threshold=0.8):
+                continue
+            if self.appear(self.I_PRESET_ENSURE):
+                break
+        logger.info("Click preset button")
+
+        # 选择预设组
+        x, y = None, None
+        match preset_group:
+            case 1:
+                x, y = self.C_PRESET_GROUP_1.coord()
+            case 2:
+                x, y = self.C_PRESET_GROUP_2.coord()
+            case 3:
+                x, y = self.C_PRESET_GROUP_3.coord()
+            case 4:
+                x, y = self.C_PRESET_GROUP_4.coord()
+            case 5:
+                x, y = self.C_PRESET_GROUP_5.coord()
+            case 6:
+                x, y = self.C_PRESET_GROUP_6.coord()
+            case 7:
+                x, y = self.C_PRESET_GROUP_7.coord()
+            case _:
+                x, y = self.C_PRESET_GROUP_1.coord()
+        self.device.click(x, y)
+        logger.info("Select preset group")
+
+        # 选择预设的队伍
+        time.sleep(0.5)
+        match preset_team:
+            case 1:
+                x, y = self.C_PRESET_TEAM_1.coord()
+            case 2:
+                x, y = self.C_PRESET_TEAM_2.coord()
+            case 3:
+                x, y = self.C_PRESET_TEAM_3.coord()
+            case 4:
+                x, y = self.C_PRESET_TEAM_4.coord()
+            case _:
+                x, y = self.C_PRESET_TEAM_1.coord()
+        self.device.click(x, y)
+        logger.info("Select preset team")
+
+        # 点击预设确认
+        while 1:
+            self.screenshot()
+            if self.appear_then_click(self.I_PRESET_ENSURE, threshold=0.8):
+                continue
+            if not self.appear(self.I_PRESET_ENSURE):
+                break
+        logger.info("Click preset ensure")
+
+    def random_click_swipt(self):
+        time.sleep(0.4)  # 这样的好像不对
+        if 0 <= random.randint(0, 500) <= 3:  # 百分之4的概率
+            rand_type = random.randint(0, 2)
+            match rand_type:
+                case 0:
+                    self.click(self.C_RANDOM_CLICK, interval=20)
+                case 1:
+                    self.swipe(self.S_BATTLE_RANDOM_LEFT, interval=20)
+                case 2:
+                    self.swipe(self.S_BATTLE_RANDOM_RIGHT, interval=20)
+            # 重新设置为长战斗
+            self.device.stuck_record_add('BATTLE_STATUS_S')
+
+
+
+
+
+

BIN
tasks/Component/GeneralBattle/res_buff.png


BIN
tasks/Component/GeneralBattle/res_buff_awaken.png


BIN
tasks/Component/GeneralBattle/res_buff_exp_100.png


BIN
tasks/Component/GeneralBattle/res_buff_exp_50.png


BIN
tasks/Component/GeneralBattle/res_buff_gold_100.png


BIN
tasks/Component/GeneralBattle/res_buff_gold_50.png


BIN
tasks/Component/GeneralBattle/res_buff_soul.png


BIN
tasks/Component/GeneralBattle/res_exit.png


BIN
tasks/Component/GeneralBattle/res_exit_ensure.png


BIN
tasks/Component/GeneralBattle/res_false.png


BIN
tasks/Component/GeneralBattle/res_local.png


BIN
tasks/Component/GeneralBattle/res_prepare_dark.png


BIN
tasks/Component/GeneralBattle/res_prepare_highlight.png


BIN
tasks/Component/GeneralBattle/res_preset.png


BIN
tasks/Component/GeneralBattle/res_preset_ensure.png


BIN
tasks/Component/GeneralBattle/res_reward.png


BIN
tasks/Component/GeneralBattle/res_statistics.png


BIN
tasks/Component/GeneralBattle/res_win.png


+ 2 - 5
tasks/Component/GeneralInvite/general_invite.py

@@ -39,15 +39,12 @@ class GeneralInvite(BaseTask, GeneralInviteAssets):
     timer_emoji = None  # 等待期间如果没有操作的话,可能会导致长时间无响应报错
 
     """
-    这个类就三个api
-    1. run_invite
-    2. invite_again
-    3. accept_invite
+
     """
 
     def run_invite(self, config: InviteConfig, is_first: bool = False) -> bool:
         """
-        队长!!身份。。。在组件界面邀请好友( 如果开启is_first) 等待队员进入开启挑战
+        队长!!身份。。。在组队界面邀请好友( 如果开启is_first) 等待队员进入开启挑战
         请注意,返回的时候成功时是进入战斗了!!!
         如果是失败,那就是没有队友进入,然后会退出房间的界面
         :param config:

+ 62 - 0
tasks/Component/SwitchSoul/assets.py

@@ -0,0 +1,62 @@
+from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+from module.atom.long_click import RuleLongClick
+from module.atom.swipe import RuleSwipe
+from module.atom.ocr import RuleOcr
+from module.atom.list import RuleList
+
+# This file was automatically generated by module/dev_tools/assets_extract.py.
+# Don't modify it manually.
+class SwitchSoulAssets: 
+
+
+	# Click Rule Assets
+	# description 
+	C_SOU_GROUP_1 = RuleClick(roi_front=(1086,85,158,67), roi_back=(1086,85,158,67), name="sou_group_1")
+	# description 
+	C_SOU_GROUP_2 = RuleClick(roi_front=(1087,155,162,62), roi_back=(1087,155,162,62), name="sou_group_2")
+	# description 
+	C_SOU_GROUP_3 = RuleClick(roi_front=(1088,226,154,61), roi_back=(1088,226,154,61), name="sou_group_3")
+	# description 
+	C_SOU_GROUP_4 = RuleClick(roi_front=(1087,297,157,59), roi_back=(1087,297,157,59), name="sou_group_4")
+	# description 
+	C_SOU_GROUP_5 = RuleClick(roi_front=(1087,365,154,62), roi_back=(1087,365,154,62), name="sou_group_5")
+	# description 
+	C_SOU_GROUP_6 = RuleClick(roi_front=(1088,437,156,57), roi_back=(1088,437,156,57), name="sou_group_6")
+	# description 
+	C_SOU_GROUP_7 = RuleClick(roi_front=(1090,505,156,62), roi_back=(1090,505,156,62), name="sou_group_7")
+
+
+	# Image Rule Assets
+	# 退出式神录 
+	I_RECORD_SOUL_BACK = RuleImage(roi_front=(19,9,51,44), roi_back=(19,9,51,44), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_record_soul_back.png")
+	# 预设 
+	I_SOUL_PRESET = RuleImage(roi_front=(332,70,90,51), roi_back=(332,70,90,51), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_soul_preset.png")
+	# description 
+	I_SOU_SWITCH_1 = RuleImage(roi_front=(971,148,37,35), roi_back=(971,148,37,35), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_switch_1.png")
+	# description 
+	I_SOU_SWITCH_2 = RuleImage(roi_front=(978,304,27,29), roi_back=(978,304,27,29), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_switch_2.png")
+	# description 
+	I_SOU_SWITCH_3 = RuleImage(roi_front=(973,454,26,26), roi_back=(973,454,26,26), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_switch_3.png")
+	# description 
+	I_SOU_SWITCH_4 = RuleImage(roi_front=(971,600,37,26), roi_back=(971,600,37,26), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_switch_4.png")
+	# description 
+	I_SOU_SWITCH_SURE = RuleImage(roi_front=(668,401,180,61), roi_back=(668,401,180,61), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_switch_sure.png")
+	# 用于判断是否在式神录里面 
+	I_SOU_CHECK_IN = RuleImage(roi_front=(269,69,50,49), roi_back=(269,69,50,49), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_check_in.png")
+	# description 
+	I_SOU_CHECK_GROUP_1 = RuleImage(roi_front=(1086,91,22,57), roi_back=(1086,91,22,57), threshold=0.9, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_check_group_1.png")
+	# description 
+	I_SOU_CHECK_GROUP_2 = RuleImage(roi_front=(1086,163,25,57), roi_back=(1086,163,25,57), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_check_group_2.png")
+	# description 
+	I_SOU_CHECK_GROUP_3 = RuleImage(roi_front=(1085,234,22,49), roi_back=(1085,234,22,49), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_check_group_3.png")
+	# description 
+	I_SOU_CHECK_GROUP_4 = RuleImage(roi_front=(1086,303,21,56), roi_back=(1086,303,21,56), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_check_group_4.png")
+	# description 
+	I_SOU_CHECK_GROUP_5 = RuleImage(roi_front=(1088,370,21,53), roi_back=(1088,370,21,53), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_check_group_5.png")
+	# description 
+	I_SOU_CHECK_GROUP_6 = RuleImage(roi_front=(1085,443,23,54), roi_back=(1085,443,23,54), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_check_group_6.png")
+	# description 
+	I_SOU_CHECK_GROUP_7 = RuleImage(roi_front=(1088,512,21,54), roi_back=(1088,512,21,54), threshold=0.8, method="Template matching", file="./tasks/Component/SwitchSoul/ss/ss_sou_check_group_7.png")
+
+

+ 44 - 0
tasks/Component/SwitchSoul/ss/click.json

@@ -0,0 +1,44 @@
+[
+  {
+    "itemName": "sou_group_1",
+    "roiFront": "1086,85,158,67",
+    "roiBack": "1086,85,158,67",
+    "description": "description"
+  },
+  {
+    "itemName": "sou_group_2",
+    "roiFront": "1087,155,162,62",
+    "roiBack": "1087,155,162,62",
+    "description": "description"
+  },
+  {
+    "itemName": "sou_group_3",
+    "roiFront": "1088,226,154,61",
+    "roiBack": "1088,226,154,61",
+    "description": "description"
+  },
+  {
+    "itemName": "sou_group_4",
+    "roiFront": "1087,297,157,59",
+    "roiBack": "1087,297,157,59",
+    "description": "description"
+  },
+  {
+    "itemName": "sou_group_5",
+    "roiFront": "1087,365,154,62",
+    "roiBack": "1087,365,154,62",
+    "description": "description"
+  },
+  {
+    "itemName": "sou_group_6",
+    "roiFront": "1088,437,156,57",
+    "roiBack": "1088,437,156,57",
+    "description": "description"
+  },
+  {
+    "itemName": "sou_group_7",
+    "roiFront": "1090,505,156,62",
+    "roiBack": "1090,505,156,62",
+    "description": "description"
+  }
+]

+ 137 - 0
tasks/Component/SwitchSoul/ss/image.json

@@ -0,0 +1,137 @@
+[
+  {
+    "itemName": "record_soul_back",
+    "imageName": "ss_record_soul_back.png",
+    "roiFront": "19,9,51,44",
+    "roiBack": "19,9,51,44",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "退出式神录"
+  },
+  {
+    "itemName": "soul_preset",
+    "imageName": "ss_soul_preset.png",
+    "roiFront": "332,70,90,51",
+    "roiBack": "332,70,90,51",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "预设"
+  },
+  {
+    "itemName": "sou_switch_1",
+    "imageName": "ss_sou_switch_1.png",
+    "roiFront": "971,148,37,35",
+    "roiBack": "971,148,37,35",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "sou_switch_2",
+    "imageName": "ss_sou_switch_2.png",
+    "roiFront": "978,304,27,29",
+    "roiBack": "978,304,27,29",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "sou_switch_3",
+    "imageName": "ss_sou_switch_3.png",
+    "roiFront": "973,454,26,26",
+    "roiBack": "973,454,26,26",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "sou_switch_4",
+    "imageName": "ss_sou_switch_4.png",
+    "roiFront": "971,600,37,26",
+    "roiBack": "971,600,37,26",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "sou_switch_sure",
+    "imageName": "ss_sou_switch_sure.png",
+    "roiFront": "668,401,180,61",
+    "roiBack": "668,401,180,61",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "sou_check_in",
+    "imageName": "ss_sou_check_in.png",
+    "roiFront": "269,69,50,49",
+    "roiBack": "269,69,50,49",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "用于判断是否在式神录里面"
+  },
+  {
+    "itemName": "sou_check_group_1",
+    "imageName": "ss_sou_check_group_1.png",
+    "roiFront": "1086,91,22,57",
+    "roiBack": "1086,91,22,57",
+    "method": "Template matching",
+    "threshold": 0.9,
+    "description": "description"
+  },
+  {
+    "itemName": "sou_check_group_2",
+    "imageName": "ss_sou_check_group_2.png",
+    "roiFront": "1086,163,25,57",
+    "roiBack": "1086,163,25,57",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "sou_check_group_3",
+    "imageName": "ss_sou_check_group_3.png",
+    "roiFront": "1085,234,22,49",
+    "roiBack": "1085,234,22,49",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "sou_check_group_4",
+    "imageName": "ss_sou_check_group_4.png",
+    "roiFront": "1086,303,21,56",
+    "roiBack": "1086,303,21,56",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "sou_check_group_5",
+    "imageName": "ss_sou_check_group_5.png",
+    "roiFront": "1088,370,21,53",
+    "roiBack": "1088,370,21,53",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "sou_check_group_6",
+    "imageName": "ss_sou_check_group_6.png",
+    "roiFront": "1085,443,23,54",
+    "roiBack": "1085,443,23,54",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "sou_check_group_7",
+    "imageName": "ss_sou_check_group_7.png",
+    "roiFront": "1088,512,21,54",
+    "roiBack": "1088,512,21,54",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/Component/SwitchSoul/ss/ss_record_soul_back.png


BIN
tasks/Component/SwitchSoul/ss/ss_sou_check_group_1.png


BIN
tasks/Component/SwitchSoul/ss/ss_sou_check_group_2.png


BIN
tasks/Component/SwitchSoul/ss/ss_sou_check_group_3.png


BIN
tasks/Component/SwitchSoul/ss/ss_sou_check_group_4.png


BIN
tasks/Component/SwitchSoul/ss/ss_sou_check_group_5.png


BIN
tasks/Component/SwitchSoul/ss/ss_sou_check_group_6.png


BIN
tasks/Component/SwitchSoul/ss/ss_sou_check_group_7.png


BIN
tasks/Component/SwitchSoul/ss/ss_sou_check_in.png


BIN
tasks/Component/SwitchSoul/ss/ss_sou_switch_1.png


BIN
tasks/Component/SwitchSoul/ss/ss_sou_switch_2.png


BIN
tasks/Component/SwitchSoul/ss/ss_sou_switch_3.png


Some files were not shown because too many files changed in this diff