ryland пре 2 година
родитељ
комит
2879fa3e29
66 измењених фајлова са 1114 додато и 9 уклоњено
  1. 1 1
      module/config/config_manual.py
  2. 1 1
      module/config/config_menu.py
  3. 2 0
      module/config/config_model.py
  4. 1 1
      tasks/GameUi/assets.py
  5. BIN
      tasks/GameUi/page/page_check_six_gates.png
  6. BIN
      tasks/GameUi/page/page_exploration_goto_six_gates.png
  7. 2 2
      tasks/GameUi/page/page_img.json
  8. 4 0
      tasks/GlobalGame/assets.py
  9. 18 0
      tasks/GlobalGame/ui/image.json
  10. BIN
      tasks/GlobalGame/ui/ui_ui_check.png
  11. BIN
      tasks/GlobalGame/ui/ui_ui_uncheck.png
  12. 21 0
      tasks/SixRealms/README.md
  13. 118 0
      tasks/SixRealms/assets.py
  14. 10 0
      tasks/SixRealms/common.py
  15. 19 4
      tasks/SixRealms/config.py
  16. 20 0
      tasks/SixRealms/gate1/click.json
  17. BIN
      tasks/SixRealms/gate1/gate1_back_exit.png
  18. BIN
      tasks/SixRealms/gate1/gate1_coin.png
  19. BIN
      tasks/SixRealms/gate1/gate1_m_store.png
  20. BIN
      tasks/SixRealms/gate1/gate1_mconinue.png
  21. BIN
      tasks/SixRealms/gate1/gate1_menter.png
  22. BIN
      tasks/SixRealms/gate1/gate1_mfirst_skill.png
  23. BIN
      tasks/SixRealms/gate1/gate1_mshouzu.png
  24. BIN
      tasks/SixRealms/gate1/gate1_mshouzu_select.png
  25. BIN
      tasks/SixRealms/gate1/gate1_mshuten.png
  26. BIN
      tasks/SixRealms/gate1/gate1_mskip.png
  27. BIN
      tasks/SixRealms/gate1/gate1_mstart.png
  28. BIN
      tasks/SixRealms/gate1/gate1_mstart_check.png
  29. BIN
      tasks/SixRealms/gate1/gate1_mstart_confirm.png
  30. BIN
      tasks/SixRealms/gate1/gate1_mstart_uncheck.png
  31. BIN
      tasks/SixRealms/gate1/gate1_prepare_battle.png
  32. BIN
      tasks/SixRealms/gate1/gate1_select_0.png
  33. BIN
      tasks/SixRealms/gate1/gate1_select_1.png
  34. BIN
      tasks/SixRealms/gate1/gate1_select_2.png
  35. BIN
      tasks/SixRealms/gate1/gate1_select_3.png
  36. BIN
      tasks/SixRealms/gate1/gate1_skill_refresh.png
  37. 128 0
      tasks/SixRealms/gate1/image.json
  38. 29 0
      tasks/SixRealms/gate1/ocr.json
  39. 92 0
      tasks/SixRealms/gate1/skills.json
  40. 20 0
      tasks/SixRealms/l101/image.json
  41. BIN
      tasks/SixRealms/l101/l101_store_refresh.png
  42. BIN
      tasks/SixRealms/l101/l101_store_skill_101.png
  43. 38 0
      tasks/SixRealms/l102/image.json
  44. BIN
      tasks/SixRealms/l102/l102_.png
  45. BIN
      tasks/SixRealms/l102/l102_coin_right_top.png
  46. BIN
      tasks/SixRealms/l102/l102_imitate.png
  47. BIN
      tasks/SixRealms/l102/l102_imitate_1.png
  48. BIN
      tasks/SixRealms/l102/l102_imitate_success.png
  49. 11 0
      tasks/SixRealms/l103/image.json
  50. BIN
      tasks/SixRealms/l103/l103_exit.png
  51. 38 0
      tasks/SixRealms/l104/image.json
  52. BIN
      tasks/SixRealms/l104/l104_battle_team_lock.png
  53. BIN
      tasks/SixRealms/l104/l104_battle_team_unlock.png
  54. BIN
      tasks/SixRealms/l104/l104_npc_fire.png
  55. 40 0
      tasks/SixRealms/moon_sea/l101.py
  56. 53 0
      tasks/SixRealms/moon_sea/l102.py
  57. 54 0
      tasks/SixRealms/moon_sea/l103.py
  58. 23 0
      tasks/SixRealms/moon_sea/l104.py
  59. 40 0
      tasks/SixRealms/moon_sea/l105.py
  60. 99 0
      tasks/SixRealms/moon_sea/map.py
  61. 84 0
      tasks/SixRealms/moon_sea/moon_sea.py
  62. 85 0
      tasks/SixRealms/moon_sea/skills.py
  63. 63 0
      tasks/SixRealms/script_task.py
  64. BIN
      test_0.png
  65. BIN
      test_1.png
  66. BIN
      test_2.png

+ 1 - 1
module/config/config_manual.py

@@ -12,7 +12,7 @@ class ConfigManual:
         > KekkaiUtilize > KekkaiActivation > DemonEncounter
         > AreaBoss > GoldYoukai > ExperienceYoukai > Nian > Tako > RealmRaid > RyouToppa > DailyTrifles > Exploration
         > Dokan > Hunt 
-        > Orochi > OrochiMoans > OrochiJudgement > Sougenbi > FallenSun > EternitySea
+        > Orochi > OrochiMoans > OrochiJudgement > Sougenbi > FallenSun > EternitySea > SixRealms
         > ActivityShikigami > WantedQuests
         > BondlingFairyland > EvoZone > GoryouRealm
         > TrueOrochi > RichMan

+ 1 - 1
module/config/config_menu.py

@@ -19,7 +19,7 @@ class ConfigMenu:
         # 脚本设置
         self.menu['Script'] = ['Script', 'Restart', 'GlobalGame']
         # 刷御魂
-        self.menu["Soul Zones"] = ['Orochi', 'Sougenbi', 'FallenSun', 'EternitySea']
+        self.menu["Soul Zones"] = ['Orochi', 'Sougenbi', 'FallenSun', 'EternitySea', 'SixRealms']
         # 日常的任务
         self.menu["Daily Task"] = ['DailyTrifles', 'AreaBoss', 'GoldYoukai', 'ExperienceYoukai', 'Nian',
                                    'TalismanPass', 'DemonEncounter', 'Pets', 'SoulsTidy', 'Delegation', 'WantedQuests',

+ 2 - 0
module/config/config_model.py

@@ -41,6 +41,7 @@ from tasks.OrochiMoans.config import OrochiMoans
 from tasks.Sougenbi.config import Sougenbi
 from tasks.FallenSun.config import FallenSun
 from tasks.EternitySea.config import EternitySea
+from tasks.SixRealms.config import SixRealms
 from tasks.RealmRaid.config import RealmRaid
 from tasks.CollectiveMissions.config import CollectiveMissions
 from tasks.Hunt.config import Hunt
@@ -99,6 +100,7 @@ class ConfigModel(ConfigBase):
     sougenbi: Sougenbi = Field(default_factory=Sougenbi)
     fallen_sun: FallenSun = Field(default_factory=FallenSun)
     eternity_sea: EternitySea = Field(default_factory=EternitySea)
+    six_realms: SixRealms = Field(default_factory=SixRealms)
 
     # 这些是活动的
     activity_shikigami: ActivityShikigami = Field(default_factory=ActivityShikigami)

+ 1 - 1
tasks/GameUi/assets.py

@@ -53,7 +53,7 @@ class GameUiAssets:
 	# 平安奇谭 
 	I_EXPLORATION_GOTO_HEIAN_KITAN = RuleImage(roi_front=(739,643,52,44), roi_back=(739,643,52,44), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_heian_kitan.png")
 	# 六道之门 
-	I_EXPLORATION_GOTO_SIX_GATES = RuleImage(roi_front=(834,641,60,49), roi_back=(834,641,60,49), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_six_gates.png")
+	I_EXPLORATION_GOTO_SIX_GATES = RuleImage(roi_front=(838,640,60,49), roi_back=(793,632,143,66), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_six_gates.png")
 	# 器灵 
 	I_EXPLORATION_GOTO_BONDLING_FAIRYLAND = RuleImage(roi_front=(937,639,61,54), roi_back=(937,639,61,54), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_bondling_fairyland.png")
 	# description 

BIN
tasks/GameUi/page/page_check_six_gates.png


BIN
tasks/GameUi/page/page_exploration_goto_six_gates.png


+ 2 - 2
tasks/GameUi/page/page_img.json

@@ -101,8 +101,8 @@
   {
     "itemName": "exploration_goto_six_gates",
     "imageName": "page_exploration_goto_six_gates.png",
-    "roiFront": "834,641,60,49",
-    "roiBack": "834,641,60,49",
+    "roiFront": "838,640,60,49",
+    "roiBack": "793,632,143,66",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "六道之门"

+ 4 - 0
tasks/GlobalGame/assets.py

@@ -57,5 +57,9 @@ class GlobalGameAssets:
 	I_UI_CONFIRM_SAMLL = RuleImage(roi_front=(677,390,130,62), roi_back=(677,390,130,62), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_confirm_samll.png")
 	# 短一点的取消 
 	I_UI_CANCEL_SAMLL = RuleImage(roi_front=(472,389,128,62), roi_back=(472,389,128,62), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_cancel_samll.png")
+	# description 
+	I_UI_UNCHECK = RuleImage(roi_front=(567,343,33,36), roi_back=(497,303,216,100), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_uncheck.png")
+	# 勾选 
+	I_UI_CHECK = RuleImage(roi_front=(564,341,40,38), roi_back=(512,329,164,78), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/ui/ui_ui_check.png")
 
 

+ 18 - 0
tasks/GlobalGame/ui/image.json

@@ -79,5 +79,23 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "短一点的取消"
+  },
+  {
+    "itemName": "ui_uncheck",
+    "imageName": "ui_ui_uncheck.png",
+    "roiFront": "567,343,33,36",
+    "roiBack": "497,303,216,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "ui_check",
+    "imageName": "ui_ui_check.png",
+    "roiFront": "564,341,40,38",
+    "roiBack": "512,329,164,78",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "勾选"
   }
 ]

BIN
tasks/GlobalGame/ui/ui_ui_check.png


BIN
tasks/GlobalGame/ui/ui_ui_uncheck.png


+ 21 - 0
tasks/SixRealms/README.md

@@ -0,0 +1,21 @@
+
+moon sea 月之海
+Marks (印记
+
+
+Empowering Flow 柔风
+
+
+skill101 柔风
+skill102 细雨
+skill103 暴虐
+skill104 妖力化身
+
+island101 宁息 l101
+island102 神秘 l102
+island103 混沌 
+island104 鏖战
+island105 星之屿
+
+event101 宝箱
+event

+ 118 - 0
tasks/SixRealms/assets.py

@@ -0,0 +1,118 @@
+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 SixRealmsAssets: 
+
+
+	# Click Rule Assets
+	# 左边的 
+	C_NPC_FIRE_LEFT = RuleClick(roi_front=(423,203,153,193), roi_back=(423,203,153,193), name="npc_fire_left")
+	# description 
+	C_NPC_FIRE_RIGHT = RuleClick(roi_front=(740,248,181,180), roi_back=(740,248,181,180), name="npc_fire_right")
+	# 中间的精英 
+	C_NPC_FIRE_CENTER = RuleClick(roi_front=(620,188,174,217), roi_back=(620,188,174,217), name="npc_fire_center")
+
+
+	# Image Rule Assets
+	# description 
+	I_MENTER = RuleImage(roi_front=(346,167,30,100), roi_back=(346,167,30,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_menter.png")
+	# 酒吞 
+	I_MSHUTEN = RuleImage(roi_front=(46,609,70,65), roi_back=(46,609,70,65), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mshuten.png")
+	# 椒图选中 
+	I_MSHOUZU_SELECT = RuleImage(roi_front=(544,179,199,438), roi_back=(544,179,199,438), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mshouzu_select.png")
+	# 椒图 
+	I_MSHOUZU = RuleImage(roi_front=(43,608,73,67), roi_back=(43,608,73,67), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mshouzu.png")
+	# 开启 
+	I_MSTART = RuleImage(roi_front=(1136,575,100,100), roi_back=(1043,527,215,167), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mstart.png")
+	# description 
+	I_MSTART_CONFIRM = RuleImage(roi_front=(1136,575,100,100), roi_back=(1080,548,182,150), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mstart_confirm.png")
+	# description 
+	I_MSTART_UNCHECK = RuleImage(roi_front=(543,340,38,40), roi_back=(543,340,38,40), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mstart_uncheck.png")
+	# description 
+	I_MSTART_CHECK = RuleImage(roi_front=(542,340,39,41), roi_back=(542,340,39,41), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mstart_check.png")
+	#  
+	I_MSKIP = RuleImage(roi_front=(1117,28,58,36), roi_back=(1117,28,58,36), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mskip.png")
+	# 左下角备战 
+	I_PREPARE_BATTLE = RuleImage(roi_front=(33,640,48,54), roi_back=(33,640,48,54), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_prepare_battle.png")
+	# 继续执行 
+	I_MCONINUE = RuleImage(roi_front=(1121,578,100,100), roi_back=(1121,578,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mconinue.png")
+	# 选第一个柔风 
+	I_MFIRST_SKILL = RuleImage(roi_front=(255,577,141,39), roi_back=(206,550,227,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_mfirst_skill.png")
+	# 唤息 
+	I_M_STORE = RuleImage(roi_front=(1124,594,61,57), roi_back=(1103,576,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_m_store.png")
+	# 左上角退出 
+	I_BACK_EXIT = RuleImage(roi_front=(11,18,51,47), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_back_exit.png")
+
+
+	# Ocr Rule Assets
+	# Ocr-description 
+	O_OCR_MAP = RuleOcr(roi=(191,286,944,197), area=(191,286,944,197), mode="Full", method="Default", keyword="", name="ocr_map")
+	# Ocr-description 
+	O_ISLAND_NAME = RuleOcr(roi=(88,17,148,49), area=(88,17,148,49), mode="Single", method="Default", keyword="", name="island_name")
+	# 有多少钱 
+	O_COIN_NUM = RuleOcr(roi=(1171,23,59,31), area=(1171,23,59,31), mode="Digit", method="Default", keyword="", name="coin_num")
+
+
+	# Image Rule Assets
+	# 柔风 
+	I_SKILL101 = RuleImage(roi_front=(440,181,100,69), roi_back=(139,167,722,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_skill101.png")
+	# description 
+	I_SKILL102 = RuleImage(roi_front=(0,0,100,100), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_skill102.png")
+	# description 
+	I_SKILL103 = RuleImage(roi_front=(0,0,100,100), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_skill103.png")
+	# description 
+	I_SKILL104 = RuleImage(roi_front=(0,0,100,100), roi_back=(0,0,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_skill104.png")
+	# description 
+	I_SKILL_REFRESH = RuleImage(roi_front=(1196,625,44,39), roi_back=(1171,586,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_skill_refresh.png")
+	# description 
+	I_SELECT_0 = RuleImage(roi_front=(152,572,132,44), roi_back=(140,542,163,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_select_0.png")
+	# description 
+	I_SELECT_1 = RuleImage(roi_front=(424,573,137,46), roi_back=(382,544,196,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_select_1.png")
+	# description 
+	I_SELECT_2 = RuleImage(roi_front=(696,572,140,47), roi_back=(666,546,196,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_select_2.png")
+	# 最右边的恢复生命 
+	I_SELECT_3 = RuleImage(roi_front=(1016,581,145,43), roi_back=(1000,550,173,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_select_3.png")
+	# 六道的金币 
+	I_COIN = RuleImage(roi_front=(612,345,66,53), roi_back=(405,229,561,270), threshold=0.8, method="Template matching", file="./tasks/SixRealms/gate1/gate1_coin.png")
+
+
+	# Image Rule Assets
+	# 宁息刷新 
+	I_STORE_REFRESH = RuleImage(roi_front=(545,596,46,47), roi_back=(519,568,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l101/l101_store_refresh.png")
+	# 购买柔风 
+	I_STORE_SKILL_101 = RuleImage(roi_front=(876,121,47,41), roi_back=(682,100,455,571), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l101/l101_store_skill_101.png")
+
+
+	# Image Rule Assets
+	# 要花钱的界面购买 
+	I_COIN_RIGHT_TOP = RuleImage(roi_front=(1065,21,40,30), roi_back=(942,10,177,112), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l102/l102_coin_right_top.png")
+	# description 
+	I_IMITATE = RuleImage(roi_front=(1157,598,100,100), roi_back=(1143,577,127,132), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l102/l102_imitate.png")
+	# 仿造的技能 
+	I_IMITATE_1 = RuleImage(roi_front=(839,194,59,44), roi_back=(794,174,358,268), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l102/l102_imitate_1.png")
+	# description 
+	I_IMITATE_SUCCESS = RuleImage(roi_front=(535,143,209,54), roi_back=(429,122,414,100), threshold=0.7, method="Template matching", file="./tasks/SixRealms/l102/l102_imitate_success.png")
+
+
+	# Image Rule Assets
+	# description 
+	I_L103_EXIT = RuleImage(roi_front=(1161,600,69,70), roi_back=(1161,600,69,70), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l103/l103_exit.png")
+
+
+	# Image Rule Assets
+	# description 
+	I_NPC_COMMON = RuleImage(roi_front=(718,232,36,40), roi_back=(684,208,100,100), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l104/l104_npc_common.png")
+	# 点击挑战 
+	I_NPC_FIRE = RuleImage(roi_front=(1129,585,100,100), roi_back=(1080,551,174,144), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l104/l104_npc_fire.png")
+	# description 
+	I_BATTLE_TEAM_UNLOCK = RuleImage(roi_front=(962,676,21,21), roi_back=(943,655,64,60), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l104/l104_battle_team_unlock.png")
+	# description 
+	I_BATTLE_TEAM_LOCK = RuleImage(roi_front=(961,675,21,23), roi_back=(949,662,48,50), threshold=0.8, method="Template matching", file="./tasks/SixRealms/l104/l104_battle_team_lock.png")
+
+

+ 10 - 0
tasks/SixRealms/common.py

@@ -0,0 +1,10 @@
+from enum import Enum
+
+
+class MoonSeaType(Enum):
+    island101 = 101
+    island102 = 102
+    island103 = 103
+    island104 = 104  #
+
+

+ 19 - 4
tasks/SixRealms/config.py

@@ -5,12 +5,27 @@ from pydantic import BaseModel, Field
 
 from tasks.Component.config_scheduler import Scheduler
 from tasks.Component.config_base import ConfigBase
+from tasks.Component.SwitchSoul.switch_soul_config import SwitchSoulConfig
 
-class SixRealmsGate(BaseModel):
-    # 还没想好
-    greed_maneki: bool = Field(default=False, description="greed_maneki_help")
+# class SixRealmsGate(BaseModel):
+#     # 还没想好
+#     greed_maneki: bool = Field(default=False, description="greed_maneki_help")
 
 
-class SoulsTidy(ConfigBase):
+class SixRealms(ConfigBase):
     scheduler: Scheduler = Field(default_factory=Scheduler)
+    switch_soul_config: SwitchSoulConfig = Field(default_factory=SwitchSoulConfig)
     # six_realms_gate: SixRealmsGate = Field(default_factory=SixRealmsGate)
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 20 - 0
tasks/SixRealms/gate1/click.json

@@ -0,0 +1,20 @@
+[
+  {
+    "itemName": "npc_fire_left",
+    "roiFront": "423,203,153,193",
+    "roiBack": "423,203,153,193",
+    "description": "左边的"
+  },
+  {
+    "itemName": "npc_fire_right",
+    "roiFront": "740,248,181,180",
+    "roiBack": "740,248,181,180",
+    "description": "description"
+  },
+  {
+    "itemName": "npc_fire_center",
+    "roiFront": "620,188,174,217",
+    "roiBack": "620,188,174,217",
+    "description": "中间的精英"
+  }
+]

BIN
tasks/SixRealms/gate1/gate1_back_exit.png


BIN
tasks/SixRealms/gate1/gate1_coin.png


BIN
tasks/SixRealms/gate1/gate1_m_store.png


BIN
tasks/SixRealms/gate1/gate1_mconinue.png


BIN
tasks/SixRealms/gate1/gate1_menter.png


BIN
tasks/SixRealms/gate1/gate1_mfirst_skill.png


BIN
tasks/SixRealms/gate1/gate1_mshouzu.png


BIN
tasks/SixRealms/gate1/gate1_mshouzu_select.png


BIN
tasks/SixRealms/gate1/gate1_mshuten.png


BIN
tasks/SixRealms/gate1/gate1_mskip.png


BIN
tasks/SixRealms/gate1/gate1_mstart.png


BIN
tasks/SixRealms/gate1/gate1_mstart_check.png


BIN
tasks/SixRealms/gate1/gate1_mstart_confirm.png


BIN
tasks/SixRealms/gate1/gate1_mstart_uncheck.png


BIN
tasks/SixRealms/gate1/gate1_prepare_battle.png


BIN
tasks/SixRealms/gate1/gate1_select_0.png


BIN
tasks/SixRealms/gate1/gate1_select_1.png


BIN
tasks/SixRealms/gate1/gate1_select_2.png


BIN
tasks/SixRealms/gate1/gate1_select_3.png


BIN
tasks/SixRealms/gate1/gate1_skill_refresh.png


+ 128 - 0
tasks/SixRealms/gate1/image.json

@@ -0,0 +1,128 @@
+[
+  {
+    "itemName": "menter",
+    "imageName": "gate1_menter.png",
+    "roiFront": "346,167,30,100",
+    "roiBack": "346,167,30,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "mshuten",
+    "imageName": "gate1_mshuten.png",
+    "roiFront": "46,609,70,65",
+    "roiBack": "46,609,70,65",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "酒吞"
+  },
+  {
+    "itemName": "mshouzu_select",
+    "imageName": "gate1_mshouzu_select.png",
+    "roiFront": "544,179,199,438",
+    "roiBack": "544,179,199,438",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "椒图选中"
+  },
+  {
+    "itemName": "mshouzu",
+    "imageName": "gate1_mshouzu.png",
+    "roiFront": "43,608,73,67",
+    "roiBack": "43,608,73,67",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "椒图"
+  },
+  {
+    "itemName": "mstart",
+    "imageName": "gate1_mstart.png",
+    "roiFront": "1136,575,100,100",
+    "roiBack": "1043,527,215,167",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "开启"
+  },
+  {
+    "itemName": "mstart_confirm",
+    "imageName": "gate1_mstart_confirm.png",
+    "roiFront": "1136,575,100,100",
+    "roiBack": "1080,548,182,150",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "mstart_uncheck",
+    "imageName": "gate1_mstart_uncheck.png",
+    "roiFront": "543,340,38,40",
+    "roiBack": "543,340,38,40",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "mstart_check",
+    "imageName": "gate1_mstart_check.png",
+    "roiFront": "542,340,39,41",
+    "roiBack": "542,340,39,41",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "mskip",
+    "imageName": "gate1_mskip.png",
+    "roiFront": "1117,28,58,36",
+    "roiBack": "1117,28,58,36",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": ""
+  },
+  {
+    "itemName": "prepare_battle",
+    "imageName": "gate1_prepare_battle.png",
+    "roiFront": "33,640,48,54",
+    "roiBack": "33,640,48,54",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "左下角备战"
+  },
+  {
+    "itemName": "mconinue",
+    "imageName": "gate1_mconinue.png",
+    "roiFront": "1121,578,100,100",
+    "roiBack": "1121,578,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "继续执行"
+  },
+  {
+    "itemName": "mfirst_skill",
+    "imageName": "gate1_mfirst_skill.png",
+    "roiFront": "255,577,141,39",
+    "roiBack": "206,550,227,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "选第一个柔风"
+  },
+  {
+    "itemName": "m_store",
+    "imageName": "gate1_m_store.png",
+    "roiFront": "1124,594,61,57",
+    "roiBack": "1103,576,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "唤息"
+  },
+  {
+    "itemName": "back_exit",
+    "imageName": "gate1_back_exit.png",
+    "roiFront": "11,18,51,47",
+    "roiBack": "0,0,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "左上角退出"
+  }
+]

+ 29 - 0
tasks/SixRealms/gate1/ocr.json

@@ -0,0 +1,29 @@
+[
+  {
+    "itemName": "ocr_map",
+    "roiFront": "191,286,944,197",
+    "roiBack": "191,286,944,197",
+    "mode": "Full",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "island_name",
+    "roiFront": "88,17,148,49",
+    "roiBack": "88,17,148,49",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "coin_num",
+    "roiFront": "1171,23,59,31",
+    "roiBack": "1171,23,59,31",
+    "mode": "Digit",
+    "method": "Default",
+    "keyword": "",
+    "description": "有多少钱"
+  }
+]

+ 92 - 0
tasks/SixRealms/gate1/skills.json

@@ -0,0 +1,92 @@
+[
+  {
+    "itemName": "skill101",
+    "imageName": "gate1_skill101.png",
+    "roiFront": "440,181,100,69",
+    "roiBack": "139,167,722,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "柔风"
+  },
+  {
+    "itemName": "skill102",
+    "imageName": "gate1_skill102.png",
+    "roiFront": "0,0,100,100",
+    "roiBack": "0,0,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "skill103",
+    "imageName": "gate1_skill103.png",
+    "roiFront": "0,0,100,100",
+    "roiBack": "0,0,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "skill104",
+    "imageName": "gate1_skill104.png",
+    "roiFront": "0,0,100,100",
+    "roiBack": "0,0,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "skill_refresh",
+    "imageName": "gate1_skill_refresh.png",
+    "roiFront": "1196,625,44,39",
+    "roiBack": "1171,586,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "select_0",
+    "imageName": "gate1_select_0.png",
+    "roiFront": "152,572,132,44",
+    "roiBack": "140,542,163,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "select_1",
+    "imageName": "gate1_select_1.png",
+    "roiFront": "424,573,137,46",
+    "roiBack": "382,544,196,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "select_2",
+    "imageName": "gate1_select_2.png",
+    "roiFront": "696,572,140,47",
+    "roiBack": "666,546,196,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "select_3",
+    "imageName": "gate1_select_3.png",
+    "roiFront": "1016,581,145,43",
+    "roiBack": "1000,550,173,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "最右边的恢复生命"
+  },
+  {
+    "itemName": "coin",
+    "imageName": "gate1_coin.png",
+    "roiFront": "612,345,66,53",
+    "roiBack": "405,229,561,270",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "六道的金币"
+  }
+]

+ 20 - 0
tasks/SixRealms/l101/image.json

@@ -0,0 +1,20 @@
+[
+  {
+    "itemName": "store_refresh",
+    "imageName": "l101_store_refresh.png",
+    "roiFront": "545,596,46,47",
+    "roiBack": "519,568,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "宁息刷新"
+  },
+  {
+    "itemName": "store_skill_101",
+    "imageName": "l101_store_skill_101.png",
+    "roiFront": "876,121,47,41",
+    "roiBack": "682,100,455,571",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "购买柔风"
+  }
+]

BIN
tasks/SixRealms/l101/l101_store_refresh.png


BIN
tasks/SixRealms/l101/l101_store_skill_101.png


+ 38 - 0
tasks/SixRealms/l102/image.json

@@ -0,0 +1,38 @@
+[
+  {
+    "itemName": "coin_right_top",
+    "imageName": "l102_coin_right_top.png",
+    "roiFront": "1065,21,40,30",
+    "roiBack": "942,10,177,112",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "要花钱的界面购买"
+  },
+  {
+    "itemName": "imitate",
+    "imageName": "l102_imitate.png",
+    "roiFront": "1157,598,100,100",
+    "roiBack": "1143,577,127,132",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "imitate_1",
+    "imageName": "l102_imitate_1.png",
+    "roiFront": "839,194,59,44",
+    "roiBack": "794,174,358,268",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "仿造的技能"
+  },
+  {
+    "itemName": "imitate_success",
+    "imageName": "l102_imitate_success.png",
+    "roiFront": "535,143,209,54",
+    "roiBack": "429,122,414,100",
+    "method": "Template matching",
+    "threshold": 0.7,
+    "description": "description"
+  }
+]

BIN
tasks/SixRealms/l102/l102_.png


BIN
tasks/SixRealms/l102/l102_coin_right_top.png


BIN
tasks/SixRealms/l102/l102_imitate.png


BIN
tasks/SixRealms/l102/l102_imitate_1.png


BIN
tasks/SixRealms/l102/l102_imitate_success.png


+ 11 - 0
tasks/SixRealms/l103/image.json

@@ -0,0 +1,11 @@
+[
+  {
+    "itemName": "l103_exit",
+    "imageName": "l103_exit.png",
+    "roiFront": "1161,600,69,70",
+    "roiBack": "1161,600,69,70",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/SixRealms/l103/l103_exit.png


+ 38 - 0
tasks/SixRealms/l104/image.json

@@ -0,0 +1,38 @@
+[
+  {
+    "itemName": "npc_common",
+    "imageName": "l104_npc_common.png",
+    "roiFront": "718,232,36,40",
+    "roiBack": "684,208,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "npc_fire",
+    "imageName": "l104_npc_fire.png",
+    "roiFront": "1129,585,100,100",
+    "roiBack": "1080,551,174,144",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "点击挑战"
+  },
+  {
+    "itemName": "battle_team_unlock",
+    "imageName": "l104_battle_team_unlock.png",
+    "roiFront": "962,676,21,21",
+    "roiBack": "943,655,64,60",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  },
+  {
+    "itemName": "battle_team_lock",
+    "imageName": "l104_battle_team_lock.png",
+    "roiFront": "961,675,21,23",
+    "roiBack": "949,662,48,50",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
+  }
+]

BIN
tasks/SixRealms/l104/l104_battle_team_lock.png


BIN
tasks/SixRealms/l104/l104_battle_team_unlock.png


BIN
tasks/SixRealms/l104/l104_npc_fire.png


+ 40 - 0
tasks/SixRealms/moon_sea/l101.py

@@ -0,0 +1,40 @@
+
+from module.logger import logger
+from tasks.SixRealms.moon_sea.skills import MoonSeaSkills
+
+
+class MoonSeaL101(MoonSeaSkills):
+    def run_l101(self):
+        logger.hr('Start l101')
+        self.screenshot()
+        if self.appear(self.I_STORE_SKILL_101):
+            logger.info('Start purchase skill 101')
+            self.screenshot()
+            if not self.appear(self.I_STORE_SKILL_101):
+                logger.warning('Skill 101 purchase failed')
+            else:
+                while 1:
+                    self.screenshot()
+                    if self.in_main():
+                        break
+                    if self.appear_then_click(self.I_UI_CONFIRM_SAMLL, interval=1.5):
+                        continue
+                    if self.appear_then_click(self.I_UI_CONFIRM, interval=1.5):
+                        continue
+                    coin = self.O_COIN_NUM.ocr()
+                    if coin < 300:
+                        logger.info('Not enough coin')
+                        break
+                    if self.appear(self.I_STORE_SKILL_101, interval=3):
+                        x, y = self.I_STORE_SKILL_101.front_center()
+                        x -= 60
+                        self.device.click(x=x, y=y,)
+            while 1:
+                self.screenshot()
+                if self.in_main():
+                    break
+                if self.appear_then_click(self.I_L103_EXIT, interval=1.5):
+                    continue
+            logger.info('Finish purchase skill 101')
+
+

+ 53 - 0
tasks/SixRealms/moon_sea/l102.py

@@ -0,0 +1,53 @@
+
+from module.logger import logger
+from tasks.SixRealms.moon_sea.skills import MoonSeaSkills
+
+
+class MoonSeaL102(MoonSeaSkills):
+    def run_l102(self):
+        logger.hr('Start Island battle')
+        logger.info('Island 102')
+        is_imitation = None
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_COIN_RIGHT_TOP):
+                is_imitation = True
+                break
+            if self.appear(self.I_IMITATE):
+                is_imitation = False
+                break
+        if not is_imitation:
+            logger.info('Transfer skill')
+            logger.info('Do not transfer skill and exit')
+            while 1:
+                self.screenshot()
+                if self.in_main():
+                    break
+                if self.appear_then_click(self.I_UI_UNCHECK, interval=0.5):
+                    continue
+                if self.appear_then_click(self.I_UI_CONFIRM_SAMLL, interval=1.5):
+                    continue
+                if self.appear_then_click(self.I_UI_CONFIRM, interval=1.5):
+                    continue
+                if self.appear_then_click(self.I_BACK_EXIT, interval=3):
+                    continue
+            logger.info('Finish Island 102')
+            return
+        self.imitate()
+
+    def imitate(self):
+        # 仿造
+        logger.info('Imitate')
+        while 1:
+            self.screenshot()
+            if self.in_main():
+                break
+            if self.appear_then_click(self.I_IMITATE_1, interval=0.5):
+                continue
+            if self.appear_then_click(self.I_UI_CONFIRM_SAMLL, interval=1):
+                continue
+            if self.appear_then_click(self.I_UI_CONFIRM, interval=1):
+                continue
+            if self.appear_then_click(self.I_IMITATE, interval=2.5):
+                continue
+        logger.info('Finish Imitate')

+ 54 - 0
tasks/SixRealms/moon_sea/l103.py

@@ -0,0 +1,54 @@
+
+from module.logger import logger
+from tasks.SixRealms.moon_sea.skills import MoonSeaSkills
+
+
+class MoonSeaL103(MoonSeaSkills):
+    def run_103(self):
+        # 宝箱还是精英
+        logger.hr('Island 104')
+        is_box: bool = self.appear(self.I_L103_EXIT)
+        if is_box:
+            logger.info('Access to Box')
+            while 1:
+                self.screenshot()
+                if self.appear(self.I_M_STORE):
+                    logger.info('Not punched the treasure  box')
+                    return
+                if self.appear_then_click(self.I_UI_UNCHECK, interval=0.5):
+                    continue
+                if self.appear_then_click(self.I_UI_CONFIRM, interval=1):
+                    continue
+                if self.appear_then_click(self.I_L103_EXIT, interval=4):
+                    continue
+        self.battle_l103()
+        logger.info('Island 104 Finished')
+
+    def battle_l103(self):
+        # 打精英
+        logger.info('Start Island battle')
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_NPC_FIRE):
+                break
+            if self.click(self.C_NPC_FIRE_CENTER, interval=4):
+                continue
+        self.battle_lock_team()
+        self.island_battle()
+        logger.info('Island battle finished')
+        self.select_skill()
+
+
+
+
+if __name__ == '__main__':
+    from module.config.config import Config
+    from module.device.device import Device
+
+    c = Config('oas1')
+    d = Device(c)
+    t = MoonSeaL103(c, d)
+    t.screenshot()
+
+    # t.run_103()
+    t.island_battle()

+ 23 - 0
tasks/SixRealms/moon_sea/l104.py

@@ -0,0 +1,23 @@
+
+from module.logger import logger
+from tasks.SixRealms.moon_sea.skills import MoonSeaSkills
+
+
+class MoonSeaL104(MoonSeaSkills):
+    def run_l104(self):
+        logger.hr('Start Island battle')
+        logger.info('Island 104')
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_NPC_FIRE):
+                break
+            if self.click(self.C_NPC_FIRE_RIGHT, interval=4):
+                continue
+        self.battle_lock_team()
+        self.island_battle()
+        logger.info('Island battle finished')
+        self.select_skill()
+
+
+
+

+ 40 - 0
tasks/SixRealms/moon_sea/l105.py

@@ -0,0 +1,40 @@
+from module.logger import logger
+from tasks.SixRealms.moon_sea.skills import MoonSeaSkills
+
+
+class MoonSeaL105(MoonSeaSkills):
+
+    def run_l105(self):
+        """
+        打最普通的小怪是没有任何技能的
+        @return:
+        """
+        logger.hr('Start Island battle')
+        logger.info('Island 105')
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_NPC_FIRE):
+                break
+            if self.click(self.C_NPC_FIRE_LEFT):
+                continue
+        self.battle_lock_team()
+        self.island_battle()
+        logger.info('Island battle finished')
+        while 1:
+            self.screenshot()
+            if self.in_main():
+                break
+            if self.appear_then_click(self.I_COIN, action=self.C_UI_REWARD, interval=0.8):
+                continue
+
+
+if __name__ == '__main__':
+    from module.config.config import Config
+    from module.device.device import Device
+
+    c = Config('oas1')
+    d = Device(c)
+    t = MoonSeaL105(c, d)
+    t.screenshot()
+
+    t.run_l105()

+ 99 - 0
tasks/SixRealms/moon_sea/map.py

@@ -0,0 +1,99 @@
+import cv2
+import numpy as np
+from numpy import uint8, fromfile
+
+from tasks.base_task import BaseTask
+from tasks.SixRealms.assets import SixRealmsAssets
+from tasks.SixRealms.common import MoonSeaType
+
+
+def binaryzate(img):
+    img0 = img[..., 0]
+    img1 = img[..., 1]
+    img2 = img[..., 2]
+
+    mask0 = cv2.inRange(img0, MoonSeaMap.COLOR_RANGE_0[0], MoonSeaMap.COLOR_RANGE_0[1])
+    result0 = cv2.bitwise_and(img0, img0, mask=mask0)
+    mask1 = cv2.inRange(img1, 200, 250)
+    result1 = cv2.bitwise_and(img1, img1, mask=mask1)
+    mask2 = cv2.inRange(img2, 180, 230)
+    result2 = cv2.bitwise_and(img2, img2, mask=mask2)
+
+    result = np.zeros(img.shape, dtype=np.uint8)
+    result[..., 0]= result0
+    result[..., 1]= result1
+    result[..., 2]= result2
+    return  result
+
+
+class MoonSeaMap(BaseTask, SixRealmsAssets):
+
+    LOWER_COLOR = np.array([220, 190, 170])
+    UPPER_COLOR = np.array([260, 250, 230])
+    COLOR_RANGE_0 = [220, 250]
+
+    def detect_current(self) -> list[tuple]:
+        # self.screenshot()
+        img = self.device.image
+        # img = 255 - img
+        # print(img[403, 384])
+        # print(img[444, 378])
+        # print(img[411, 381])
+        # binary_img = img
+        # img = cv2.inRange(img, self.LOWER_COLOR, self.UPPER_COLOR)
+
+        # cv2.imwrite('test_0.png', img[..., 0])
+        # cv2.imwrite('test_1.png', img[..., 1])
+        # cv2.imwrite('test_2.png', img[..., 2])
+
+        img = binaryzate(img)
+        # iii = np.zeros((720, 1280, 3), dtype=np.uint8)
+        # iii[..., 0] = img
+        # iii[..., 1] = img
+        # iii[..., 2] = img
+        # img = iii
+
+        cv2.imshow('Binary Image', img)
+        cv2.waitKey(0)
+        cv2.destroyAllWindows()
+
+
+        boxs = self.O_OCR_MAP.detect_and_ocr(img)
+        for box in boxs:
+            print(box)
+        return []
+
+
+def _test():
+    from module.config.config import Config
+    from module.device.device import Device
+
+    c = Config('oas1')
+    d = Device(c)
+    t = MoonSeaMap(c, d)
+    import cv2
+    file_image = r'C:\Users\Ryland\Desktop\Desktop\34.png'
+    image = cv2.imdecode(fromfile(str(file_image), dtype=uint8), -1)
+    # image = cv2.imread(file_image)
+    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
+    t.device.image = image
+
+    t.detect_current()
+
+
+def _test2():
+    file_image = r'test_1.png'
+    image = cv2.imdecode(fromfile(str(file_image), dtype=uint8), -1)
+    print(image.shape)
+    result = image
+    mask = cv2.inRange(image, 210, 250)
+    # mask = 255 * mask
+    result = cv2.bitwise_and(image, image, mask=mask)
+    # 显示结果
+    cv2.imshow('Result', result)
+    cv2.waitKey(0)
+    cv2.destroyAllWindows()
+
+
+if __name__ == '__main__':
+    _test()

+ 84 - 0
tasks/SixRealms/moon_sea/moon_sea.py

@@ -0,0 +1,84 @@
+from module.logger import logger
+
+from tasks.SixRealms.moon_sea.map import MoonSeaMap
+from tasks.SixRealms.moon_sea.l101 import MoonSeaL101
+from tasks.SixRealms.moon_sea.l102 import MoonSeaL102
+from tasks.SixRealms.moon_sea.l103 import MoonSeaL103
+from tasks.SixRealms.moon_sea.l104 import MoonSeaL104
+from tasks.SixRealms.common import MoonSeaType
+
+
+class MoonSea(MoonSeaMap, MoonSeaL101, MoonSeaL102, MoonSeaL103, MoonSeaL104):
+    def run_moon_sea(self):
+        # 在六道界面
+        self.one()
+
+    def one(self):
+        self._start()
+
+    def _start(self):
+        logger.hr('Moon Sea', 1)
+        self.ui_click(self.I_MENTER, stop=self.I_MSTART)
+        logger.info("Ensure select ShouZu")
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_MSHOUZU):
+                break
+            if self.appear_then_click(self.I_MSHUTEN, interval=3):
+                continue
+            if self.appear_then_click(self.I_MSHOUZU_SELECT, interval=1):
+                continue
+        logger.info("Ensure selected ShouZu")
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_PREPARE_BATTLE):
+                break
+            if self.appear_then_click(self.I_MSTART_UNCHECK, interval=0.6):
+                continue
+            if self.appear_then_click(self.I_UI_CONFIRM, interval=1):
+                continue
+            if self.appear_then_click(self.I_UI_CONFIRM_SAMLL, interval=1):
+                continue
+            if self.appear_then_click(self.I_MSKIP, interval=1.5):
+                continue
+            if self.appear_then_click(self.I_MSTART, interval=3):
+                continue
+            if self.appear_then_click(self.I_MSTART_CONFIRM, interval=3):
+                continue
+            if self.appear_then_click(self.I_MCONINUE, interval=3):
+                continue
+        logger.info("Start Roguelike")
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_M_STORE):
+                break
+            if self.appear_then_click(self.I_MFIRST_SKILL, interval=1):
+                continue
+        # 选中第一个柔风
+        logger.info("Select first skill")
+
+    def island_name(self) -> MoonSeaType:
+        while 1:
+            self.screenshot()
+            text = self.O_ISLAND_NAME.ocr(self.device.image)
+            # 混沌 战
+            if '战' in text:
+                return MoonSeaType.island104
+            if '混沌' in text:
+                return MoonSeaType.island103
+            if '神秘' in text:
+                return MoonSeaType.island102
+            if '宁息' in text:
+                return MoonSeaType.island101
+
+
+if __name__ == '__main__':
+    from module.config.config import Config
+    from module.device.device import Device
+
+    c = Config('oas1')
+    d = Device(c)
+    t = MoonSea(c, d)
+    t.screenshot()
+
+    t.run_moon_sea()

+ 85 - 0
tasks/SixRealms/moon_sea/skills.py

@@ -0,0 +1,85 @@
+from cached_property import cached_property
+
+from module.logger import logger
+from tasks.base_task import BaseTask
+from tasks.SixRealms.assets import SixRealmsAssets
+
+
+class MoonSeaSkills(BaseTask, SixRealmsAssets):
+
+
+    def in_main(self, screenshot: bool = False):
+        if screenshot:
+            self.screenshot()
+        return self.appear(self.I_M_STORE)
+
+    def battle_lock_team(self):
+        self.ui_click(self.I_BATTLE_TEAM_UNLOCK, self.I_BATTLE_TEAM_LOCK)
+        return
+
+    def island_battle(self):
+        # 小怪战斗
+        self.screenshot()
+        self.device.stuck_record_add('LOGIN_CHECK')
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_SKILL_REFRESH):
+                break
+            if self.appear(self.I_COIN):
+                break
+            if self.appear_then_click(self.I_NPC_FIRE, interval=1):
+                continue
+        self.device.stuck_record_clear()
+
+    @cached_property
+    def selects_button(self):
+        return [
+            self.I_SELECT_0,
+            self.I_SELECT_1,
+            self.I_SELECT_2,
+            self.I_SELECT_3,
+        ]
+
+    def _select_skill(self) -> int:
+        self.screenshot()
+        select = 3  # 从0开始计数
+        button = None
+        if button is None and self.appear(self.I_SKILL101):
+            button = self.I_SKILL101
+        elif button is None and self.appear(self.I_SKILL102):
+            button = self.I_SKILL102
+        elif button is None and self.appear(self.I_SKILL103):
+            button = self.I_SKILL103
+        elif button is None and self.appear(self.I_SKILL104):
+            button = self.I_SKILL104
+        if button is not None:
+            x, y = button.front_center()
+            if x < 360:
+                select = 0
+            elif 360 <= x < 640:
+                select = 1
+            elif 640 <= x < 960:
+                select = 2
+            else:
+                select = 3
+        logger.info(f'Select {select}')
+        return select
+
+    def select_skill(self):
+        # 战斗结束后选技能
+        logger.info('Start select skill')
+
+        while 1:
+            self.screenshot()
+            if self.appear(self.I_SKILL_REFRESH):
+                select = self._select_skill()
+                if self.appear_then_click(self.selects_button[select]):
+                    continue
+            if self.appear(self.I_COIN):
+                while 1:
+                    self.screenshot()
+                    if self.in_main():
+                        break
+                    if self.appear_then_click(self.I_COIN, action=self.C_UI_REWARD, interval=0.8):
+                        continue
+

+ 63 - 0
tasks/SixRealms/script_task.py

@@ -1,3 +1,66 @@
 # This Python file uses the following encoding: utf-8
 # @author runhey
 # github https://github.com/runhey
+from cached_property import cached_property
+
+
+
+from tasks.GameUi.game_ui import GameUi
+from tasks.GameUi.page import page_main, page_soul_zones, page_shikigami_records
+from module.logger import logger
+from module.exception import TaskEnd
+
+
+from time import sleep
+from datetime import time, datetime, timedelta
+
+from tasks.Sougenbi.assets import SougenbiAssets
+from tasks.Sougenbi.config import SougenbiConfig, SougenbiClass
+
+from tasks.Component.SwitchSoul.switch_soul import SwitchSoul
+from tasks.GameUi.game_ui import GameUi
+from tasks.GameUi.page import page_main, page_six_gates
+from module.logger import logger
+
+
+class ScriptTask(GameUi, SwitchSoul):
+
+    @property
+    def _config(self):
+        return self.config.model.six_realms
+
+    def run(self):
+        if self._config.switch_soul_config.enable:
+            self.ui_get_current_page()
+            self.ui_goto(page_shikigami_records)
+            self.run_switch_soul(self._config.switch_soul_config.switch_group_team)
+        if self._config.switch_soul_config.enable_switch_by_name:
+            self.ui_get_current_page()
+            self.ui_goto(page_shikigami_records)
+            self.run_switch_soul_by_name(
+                self._config.switch_soul_config.group_name,
+                self._config.switch_soul_config.team_name
+            )
+        self.ui_get_current_page()
+        self.ui_goto(page_six_gates)
+
+        self.set_next_run('SixRealms', success=True, finish=True)
+        raise TaskEnd
+
+    def run_moon_sea(self):
+        pass
+
+
+
+
+
+
+if __name__ == '__main__':
+    from module.config.config import Config
+    from module.device.device import Device
+    c = Config('oas1')
+    d = Device(c)
+    t = ScriptTask(c, d)
+    t.screenshot()
+
+    t.run()