Explorar o código

perf: reuse config scheduler and remove Ocochi

runhey %!s(int64=3) %!d(string=hai) anos
pai
achega
dbe47bf0fc
Modificáronse 56 ficheiros con 26 adicións e 927 borrados
  1. 1 1
      module/config/config_menu.py
  2. 2 2
      tasks/AreaBoss/config.py
  3. 0 24
      tasks/AreaBoss/config_scheduler.py
  4. 1 1
      tasks/AreaBoss/script_task.py
  5. 10 0
      tasks/Component/README.md
  6. 0 0
      tasks/Component/config_scheduler.py
  7. 0 1
      tasks/DemonEncounter/config.py
  8. 0 15
      tasks/DemonEncounter/config_scheduler.py
  9. 1 1
      tasks/EternitySea/config.py
  10. 0 15
      tasks/EternitySea/config_scheduler.py
  11. 1 1
      tasks/ExperienceYoukai/config.py
  12. 0 15
      tasks/ExperienceYoukai/config_scheduler.py
  13. 1 1
      tasks/FallenSun/config.py
  14. 0 15
      tasks/FallenSun/config_scheduler.py
  15. 0 97
      tasks/GeneralBattle/assets.py
  16. 0 50
      tasks/GeneralBattle/config_general_battle.py
  17. 0 237
      tasks/GeneralBattle/general_battle.py
  18. 0 110
      tasks/GeneralBattle/res/click.json
  19. 0 164
      tasks/GeneralBattle/res/image.json
  20. BIN=BIN
      tasks/GeneralBattle/res/res_buff.png
  21. BIN=BIN
      tasks/GeneralBattle/res/res_buff_awaken.png
  22. BIN=BIN
      tasks/GeneralBattle/res/res_buff_exp_100.png
  23. BIN=BIN
      tasks/GeneralBattle/res/res_buff_exp_50.png
  24. BIN=BIN
      tasks/GeneralBattle/res/res_buff_gold_100.png
  25. BIN=BIN
      tasks/GeneralBattle/res/res_buff_gold_50.png
  26. BIN=BIN
      tasks/GeneralBattle/res/res_buff_soul.png
  27. BIN=BIN
      tasks/GeneralBattle/res/res_exit.png
  28. BIN=BIN
      tasks/GeneralBattle/res/res_exit_ensure.png
  29. BIN=BIN
      tasks/GeneralBattle/res/res_false.png
  30. BIN=BIN
      tasks/GeneralBattle/res/res_local.png
  31. BIN=BIN
      tasks/GeneralBattle/res/res_prepare_dark.png
  32. BIN=BIN
      tasks/GeneralBattle/res/res_prepare_highlight.png
  33. BIN=BIN
      tasks/GeneralBattle/res/res_preset.png
  34. BIN=BIN
      tasks/GeneralBattle/res/res_preset_ensure.png
  35. BIN=BIN
      tasks/GeneralBattle/res/res_reward.png
  36. BIN=BIN
      tasks/GeneralBattle/res/res_statistics.png
  37. BIN=BIN
      tasks/GeneralBattle/res/res_win.png
  38. 0 16
      tasks/GeneralBattle/res/swipe.json
  39. 1 1
      tasks/GoldYoukai/config.py
  40. 0 15
      tasks/GoldYoukai/config_scheduler.py
  41. 1 1
      tasks/Hunt/config.py
  42. 0 15
      tasks/Hunt/config_scheduler.py
  43. 1 1
      tasks/Nian/config.py
  44. 0 15
      tasks/Nian/config_scheduler.py
  45. 1 1
      tasks/Orochi/config.py
  46. 0 15
      tasks/Orochi/config_scheduler.py
  47. 0 12
      tasks/OrochiJudgement/assets.py
  48. 0 11
      tasks/OrochiJudgement/config.py
  49. 0 15
      tasks/OrochiJudgement/config_scheduler.py
  50. 1 1
      tasks/OrochiMoans/config.py
  51. 0 15
      tasks/OrochiMoans/config_scheduler.py
  52. 2 2
      tasks/RealmRaid/config.py
  53. 1 1
      tasks/RealmRaid/script_task.py
  54. 1 1
      tasks/Sougenbi/config.py
  55. 0 15
      tasks/Sougenbi/config_scheduler.py
  56. 0 24
      tasks/Utils/config_scheduler.py

+ 1 - 1
module/config/config_menu.py

@@ -17,7 +17,7 @@ class ConfigMenu:
         # 脚本设置
         # 脚本设置
         self.menu['Script'] = ['Script', 'General', 'Restart', 'GlobalGame']
         self.menu['Script'] = ['Script', 'General', 'Restart', 'GlobalGame']
         # 刷御魂
         # 刷御魂
-        self.menu["Soul Zones"] = ['Orochi', 'OrochiMoans', 'OrochiJudgement', 'Sougenbi', 'FallenSun', 'EternitySea']
+        self.menu["Soul Zones"] = ['Orochi', 'Sougenbi', 'FallenSun', 'EternitySea']
         # 日常的任务
         # 日常的任务
         self.menu["Daily Task"] = ['AreaBoss', 'GoldYoukai', 'ExperienceYoukai', 'Nian', 'RealmRaid']
         self.menu["Daily Task"] = ['AreaBoss', 'GoldYoukai', 'ExperienceYoukai', 'Nian', 'RealmRaid']
 
 

+ 2 - 2
tasks/AreaBoss/config.py

@@ -3,8 +3,8 @@
 # github https://github.com/runhey
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
 from pydantic import BaseModel, Field
 
 
-from tasks.Utils.config_scheduler import Scheduler
-from tasks.GeneralBattle.config_general_battle import GeneralBattleConfig
+from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
+from tasks.Component.config_scheduler import Scheduler
 from tasks.AreaBoss.config_boss import Boss
 from tasks.AreaBoss.config_boss import Boss
 
 
 
 

+ 0 - 24
tasks/AreaBoss/config_scheduler.py

@@ -1,24 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from enum import Enum
-from datetime import datetime, time
-from pydantic import BaseModel, ValidationError, validator, Field
-
-class Scheduler(BaseModel):
-    enable: bool = Field(default=False, description='[是否启用]:默认为False')
-    next_run: datetime = Field(default="2023-01-01 00:00:00",
-                               description='[下次执行时间]:默认为2023-01-01 00:00:00\n 清空后回车设置当前的时间')
-    interval_days: int = Field(default=1, description='[间隔天数]:默认为1\n 可选0-7')
-    interval_hours: int = Field(default=0, description='[间隔小时]:默认为0\n 可选0-23')
-    interval_minutes: int = Field(default=0, description='[间隔分钟]:默认为0\n 可选0-59')
-
-    @validator('next_run')
-    def parse_next_run(cls, value):
-        if isinstance(value, str):
-            try:
-                return datetime.fromisoformat(value)
-            except ValueError:
-                raise ValueError('Invalid next_run value. Expected format: YYYY-MM-DD HH:MM:SS')
-        return value
-

+ 1 - 1
tasks/AreaBoss/script_task.py

@@ -4,7 +4,7 @@
 import time
 import time
 
 
 from tasks.base_task import BaseTask
 from tasks.base_task import BaseTask
-from tasks.GeneralBattle.general_battle import GeneralBattle
+from tasks.Component.GeneralBattle.general_battle import GeneralBattle
 from tasks.AreaBoss.assets import AreaBossAssets
 from tasks.AreaBoss.assets import AreaBossAssets
 from module.logger import logger
 from module.logger import logger
 from module.exception import TaskEnd
 from module.exception import TaskEnd

+ 10 - 0
tasks/Component/README.md

@@ -0,0 +1,10 @@
+# 这部分是复用的组件模块
+
+- 通用的战斗
+- 通用邀请队友
+
+
+
+## 配置相关
+- config_scheduler.py
+    - 任务调度器的配置

+ 0 - 0
tasks/RealmRaid/config_scheduler.py → tasks/Component/config_scheduler.py


+ 0 - 1
tasks/DemonEncounter/config.py

@@ -3,4 +3,3 @@
 # github https://github.com/runhey
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
 from pydantic import BaseModel, Field
 
 
-from tasks.DemonEncounter.config_scheduler import Scheduler

+ 0 - 15
tasks/DemonEncounter/config_scheduler.py

@@ -1,15 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from enum import Enum
-from datetime import datetime, time
-from pydantic import BaseModel, ValidationError, validator, Field
-
-class Scheduler(BaseModel):
-    enable: bool = Field(default=False, description='[是否启用]:默认为False')
-    next_run: datetime = Field(default="2023-01-01 00:00:00",
-                               description='[下次执行时间]:默认为2023-01-01 00:00:00\n 清空后回车设置当前的时间')
-    interval_days: int = Field(default=1, description='[间隔天数]:默认为1\n 可选0-7')
-    interval_hours: int = Field(default=0, description='[间隔小时]:默认为0\n 可选0-23')
-    interval_minutes: int = Field(default=0, description='[间隔分钟]:默认为0\n 可选0-59')
-

+ 1 - 1
tasks/EternitySea/config.py

@@ -3,7 +3,7 @@
 # github https://github.com/runhey
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
 from pydantic import BaseModel, Field
 
 
-from tasks.EternitySea.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 
 
 
 class EternitySea(BaseModel):
 class EternitySea(BaseModel):

+ 0 - 15
tasks/EternitySea/config_scheduler.py

@@ -1,15 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from enum import Enum
-from datetime import datetime, time
-from pydantic import BaseModel, ValidationError, validator, Field
-
-class Scheduler(BaseModel):
-    enable: bool = Field(default=False, description='[是否启用]:默认为False')
-    next_run: datetime = Field(default="2023-01-01 00:00:00",
-                               description='[下次执行时间]:默认为2023-01-01 00:00:00\n 清空后回车设置当前的时间')
-    interval_days: int = Field(default=1, description='[间隔天数]:默认为1\n 可选0-7')
-    interval_hours: int = Field(default=0, description='[间隔小时]:默认为0\n 可选0-23')
-    interval_minutes: int = Field(default=0, description='[间隔分钟]:默认为0\n 可选0-59')
-

+ 1 - 1
tasks/ExperienceYoukai/config.py

@@ -3,7 +3,7 @@
 # github https://github.com/runhey
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
 from pydantic import BaseModel, Field
 
 
-from tasks.ExperienceYoukai.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 
 class ExperienceYoukai(BaseModel):
 class ExperienceYoukai(BaseModel):
     scheduler: Scheduler = Field(default_factory=Scheduler)
     scheduler: Scheduler = Field(default_factory=Scheduler)

+ 0 - 15
tasks/ExperienceYoukai/config_scheduler.py

@@ -1,15 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from enum import Enum
-from datetime import datetime, time
-from pydantic import BaseModel, ValidationError, validator, Field
-
-class Scheduler(BaseModel):
-    enable: bool = Field(default=False, description='[是否启用]:默认为False')
-    next_run: datetime = Field(default="2023-01-01 00:00:00",
-                               description='[下次执行时间]:默认为2023-01-01 00:00:00\n 清空后回车设置当前的时间')
-    interval_days: int = Field(default=1, description='[间隔天数]:默认为1\n 可选0-7')
-    interval_hours: int = Field(default=0, description='[间隔小时]:默认为0\n 可选0-23')
-    interval_minutes: int = Field(default=0, description='[间隔分钟]:默认为0\n 可选0-59')
-

+ 1 - 1
tasks/FallenSun/config.py

@@ -3,7 +3,7 @@
 # github https://github.com/runhey
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
 from pydantic import BaseModel, Field
 
 
-from tasks.FallenSun.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 
 
 
 class FallenSun(BaseModel):
 class FallenSun(BaseModel):

+ 0 - 15
tasks/FallenSun/config_scheduler.py

@@ -1,15 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from enum import Enum
-from datetime import datetime, time
-from pydantic import BaseModel, ValidationError, validator, Field
-
-class Scheduler(BaseModel):
-    enable: bool = Field(default=False, description='[是否启用]:默认为False')
-    next_run: datetime = Field(default="2023-01-01 00:00:00",
-                               description='[下次执行时间]:默认为2023-01-01 00:00:00\n 清空后回车设置当前的时间')
-    interval_days: int = Field(default=1, description='[间隔天数]:默认为1\n 可选0-7')
-    interval_hours: int = Field(default=0, description='[间隔小时]:默认为0\n 可选0-23')
-    interval_minutes: int = Field(default=0, description='[间隔分钟]:默认为0\n 可选0-59')
-

+ 0 - 97
tasks/GeneralBattle/assets.py

@@ -1,97 +0,0 @@
-from module.atom.image import RuleImage
-from module.atom.click import RuleClick
-from module.atom.long_click import RuleLongClick
-from module.atom.swipe import RuleSwipe
-from module.atom.ocr import RuleOcr
-from module.atom.list import RuleList
-
-# This file was automatically generated by module/dev_tools/assets_extract.py.
-# Don't modify it manually.
-class GeneralBattleAssets: 
-
-
-	# 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")
-	# 预设队伍2 
-	C_PRESET_TEAM_2 = RuleClick(roi_front=(197,358,465,103), roi_back=(197,358,465,103), name="preset_team_2")
-	# 预设队伍3 
-	C_PRESET_TEAM_3 = RuleClick(roi_front=(195,480,462,100), roi_back=(195,480,462,100), name="preset_team_3")
-	# 预设队伍4 
-	C_PRESET_TEAM_4 = RuleClick(roi_front=(193,596,464,35), roi_back=(193,596,464,35), name="preset_team_4")
-	# 预设组1 
-	C_PRESET_GROUP_1 = RuleClick(roi_front=(28,238,134,56), roi_back=(28,238,134,56), name="preset_group_1")
-	# 预设组2 
-	C_PRESET_GROUP_2 = RuleClick(roi_front=(31,298,132,60), roi_back=(31,298,132,60), name="preset_group_2")
-	# 预设组3 
-	C_PRESET_GROUP_3 = RuleClick(roi_front=(31,362,135,59), roi_back=(31,362,135,59), name="preset_group_3")
-	# 预设组4 
-	C_PRESET_GROUP_4 = RuleClick(roi_front=(29,427,133,57), roi_back=(29,427,133,57), name="preset_group_4")
-	# 预设组5 
-	C_PRESET_GROUP_5 = RuleClick(roi_front=(31,489,133,60), roi_back=(31,489,133,60), name="preset_group_5")
-	# 预设组6 
-	C_PRESET_GROUP_6 = RuleClick(roi_front=(31,549,132,63), roi_back=(31,549,132,63), name="preset_group_6")
-	# 预设组7 
-	C_PRESET_GROUP_7 = RuleClick(roi_front=(29,615,137,63), roi_back=(29,615,137,63), name="preset_group_7")
-	# 从左开始第一个绿标 
-	C_GREEN_LEFT_1 = RuleClick(roi_front=(128,433,90,150), roi_back=(128,433,90,150), name="green_left_1")
-	# 从左开始第二个绿标 
-	C_GREEN_LEFT_2 = RuleClick(roi_front=(371,385,81,145), roi_back=(371,385,81,145), name="green_left_2")
-	# 从左开始第三个绿标 
-	C_GREEN_LEFT_3 = RuleClick(roi_front=(586,328,100,76), roi_back=(586,328,100,76), name="green_left_3")
-	# 从左开始第四个绿标 
-	C_GREEN_LEFT_4 = RuleClick(roi_front=(817,379,77,133), roi_back=(817,379,77,133), name="green_left_4")
-	# 从左开始第五个绿标 
-	C_GREEN_LEFT_5 = RuleClick(roi_front=(1059,416,85,145), roi_back=(1059,416,85,145), name="green_left_5")
-	# 绿标阴阳师 
-	C_GREEN_MAIN = RuleClick(roi_front=(590,454,88,178), roi_back=(590,454,88,178), name="green_main")
-	# 战斗的时候有一定的概率随机点击 
-	C_RANDOM_CLICK = RuleClick(roi_front=(104,79,1050,507), roi_back=(255,65,100,100), name="random_click")
-
-
-	# Image Rule Assets
-	# 奖励,就是那个魂 
-	I_REWARD = RuleImage(roi_front=(547,518,172,96), roi_back=(547,518,172,96), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_reward.png")
-	# 预设的小图标 
-	I_PRESET = RuleImage(roi_front=(32,650,47,45), roi_back=(32,650,47,45), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_preset.png")
-	# 准备 
-	I_PREPARE_HIGHLIGHT = RuleImage(roi_front=(1128,536,100,100), roi_back=(1128,536,100,100), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_prepare_highlight.png")
-	# 战斗胜利 
-	I_WIN = RuleImage(roi_front=(427,135,100,100), roi_back=(427,135,100,100), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_win.png")
-	# 准备但是界面还未加载这个时候是黑色的 
-	I_PREPARE_DARK = RuleImage(roi_front=(1131,538,100,100), roi_back=(1131,538,100,100), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_prepare_dark.png")
-	# 失败 
-	I_FALSE = RuleImage(roi_front=(413,124,100,100), roi_back=(413,124,100,100), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_false.png")
-	# 确认预设的队伍 
-	I_PRESET_ENSURE = RuleImage(roi_front=(354,641,141,50), roi_back=(354,641,141,50), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_preset_ensure.png")
-	# 选择buff 
-	I_BUFF = RuleImage(roi_front=(113,653,44,62), roi_back=(113,653,44,62), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_buff.png")
-	# 觉醒加成 
-	I_BUFF_AWAKEN = RuleImage(roi_front=(373,126,383,53), roi_back=(373,126,383,53), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_buff_awaken.png")
-	# 御魂加成 
-	I_BUFF_SOUL = RuleImage(roi_front=(377,192,371,56), roi_back=(377,192,371,56), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_buff_soul.png")
-	# 金币加成50 
-	I_BUFF_GOLD_50 = RuleImage(roi_front=(375,259,373,56), roi_back=(375,259,373,56), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_buff_gold_50.png")
-	# 金币加成100 
-	I_BUFF_GOLD_100 = RuleImage(roi_front=(371,329,389,54), roi_back=(371,329,389,54), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_buff_gold_100.png")
-	# 经验加成50 
-	I_BUFF_EXP_50 = RuleImage(roi_front=(378,400,370,50), roi_back=(378,400,370,50), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_buff_exp_50.png")
-	# 经验加成100 
-	I_BUFF_EXP_100 = RuleImage(roi_front=(372,463,386,50), roi_back=(372,463,386,50), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_buff_exp_100.png")
-	# 左下角的位置指针 
-	I_LOCAL = RuleImage(roi_front=(25,563,30,34), roi_back=(25,563,30,34), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_local.png")
-	# description 
-	I_STATISTICS = RuleImage(roi_front=(61,644,33,28), roi_back=(61,644,33,28), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_statistics.png")
-	# 左上角的退出 
-	I_EXIT = RuleImage(roi_front=(14,12,43,41), roi_back=(14,12,43,41), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_exit.png")
-	# 退出确认 
-	I_EXIT_ENSURE = RuleImage(roi_front=(674,388,135,63), roi_back=(674,388,135,63), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_exit_ensure.png")
-
-
-	# Swipe Rule Assets
-	# description 
-	S_BATTLE_RANDOM_LEFT = RuleSwipe(roi_front=(122,155,480,426), roi_back=(667,147,461,427), mode="default", name="battle_random_left")
-	# description 
-	S_BATTLE_RANDOM_RIGHT = RuleSwipe(roi_front=(719,138,417,392), roi_back=(237,163,387,394), mode="default", name="battle_random_right")
-
-

+ 0 - 50
tasks/GeneralBattle/config_general_battle.py

@@ -1,50 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from enum import Enum
-from datetime import datetime, time
-from pydantic import BaseModel, ValidationError, validator, Field
-
-class GreenMarkType(str, Enum):
-    GREEN_LEFT1 = 'green_left1'
-    GREEN_LEFT2 = 'green_left2'
-    GREEN_LEFT3 = 'green_left3'
-    GREEN_LEFT4 = 'green_left4'
-    GREEN_LEFT5 = 'green_left5'
-    GREEN_MAIN = 'green_main'
-
-class GeneralBattleConfig(BaseModel):
-
-    # 是否锁定阵容, 有些的战斗是外边的锁定阵容甚至有些的战斗没有锁定阵容的
-    lock_team_enable: bool = Field(default=False, description='[锁定阵容]:默认为False \n如果锁定阵容将无法启用预设队伍、加成功能')
-
-    # 是否启动 预设队伍
-    preset_enable: bool = Field(default=False, description='[启用预设]:默认为False')
-    # 选哪一个预设组
-    preset_group: int = Field(default=1, description='[设置预设组]:默认为1, 可选[1-7]', ge=1, le=7)
-    # 选哪一个队伍
-    preset_team: int = Field(default=1, description='[设置预设队伍]:默认为1, 可选[1-5]', ge=1, le=5)
-    # 是否启动开启buff
-    buff_enable: bool = Field(default=False, description='[启用加成]:默认为False')
-    # 是否点击觉醒Buff
-    buff_awake_click: bool = Field(default=False, description='[觉醒加成]:默认为False')
-    # 是否点击御魂buff
-    buff_soul_click: bool = Field(default=False, description='[御魂加成]:默认为False')
-    # 是否点击金币50buff
-    buff_gold_50_click: bool = Field(default=False, description='[金币50加成]:默认为False')
-    # 是否点击金币100buff
-    buff_gold_100_click: bool = Field(default=False, description='[金币100加成]:默认为False')
-    # 是否点击经验50buff
-    buff_exp_50_click: bool = Field(default=False, description='[经验50加成]:默认为False')
-    # 是否点击经验100buff
-    buff_exp_100_click: bool = Field(default=False, description='[经验100加成]:默认为False')
-
-    # 是否开启绿标
-    green_enable: bool = Field(default=False, description='[启用绿标]:默认为False')
-    # 选哪一个绿标
-    green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='[设置绿标]:默认为左一 \n可选[左一, 左二, 左三, 左四, 左五, 主阴阳师]')
-
-    # 是否启动战斗时随机点击或者随机滑动
-    random_click_swipt_enable: bool = Field(default=False, description='[战斗时随机点击或滑动]:默认为False \n防封优化,请注意这个与绿标功能冲突,可能会乱点绿标')
-
-

+ 0 - 237
tasks/GeneralBattle/general_battle.py

@@ -1,237 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-import time
-import random
-
-from tasks.base_task import BaseTask
-from tasks.GeneralBattle.config_general_battle import GreenMarkType, GeneralBattleConfig
-from tasks.GeneralBattle.assets import GeneralBattleAssets
-from module.logger import logger
-
-
-
-class GeneralBattle(BaseTask, GeneralBattleAssets):
-    """
-    使用这个通用的战斗必须要求这个任务的config有config_general_battle
-    """
-
-    def run_general_battle(self, config: dict=None) -> bool:
-        """
-        运行脚本
-        :return:
-        """
-        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:
-                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:
-                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
-
-
-            # 点击准备按钮
-            self.wait_until_appear(self.I_PREPARE_HIGHLIGHT)
-            while 1:
-                self.screenshot()
-                if self.appear_then_click(self.I_PREPARE_HIGHLIGHT, interval=1.5):
-                    continue
-                if not self.appear(self.I_BUFF):
-                    break
-            logger.info("Click prepare ensure button")
-
-            # 照顾一下某些模拟器慢的
-            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()
-                case GreenMarkType.GREEN_LEFT2: x, y = self.C_GREEN_LEFT_2.coord()
-                case GreenMarkType.GREEN_LEFT3: x, y = self.C_GREEN_LEFT_3.coord()
-                case GreenMarkType.GREEN_LEFT4: x, y = self.C_GREEN_LEFT_4.coord()
-                case GreenMarkType.GREEN_LEFT5: x, y = self.C_GREEN_LEFT_5.coord()
-                case GreenMarkType.GREEN_MAIN: x, y = self.C_GREEN_MAIN.coord()
-
-            # 判断有无坐标的偏移
-            self.appear_then_click(self.I_LOCAL)
-            time.sleep(0.3)
-            # 点击绿标
-            self.device.click(x, y)
-
-        # 战斗过程 随机点击和滑动 防封
-        logger.info("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)
-
-        # 再次确认战斗结果
-        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
-
-        if win:
-            return True
-        else:
-            return False
-
-
-    def run_general_battle_back(self, config: dict=None) -> bool:
-        """
-        进入挑战然后直接返回
-        :param config:
-        :return:
-        """
-        # 如果没有锁定队伍那么在点击准备后才退出的
-        if not config.lock_team_enable:
-            # 点击准备按钮
-            self.wait_until_appear(self.I_PREPARE_HIGHLIGHT)
-            while 1:
-                self.screenshot()
-                if self.appear_then_click(self.I_PREPARE_HIGHLIGHT, interval=1.5):
-                    continue
-                if not self.appear(self.I_PRESET):
-                    break
-            logger.info(f"Click {self.I_PREPARE_HIGHLIGHT.name}")
-
-        # 点击返回
-        while 1:
-            self.screenshot()
-            if self.appear_then_click(self.I_EXIT, interval=1.5):
-                continue
-            if self.appear(self.I_EXIT_ENSURE):
-                break
-        logger.info(f"Click {self.I_EXIT.name}")
-
-        # 点击返回确认
-        while 1:
-            self.screenshot()
-            if self.appear_then_click(self.I_EXIT_ENSURE, interval=1.5):
-                continue
-            if self.appear(self.I_FALSE):
-                break
-        logger.info(f"Click {self.I_EXIT_ENSURE.name}")
-
-        # 点击失败确认
-        self.wait_until_appear(self.I_FALSE)
-        while 1:
-            self.screenshot()
-            if self.appear_then_click(self.I_FALSE, interval=1.5):
-                continue
-            if not self.appear(self.I_FALSE):
-                break
-        logger.info(f"Click {self.I_FALSE.name}")
-
-        return True
-
-

+ 0 - 110
tasks/GeneralBattle/res/click.json

@@ -1,110 +0,0 @@
-[
-    {
-        "itemName": "preset_team_1",
-        "roiFront": "196,234,464,114",
-        "roiBack": "196,234,464,114",
-        "description": "预设队伍1"
-    },
-    {
-        "itemName": "preset_team_2",
-        "roiFront": "197,358,465,103",
-        "roiBack": "197,358,465,103",
-        "description": "预设队伍2"
-    },
-    {
-        "itemName": "preset_team_3",
-        "roiFront": "195,480,462,100",
-        "roiBack": "195,480,462,100",
-        "description": "预设队伍3"
-    },
-    {
-        "itemName": "preset_team_4",
-        "roiFront": "193,596,464,35",
-        "roiBack": "193,596,464,35",
-        "description": "预设队伍4"
-    },
-    {
-        "itemName": "preset_group_1",
-        "roiFront": "28,238,134,56",
-        "roiBack": "28,238,134,56",
-        "description": "预设组1"
-    },
-    {
-        "itemName": "preset_group_2",
-        "roiFront": "31,298,132,60",
-        "roiBack": "31,298,132,60",
-        "description": "预设组2"
-    },
-    {
-        "itemName": "preset_group_3",
-        "roiFront": "31,362,135,59",
-        "roiBack": "31,362,135,59",
-        "description": "预设组3"
-    },
-    {
-        "itemName": "preset_group_4",
-        "roiFront": "29,427,133,57",
-        "roiBack": "29,427,133,57",
-        "description": "预设组4"
-    },
-    {
-        "itemName": "preset_group_5",
-        "roiFront": "31,489,133,60",
-        "roiBack": "31,489,133,60",
-        "description": "预设组5"
-    },
-    {
-        "itemName": "preset_group_6",
-        "roiFront": "31,549,132,63",
-        "roiBack": "31,549,132,63",
-        "description": "预设组6"
-    },
-    {
-        "itemName": "preset_group_7",
-        "roiFront": "29,615,137,63",
-        "roiBack": "29,615,137,63",
-        "description": "预设组7"
-    },
-    {
-        "itemName": "green_left_1",
-        "roiFront": "128,433,90,150",
-        "roiBack": "128,433,90,150",
-        "description": "从左开始第一个绿标"
-    },
-    {
-        "itemName": "green_left_2",
-        "roiFront": "371,385,81,145",
-        "roiBack": "371,385,81,145",
-        "description": "从左开始第二个绿标"
-    },
-    {
-        "itemName": "green_left_3",
-        "roiFront": "586,328,100,76",
-        "roiBack": "586,328,100,76",
-        "description": "从左开始第三个绿标"
-    },
-    {
-        "itemName": "green_left_4",
-        "roiFront": "817,379,77,133",
-        "roiBack": "817,379,77,133",
-        "description": "从左开始第四个绿标"
-    },
-    {
-        "itemName": "green_left_5",
-        "roiFront": "1059,416,85,145",
-        "roiBack": "1059,416,85,145",
-        "description": "从左开始第五个绿标"
-    },
-    {
-        "itemName": "green_main",
-        "roiFront": "590,454,88,178",
-        "roiBack": "590,454,88,178",
-        "description": "绿标阴阳师"
-    },
-    {
-        "itemName": "random_click",
-        "roiFront": "104,79,1050,507",
-        "roiBack": "255,65,100,100",
-        "description": "战斗的时候有一定的概率随机点击"
-    }
-]

+ 0 - 164
tasks/GeneralBattle/res/image.json

@@ -1,164 +0,0 @@
-[
-  {
-    "itemName": "reward",
-    "imageName": "res_reward.png",
-    "roiFront": "547,518,172,96",
-    "roiBack": "547,518,172,96",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "奖励,就是那个魂"
-  },
-  {
-    "itemName": "preset",
-    "imageName": "res_preset.png",
-    "roiFront": "32,650,47,45",
-    "roiBack": "32,650,47,45",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "预设的小图标"
-  },
-  {
-    "itemName": "prepare_highlight",
-    "imageName": "res_prepare_highlight.png",
-    "roiFront": "1128,536,100,100",
-    "roiBack": "1128,536,100,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "准备"
-  },
-  {
-    "itemName": "win",
-    "imageName": "res_win.png",
-    "roiFront": "427,135,100,100",
-    "roiBack": "427,135,100,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "战斗胜利"
-  },
-  {
-    "itemName": "prepare_dark",
-    "imageName": "res_prepare_dark.png",
-    "roiFront": "1131,538,100,100",
-    "roiBack": "1131,538,100,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "准备但是界面还未加载这个时候是黑色的"
-  },
-  {
-    "itemName": "false",
-    "imageName": "res_false.png",
-    "roiFront": "413,124,100,100",
-    "roiBack": "413,124,100,100",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "失败"
-  },
-  {
-    "itemName": "preset_ensure",
-    "imageName": "res_preset_ensure.png",
-    "roiFront": "354,641,141,50",
-    "roiBack": "354,641,141,50",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "确认预设的队伍"
-  },
-  {
-    "itemName": "buff",
-    "imageName": "res_buff.png",
-    "roiFront": "113,653,44,62",
-    "roiBack": "113,653,44,62",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "选择buff"
-  },
-  {
-    "itemName": "buff_awaken",
-    "imageName": "res_buff_awaken.png",
-    "roiFront": "373,126,383,53",
-    "roiBack": "373,126,383,53",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "觉醒加成"
-  },
-  {
-    "itemName": "buff_soul",
-    "imageName": "res_buff_soul.png",
-    "roiFront": "377,192,371,56",
-    "roiBack": "377,192,371,56",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "御魂加成"
-  },
-  {
-    "itemName": "buff_gold_50",
-    "imageName": "res_buff_gold_50.png",
-    "roiFront": "375,259,373,56",
-    "roiBack": "375,259,373,56",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "金币加成50"
-  },
-  {
-    "itemName": "buff_gold_100",
-    "imageName": "res_buff_gold_100.png",
-    "roiFront": "371,329,389,54",
-    "roiBack": "371,329,389,54",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "金币加成100"
-  },
-  {
-    "itemName": "buff_exp_50",
-    "imageName": "res_buff_exp_50.png",
-    "roiFront": "378,400,370,50",
-    "roiBack": "378,400,370,50",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "经验加成50"
-  },
-  {
-    "itemName": "buff_exp_100",
-    "imageName": "res_buff_exp_100.png",
-    "roiFront": "372,463,386,50",
-    "roiBack": "372,463,386,50",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "经验加成100"
-  },
-  {
-    "itemName": "local",
-    "imageName": "res_local.png",
-    "roiFront": "25,563,30,34",
-    "roiBack": "25,563,30,34",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "左下角的位置指针"
-  },
-  {
-    "itemName": "statistics",
-    "imageName": "res_statistics.png",
-    "roiFront": "61,644,33,28",
-    "roiBack": "61,644,33,28",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "description"
-  },
-  {
-    "itemName": "exit",
-    "imageName": "res_exit.png",
-    "roiFront": "14,12,43,41",
-    "roiBack": "14,12,43,41",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "左上角的退出"
-  },
-  {
-    "itemName": "exit_ensure",
-    "imageName": "res_exit_ensure.png",
-    "roiFront": "674,388,135,63",
-    "roiBack": "674,388,135,63",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "退出确认"
-  }
-]

BIN=BIN
tasks/GeneralBattle/res/res_buff.png


BIN=BIN
tasks/GeneralBattle/res/res_buff_awaken.png


BIN=BIN
tasks/GeneralBattle/res/res_buff_exp_100.png


BIN=BIN
tasks/GeneralBattle/res/res_buff_exp_50.png


BIN=BIN
tasks/GeneralBattle/res/res_buff_gold_100.png


BIN=BIN
tasks/GeneralBattle/res/res_buff_gold_50.png


BIN=BIN
tasks/GeneralBattle/res/res_buff_soul.png


BIN=BIN
tasks/GeneralBattle/res/res_exit.png


BIN=BIN
tasks/GeneralBattle/res/res_exit_ensure.png


BIN=BIN
tasks/GeneralBattle/res/res_false.png


BIN=BIN
tasks/GeneralBattle/res/res_local.png


BIN=BIN
tasks/GeneralBattle/res/res_prepare_dark.png


BIN=BIN
tasks/GeneralBattle/res/res_prepare_highlight.png


BIN=BIN
tasks/GeneralBattle/res/res_preset.png


BIN=BIN
tasks/GeneralBattle/res/res_preset_ensure.png


BIN=BIN
tasks/GeneralBattle/res/res_reward.png


BIN=BIN
tasks/GeneralBattle/res/res_statistics.png


BIN=BIN
tasks/GeneralBattle/res/res_win.png


+ 0 - 16
tasks/GeneralBattle/res/swipe.json

@@ -1,16 +0,0 @@
-[
-    {
-        "itemName": "battle_random_left",
-        "roiFront": "122,155,480,426",
-        "roiBack": "667,147,461,427",
-        "mode": "default",
-        "description": "description"
-    },
-    {
-        "itemName": "battle_random_right",
-        "roiFront": "719,138,417,392",
-        "roiBack": "237,163,387,394",
-        "mode": "default",
-        "description": "description"
-    }
-]

+ 1 - 1
tasks/GoldYoukai/config.py

@@ -3,7 +3,7 @@
 # github https://github.com/runhey
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
 from pydantic import BaseModel, Field
 
 
-from tasks.GoldYoukai.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 
 
 
 class GoldYoukai(BaseModel):
 class GoldYoukai(BaseModel):

+ 0 - 15
tasks/GoldYoukai/config_scheduler.py

@@ -1,15 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from enum import Enum
-from datetime import datetime, time
-from pydantic import BaseModel, ValidationError, validator, Field
-
-class Scheduler(BaseModel):
-    enable: bool = Field(default=False, description='[是否启用]:默认为False')
-    next_run: datetime = Field(default="2023-01-01 00:00:00",
-                               description='[下次执行时间]:默认为2023-01-01 00:00:00\n 清空后回车设置当前的时间')
-    interval_days: int = Field(default=1, description='[间隔天数]:默认为1\n 可选0-7')
-    interval_hours: int = Field(default=0, description='[间隔小时]:默认为0\n 可选0-23')
-    interval_minutes: int = Field(default=0, description='[间隔分钟]:默认为0\n 可选0-59')
-

+ 1 - 1
tasks/Hunt/config.py

@@ -3,5 +3,5 @@
 # github https://github.com/runhey
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
 from pydantic import BaseModel, Field
 
 
-from tasks.Hunt.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 

+ 0 - 15
tasks/Hunt/config_scheduler.py

@@ -1,15 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from enum import Enum
-from datetime import datetime, time
-from pydantic import BaseModel, ValidationError, validator, Field
-
-class Scheduler(BaseModel):
-    enable: bool = Field(default=False, description='[是否启用]:默认为False')
-    next_run: datetime = Field(default="2023-01-01 00:00:00",
-                               description='[下次执行时间]:默认为2023-01-01 00:00:00\n 清空后回车设置当前的时间')
-    interval_days: int = Field(default=1, description='[间隔天数]:默认为1\n 可选0-7')
-    interval_hours: int = Field(default=0, description='[间隔小时]:默认为0\n 可选0-23')
-    interval_minutes: int = Field(default=0, description='[间隔分钟]:默认为0\n 可选0-59')
-

+ 1 - 1
tasks/Nian/config.py

@@ -3,7 +3,7 @@
 # github https://github.com/runhey
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
 from pydantic import BaseModel, Field
 
 
-from tasks.Nian.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 
 
 
 class Nian(BaseModel):
 class Nian(BaseModel):

+ 0 - 15
tasks/Nian/config_scheduler.py

@@ -1,15 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from enum import Enum
-from datetime import datetime, time
-from pydantic import BaseModel, ValidationError, validator, Field
-
-class Scheduler(BaseModel):
-    enable: bool = Field(default=False, description='[是否启用]:默认为False')
-    next_run: datetime = Field(default="2023-01-01 00:00:00",
-                               description='[下次执行时间]:默认为2023-01-01 00:00:00\n 清空后回车设置当前的时间')
-    interval_days: int = Field(default=1, description='[间隔天数]:默认为1\n 可选0-7')
-    interval_hours: int = Field(default=0, description='[间隔小时]:默认为0\n 可选0-23')
-    interval_minutes: int = Field(default=0, description='[间隔分钟]:默认为0\n 可选0-59')
-

+ 1 - 1
tasks/Orochi/config.py

@@ -3,7 +3,7 @@
 # github https://github.com/runhey
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
 from pydantic import BaseModel, Field
 
 
-from tasks.Orochi.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 
 class Orochi(BaseModel):
 class Orochi(BaseModel):
     scheduler: Scheduler = Field(default_factory=Scheduler)
     scheduler: Scheduler = Field(default_factory=Scheduler)

+ 0 - 15
tasks/Orochi/config_scheduler.py

@@ -1,15 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from enum import Enum
-from datetime import datetime, time
-from pydantic import BaseModel, ValidationError, validator, Field
-
-class Scheduler(BaseModel):
-    enable: bool = Field(default=False, description='[是否启用]:默认为False')
-    next_run: datetime = Field(default="2023-01-01 00:00:00",
-                               description='[下次执行时间]:默认为2023-01-01 00:00:00\n 清空后回车设置当前的时间')
-    interval_days: int = Field(default=1, description='[间隔天数]:默认为1\n 可选0-7')
-    interval_hours: int = Field(default=0, description='[间隔小时]:默认为0\n 可选0-23')
-    interval_minutes: int = Field(default=0, description='[间隔分钟]:默认为0\n 可选0-59')
-

+ 0 - 12
tasks/OrochiJudgement/assets.py

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

+ 0 - 11
tasks/OrochiJudgement/config.py

@@ -1,11 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from pydantic import BaseModel, Field
-
-from tasks.OrochiJudgement.config_scheduler import Scheduler
-
-
-class OrochiJudgement(BaseModel):
-    scheduler: Scheduler = Field(default_factory=Scheduler)
-

+ 0 - 15
tasks/OrochiJudgement/config_scheduler.py

@@ -1,15 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from enum import Enum
-from datetime import datetime, time
-from pydantic import BaseModel, ValidationError, validator, Field
-
-class Scheduler(BaseModel):
-    enable: bool = Field(default=False, description='[是否启用]:默认为False')
-    next_run: datetime = Field(default="2023-01-01 00:00:00",
-                               description='[下次执行时间]:默认为2023-01-01 00:00:00\n 清空后回车设置当前的时间')
-    interval_days: int = Field(default=1, description='[间隔天数]:默认为1\n 可选0-7')
-    interval_hours: int = Field(default=0, description='[间隔小时]:默认为0\n 可选0-23')
-    interval_minutes: int = Field(default=0, description='[间隔分钟]:默认为0\n 可选0-59')
-

+ 1 - 1
tasks/OrochiMoans/config.py

@@ -3,7 +3,7 @@
 # github https://github.com/runhey
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
 from pydantic import BaseModel, Field
 
 
-from tasks.OrochiMoans.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 
 
 
 class OrochiMoans(BaseModel):
 class OrochiMoans(BaseModel):

+ 0 - 15
tasks/OrochiMoans/config_scheduler.py

@@ -1,15 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from enum import Enum
-from datetime import datetime, time
-from pydantic import BaseModel, ValidationError, validator, Field
-
-class Scheduler(BaseModel):
-    enable: bool = Field(default=False, description='[是否启用]:默认为False')
-    next_run: datetime = Field(default="2023-01-01 00:00:00",
-                               description='[下次执行时间]:默认为2023-01-01 00:00:00\n 清空后回车设置当前的时间')
-    interval_days: int = Field(default=1, description='[间隔天数]:默认为1\n 可选0-7')
-    interval_hours: int = Field(default=0, description='[间隔小时]:默认为0\n 可选0-23')
-    interval_minutes: int = Field(default=0, description='[间隔分钟]:默认为0\n 可选0-59')
-

+ 2 - 2
tasks/RealmRaid/config.py

@@ -4,8 +4,8 @@
 from pydantic import BaseModel, Field
 from pydantic import BaseModel, Field
 from enum import Enum
 from enum import Enum
 
 
-from tasks.Utils.config_scheduler import Scheduler
-from tasks.GeneralBattle.config_general_battle import GeneralBattleConfig
+from tasks.Component.config_scheduler import Scheduler
+from tasks.Component.GeneralBattle.config_general_battle import GeneralBattleConfig
 
 
 
 
 class RaidMode(str, Enum):
 class RaidMode(str, Enum):

+ 1 - 1
tasks/RealmRaid/script_task.py

@@ -4,7 +4,7 @@
 import time
 import time
 
 
 from tasks.base_task import BaseTask
 from tasks.base_task import BaseTask
-from tasks.GeneralBattle.general_battle import GeneralBattle
+from tasks.Component.GeneralBattle.general_battle import GeneralBattle
 from tasks.GameUi.game_ui import GameUi
 from tasks.GameUi.game_ui import GameUi
 from tasks.RealmRaid.assets import RealmRaidAssets
 from tasks.RealmRaid.assets import RealmRaidAssets
 from tasks.RealmRaid.config import RealmRaid, RaidMode, AttackNumber
 from tasks.RealmRaid.config import RealmRaid, RaidMode, AttackNumber

+ 1 - 1
tasks/Sougenbi/config.py

@@ -3,7 +3,7 @@
 # github https://github.com/runhey
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
 from pydantic import BaseModel, Field
 
 
-from tasks.Sougenbi.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 
 
 
 class Sougenbi(BaseModel):
 class Sougenbi(BaseModel):

+ 0 - 15
tasks/Sougenbi/config_scheduler.py

@@ -1,15 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from enum import Enum
-from datetime import datetime, time
-from pydantic import BaseModel, ValidationError, validator, Field
-
-class Scheduler(BaseModel):
-    enable: bool = Field(default=False, description='[是否启用]:默认为False')
-    next_run: datetime = Field(default="2023-01-01 00:00:00",
-                               description='[下次执行时间]:默认为2023-01-01 00:00:00\n 清空后回车设置当前的时间')
-    interval_days: int = Field(default=1, description='[间隔天数]:默认为1\n 可选0-7')
-    interval_hours: int = Field(default=0, description='[间隔小时]:默认为0\n 可选0-23')
-    interval_minutes: int = Field(default=0, description='[间隔分钟]:默认为0\n 可选0-59')
-

+ 0 - 24
tasks/Utils/config_scheduler.py

@@ -1,24 +0,0 @@
-# This Python file uses the following encoding: utf-8
-# @author runhey
-# github https://github.com/runhey
-from enum import Enum
-from datetime import datetime, timedelta
-from pydantic import BaseModel, ValidationError, validator, Field
-
-class Scheduler(BaseModel):
-    enable: bool = Field(default=False, description='[是否启用]:默认为False')
-    next_run: datetime = Field(default="2023-01-01 00:00:00", description='[下次执行时间]:默认为2023-01-01 00:00:00\n 清空后回车设置当前的时间')
-    interval_days: int = Field(default=1, description='[间隔天数]:默认为1\n 可选0-7')
-    interval_hours: int = Field(default=0, description='[间隔小时]:默认为0\n 可选0-23')
-    interval_minutes: int = Field(default=0, description='[间隔分钟]:默认为0\n 可选0-59')
-
-    @validator('next_run', pre=True, always=True)
-    def parse_next_run(cls, value):
-        if isinstance(value, str):
-            print('parse_next_run')
-            try:
-                return datetime.fromisoformat(value)
-            except ValueError:
-                raise ValueError('Invalid next_run value. Expected format: YYYY-MM-DD HH:MM:SS')
-        return value
-