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

Merge pull request #17 from runhey/dev

Dev
huangrunheng 3 лет назад
Родитель
Сommit
c5f848126a
76 измененных файлов с 480 добавлено и 750 удалено
  1. 68 14
      config/template.json
  2. 2 2
      module/config/config_menu.py
  3. 0 2
      module/config/config_model.py
  4. BIN
      module/config/i18n/zh_CN.qm
  5. 184 28
      module/config/i18n/zh_CN.ts
  6. 21 17
      module/gui/qml/Component/Args.qml
  7. 13 10
      module/gui/qml/Component/RunStatusIcon.qml
  8. 2 1
      module/gui/utils.py
  9. 16 0
      module/ocr/models.py
  10. 1 1
      script.py
  11. 2 2
      tasks/AreaBoss/config.py
  12. 1 1
      tasks/AreaBoss/config_boss.py
  13. 0 24
      tasks/AreaBoss/config_scheduler.py
  14. 1 1
      tasks/AreaBoss/script_task.py
  15. 14 14
      tasks/Component/GeneralBattle/config_general_battle.py
  16. 3 3
      tasks/Component/GeneralBattle/general_battle.py
  17. 1 1
      tasks/Component/GeneralInvite/assets.py
  18. 10 0
      tasks/Component/README.md
  19. 6 6
      tasks/Component/config_scheduler.py
  20. 0 1
      tasks/DemonEncounter/config.py
  21. 0 15
      tasks/DemonEncounter/config_scheduler.py
  22. 1 1
      tasks/EternitySea/config.py
  23. 0 15
      tasks/EternitySea/config_scheduler.py
  24. 1 1
      tasks/ExperienceYoukai/config.py
  25. 0 15
      tasks/ExperienceYoukai/config_scheduler.py
  26. 1 1
      tasks/FallenSun/config.py
  27. 0 15
      tasks/FallenSun/config_scheduler.py
  28. 0 2
      tasks/GameUi/game_ui.py
  29. 0 97
      tasks/GeneralBattle/assets.py
  30. 0 110
      tasks/GeneralBattle/res/click.json
  31. 0 164
      tasks/GeneralBattle/res/image.json
  32. BIN
      tasks/GeneralBattle/res/res_buff.png
  33. BIN
      tasks/GeneralBattle/res/res_buff_awaken.png
  34. BIN
      tasks/GeneralBattle/res/res_buff_exp_100.png
  35. BIN
      tasks/GeneralBattle/res/res_buff_exp_50.png
  36. BIN
      tasks/GeneralBattle/res/res_buff_gold_100.png
  37. BIN
      tasks/GeneralBattle/res/res_buff_gold_50.png
  38. BIN
      tasks/GeneralBattle/res/res_buff_soul.png
  39. BIN
      tasks/GeneralBattle/res/res_exit.png
  40. BIN
      tasks/GeneralBattle/res/res_exit_ensure.png
  41. BIN
      tasks/GeneralBattle/res/res_false.png
  42. BIN
      tasks/GeneralBattle/res/res_local.png
  43. BIN
      tasks/GeneralBattle/res/res_prepare_dark.png
  44. BIN
      tasks/GeneralBattle/res/res_prepare_highlight.png
  45. BIN
      tasks/GeneralBattle/res/res_preset.png
  46. BIN
      tasks/GeneralBattle/res/res_preset_ensure.png
  47. BIN
      tasks/GeneralBattle/res/res_reward.png
  48. BIN
      tasks/GeneralBattle/res/res_statistics.png
  49. BIN
      tasks/GeneralBattle/res/res_win.png
  50. 0 16
      tasks/GeneralBattle/res/swipe.json
  51. 16 1
      tasks/GlobalGame/assets.py
  52. 23 2
      tasks/GlobalGame/config_emergency.py
  53. 1 1
      tasks/GoldYoukai/config.py
  54. 0 15
      tasks/GoldYoukai/config_scheduler.py
  55. 1 1
      tasks/Hunt/config.py
  56. 0 15
      tasks/Hunt/config_scheduler.py
  57. 1 1
      tasks/Nian/config.py
  58. 0 15
      tasks/Nian/config_scheduler.py
  59. 1 1
      tasks/Orochi/config.py
  60. 0 15
      tasks/Orochi/config_scheduler.py
  61. 0 11
      tasks/OrochiJudgement/config.py
  62. 0 15
      tasks/OrochiJudgement/config_scheduler.py
  63. 1 1
      tasks/OrochiMoans/config.py
  64. 0 15
      tasks/OrochiMoans/config_scheduler.py
  65. 2 0
      tasks/RealmRaid/assets.py
  66. 4 4
      tasks/RealmRaid/config.py
  67. 9 0
      tasks/RealmRaid/res/image.json
  68. BIN
      tasks/RealmRaid/res/res_medal_5_frog.png
  69. 5 1
      tasks/RealmRaid/script_task.py
  70. 8 7
      tasks/Script/config_device.py
  71. 5 3
      tasks/Script/config_error.py
  72. 5 4
      tasks/Script/config_optimization.py
  73. 1 1
      tasks/Sougenbi/config.py
  74. 0 15
      tasks/Sougenbi/config_scheduler.py
  75. 0 24
      tasks/Utils/config_scheduler.py
  76. 49 2
      tasks/base_task.py

+ 68 - 14
config/template.json

@@ -34,14 +34,21 @@
   },
   "global_game": {
     "emergency": {
-      "accept_friend_invitation": true
+      "friend_invitation": "accept",
+      "invitation_detect_interval": 10,
+      "when_network_abnormal": "wait_10s",
+      "when_network_error": "restart",
+      "home_client_clear": true
     }
   },
   "area_boss": {
     "scheduler": {
       "enable": false,
       "next_run": "2023-01-01 00:00:00",
-      "priority": 3
+      "priority": 5,
+      "interval_days": 1,
+      "interval_hours": 0,
+      "interval_minutes": 0
     },
     "general_battle": {
       "lock_team_enable": false,
@@ -67,63 +74,110 @@
     "scheduler": {
       "enable": false,
       "next_run": "2023-01-01 00:00:00",
-      "priority": 3
+      "priority": 5,
+      "interval_days": 1,
+      "interval_hours": 0,
+      "interval_minutes": 0
     }
   },
   "gold_youkai": {
     "scheduler": {
       "enable": false,
       "next_run": "2023-01-01 00:00:00",
-      "priority": 3
+      "priority": 5,
+      "interval_days": 1,
+      "interval_hours": 0,
+      "interval_minutes": 0
     }
   },
   "nian": {
     "scheduler": {
       "enable": false,
       "next_run": "2023-01-01 00:00:00",
-      "priority": 3
+      "priority": 5,
+      "interval_days": 1,
+      "interval_hours": 0,
+      "interval_minutes": 0
     }
   },
-  "orochi": {
+  "realm_raid": {
     "scheduler": {
       "enable": false,
       "next_run": "2023-01-01 00:00:00",
-      "priority": 3
+      "priority": 5,
+      "interval_days": 1,
+      "interval_hours": 0,
+      "interval_minutes": 0
+    },
+    "raid_config": {
+      "raid_mode": "retreat_four_attack_nine",
+      "attack_number": "all"
+    },
+    "general_battle_config": {
+      "lock_team_enable": false,
+      "preset_enable": false,
+      "preset_group": 1,
+      "preset_team": 1,
+      "buff_enable": false,
+      "buff_awake_click": false,
+      "buff_soul_click": false,
+      "buff_gold_50_click": false,
+      "buff_gold_100_click": false,
+      "buff_exp_50_click": false,
+      "buff_exp_100_click": false,
+      "green_enable": false,
+      "green_mark": "green_left1",
+      "random_click_swipt_enable": false
     }
   },
-  "orochi_moans": {
+  "orochi": {
     "scheduler": {
       "enable": false,
       "next_run": "2023-01-01 00:00:00",
-      "priority": 3
+      "priority": 5,
+      "interval_days": 1,
+      "interval_hours": 0,
+      "interval_minutes": 0
     }
   },
-  "orochi_judgement": {
+  "orochi_moans": {
     "scheduler": {
       "enable": false,
       "next_run": "2023-01-01 00:00:00",
-      "priority": 3
+      "priority": 5,
+      "interval_days": 1,
+      "interval_hours": 0,
+      "interval_minutes": 0
     }
   },
   "sougenbi": {
     "scheduler": {
       "enable": false,
       "next_run": "2023-01-01 00:00:00",
-      "priority": 3
+      "priority": 5,
+      "interval_days": 1,
+      "interval_hours": 0,
+      "interval_minutes": 0
     }
   },
   "fallen_sun": {
     "scheduler": {
       "enable": false,
       "next_run": "2023-01-01 00:00:00",
-      "priority": 3
+      "priority": 5,
+      "interval_days": 1,
+      "interval_hours": 0,
+      "interval_minutes": 0
     }
   },
   "eternity_sea": {
     "scheduler": {
       "enable": false,
       "next_run": "2023-01-01 00:00:00",
-      "priority": 3
+      "priority": 5,
+      "interval_days": 1,
+      "interval_hours": 0,
+      "interval_minutes": 0
     }
   }
 }

+ 2 - 2
module/config/config_menu.py

@@ -15,9 +15,9 @@ class ConfigMenu:
         # 总览
         self.menu["Overview"] = []
         # 脚本设置
-        self.menu['Script'] = ['Script', 'General', 'Restart', 'GlobalGame']
+        self.menu['Script'] = ['Script', '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']
 

+ 0 - 2
module/config/config_model.py

@@ -19,7 +19,6 @@ from tasks.GoldYoukai.config import GoldYoukai
 from tasks.Nian.config import Nian
 from tasks.Orochi.config import Orochi
 from tasks.OrochiMoans.config import OrochiMoans
-from tasks.OrochiJudgement.config import OrochiJudgement
 from tasks.Sougenbi.config import Sougenbi
 from tasks.FallenSun.config import FallenSun
 from tasks.EternitySea.config import EternitySea
@@ -45,7 +44,6 @@ class ConfigModel(BaseModel):
     # 这些是刷御魂的
     orochi: Orochi = Field(default_factory=Orochi)
     orochi_moans: OrochiMoans = Field(default_factory=OrochiMoans)
-    orochi_judgement: OrochiJudgement = Field(default_factory=OrochiJudgement)
     sougenbi: Sougenbi = Field(default_factory=Sougenbi)
     fallen_sun: FallenSun = Field(default_factory=FallenSun)
     eternity_sea: EternitySea = Field(default_factory=EternitySea)

BIN
module/config/i18n/zh_CN.qm


+ 184 - 28
module/config/i18n/zh_CN.ts

@@ -73,27 +73,27 @@
         <source>Locale</source>
         <translation>语言环境</translation>
     </message>
-	<message>
+    <message>
         <source>Dpi Strategy</source>
         <translation>分辨率DPI缩放策略</translation>
     </message>
-	<message>
+    <message>
         <source>default</source>
         <translation>默认不缩放</translation>
     </message>
-	<message>
+    <message>
         <source>floor</source>
         <translation>始终不缩放</translation>
     </message>
-	<message>
+    <message>
         <source>ceil</source>
         <translation>始终缩放</translation>
     </message>
-	<message>
+    <message>
         <source>round</source>
         <translation>设备像素比0.5及以上的,进行缩放</translation>
     </message>
-	<message>
+    <message>
         <source>round_prefer_floor</source>
         <translation>设备像素比0.75及以上的,进行缩放</translation>
     </message>
@@ -126,93 +126,249 @@
         <source>Update</source>
         <translation>更新</translation>
     </message>
-	<message>
+    <message>
         <source>Overview</source>
         <translation>总览</translation>
     </message>
-	<message>
+    <message>
         <source>Script</source>
         <translation>脚本</translation>
     </message>
-	<message>
+    <message>
         <source>General</source>
         <translation>通用</translation>
     </message>
-	<message>
+    <message>
         <source>Restart</source>
         <translation>重启</translation>
     </message>
-	<message>
+    <message>
         <source>Tools</source>
         <translation>工具</translation>
     </message>
-	<message>
+    <message>
         <source>Image Rule</source>
         <translation>截图规范</translation>
     </message>
-	<message>
+    <message>
         <source>Ocr Rule</source>
         <translation>OCR规范</translation>
     </message>
-	<message>
+    <message>
         <source>Click Rule</source>
         <translation>点击规范</translation>
     </message>
-	<message>
+    <message>
         <source>Long Click Rule</source>
         <translation>长按规范</translation>
     </message>
-	<message>
+    <message>
         <source>Swipe Rule</source>
         <translation>滑动规范</translation>
     </message>
-	<message>
+    <message>
         <source>Daily Task</source>
         <translation>日常任务</translation>
     </message>
-	<message>
+    <message>
         <source>AreaBoss</source>
         <translation>地狱鬼王</translation>
     </message>
-	<message>
+    <message>
         <source>GoldYoukai</source>
         <translation>金币妖怪</translation>
     </message>
-	<message>
+    <message>
         <source>ExperienceYoukai</source>
         <translation>经验妖怪</translation>
     </message>
-	<message>
+    <message>
         <source>Nian</source>
         <translation>年兽</translation>
     </message>
-	<message>
+    <message>
         <source>Soul Zones</source>
         <translation>御魂副本</translation>
     </message>
-	<message>
+    <message>
         <source>Orochi</source>
         <translation>八岐大蛇</translation>
     </message>
-	<message>
+    <message>
         <source>OrochiMoans</source>
         <translation>御魂悲鸣</translation>
     </message>
-	<message>
+    <message>
         <source>OrochiJudgement</source>
         <translation>御魂神罚</translation>
     </message>
-	<message>
+    <message>
         <source>Sougenbi</source>
         <translation>业原火</translation>
     </message>
-	<message>
+    <message>
         <source>FallenSun</source>
         <translation>日轮之城</translation>
     </message>
-	<message>
+    <message>
         <source>EternitySea</source>
         <translation>永生之海</translation>
     </message>
+	<message>
+        <source>GlobalGame</source>
+        <translation>全局游戏设置</translation>
+    </message>
+	<message>
+        <source>RealmRaid</source>
+        <translation>个人突破</translation>
+    </message>
+	<message>
+        <source>List Rule</source>
+        <translation>列表规则</translation>
+    </message>
+</context>
+<context>
+    <name>Args</name>
+	<message>
+        <source>Setting</source>
+        <translation>设置</translation>
+    </message>
+    <message>
+        <source>Device</source>
+        <translation>模拟器</translation>
+    </message>
+    <message>
+        <source>Serial</source>
+        <translation>模拟器 Serial</translation>
+    </message>
+    <message>
+        <source>Handle</source>
+        <translation>句柄 Handle</translation>
+    </message>
+    <message>
+        <source>package_name_help</source>
+        <translation>模拟器上装有多个游戏客户端时,需要手动选择服务器</translation>
+    </message>
+	<message><source>PackageName</source><translation>游戏客户端</translation></message>
+	<message><source>ScreenshotMethod</source><translation>模拟器截屏方案</translation></message>
+	<message><source>ControlMethod</source><translation>模拟器控制方案</translation></message>
+	<message>
+		<source>serial_help</source>
+		<translation>常见的模拟器 Serial 可以查询下方列表
+填 "auto" 自动检测模拟器,多个模拟器正在运行或使用不支持自动检测的模拟器时无法使用 "auto",必须手动填写
+
+模拟器默认 Serial:
+[MuMu模拟器12]: 127.0.0.1:16384 
+[MuMu模拟器]: 127.0.0.1:7555 
+[雷电模拟器](全系列通用): emulator-5554 或 127.0.0.1:5555
+
+如果没有提及的那可能是还没有测试或者不推荐使用,可以自行尝试
+如果你使用了模拟器的多开功能,它们的 Serial 将不是默认的,可以在 console.bat 中执行 `adb devices` 查询,或根据模拟器官方的教程填写'</translation>
+	</message>
+	<message>
+        <source>handle_help</source>
+        <translation>填 "auto" 自动检测模拟器,多个模拟器正在运行或使用不支持自动检测的模拟器时无法使用 "auto",必须手动填写
+输入为句柄标题或者是句柄号,每次启动模拟器时句柄号会变化
+
+句柄标题 Handle:
+[MuMu模拟器12]: "MuMu模拟器12"
+[MuMu模拟器]: "MuMu模拟器" "\n"
+[雷电模拟器](全系列通用): "雷电模拟器"
+
+句柄号 Handle:
+!!!占位符</translation>
+    </message>
+	<message>
+        <source>screenshot_method_help</source>
+        <translation>目前只支持window_background, 其他还未完整的测试</translation>
+    </message>
+	<message>
+        <source>control_method_help</source>
+        <translation>目前只支持window_message, 其他还未完整的测试</translation>
+    </message>
+	<message>
+        <source>Adb Restart</source>
+        <translation>在检测不到设备的时候尝试重启adb</translation>
+    </message>
+	<message><source>Error</source><translation>出错</translation></message>
+	<message><source>Handle Error</source><translation>启用异常处理</translation></message>
+	<message><source>handle_error_help</source><translation>处理部分异常,运行出错时撤退</translation></message>
+	<message><source>Save Error</source><translation>出错时,保存 Log 和截图</translation></message>
+	<message><source>Screenshot Length</source><translation>出错时,保留最后 X 张截图</translation></message>
+	<message><source>Optimization</source><translation>优化</translation></message>
+	<message><source>Screenshot Interval</source><translation>放慢截图速度至 X 秒一张</translation></message>
+	<message><source>Combat Screenshot Interval</source><translation>战斗中放慢截图速度至 X 秒一张</translation></message>
+	<message><source>Task Hoarding Duration</source><translation>囤积任务 X 分钟</translation></message>
+	<message><source>WhenTaskQueueEmpty</source><translation>当任务队列清空后</translation></message>
+	<message><source>screenshot_interval_help</source><translation>执行两次截图之间的最小间隔,限制在 0.1 ~ 0.3,对于高配置电脑能降低 CPU 占用</translation></message>
+	<message><source>combat_screenshot_interval_help</source><translation>执行两次截图之间的最小间隔,限制在 0.1 ~ 1.0,能降低战斗时的 CPU 占用</translation></message>
+	<message><source>task_hoarding_duration_help</source><translation>能在收菜期间降低操作游戏的频率,任务触发后,等待 X 分钟,再一次性执行囤积的任务</translation></message>
+	<message><source>when_task_queue_empty_help</source><translation>无任务时关闭游戏,能在收菜期间降低 CPU 占用</translation></message>
+</context>
+<context>
+    <name>Args</name>
+	<message><source>Scheduler</source><translation>任务调度</translation></message>
+	<message><source>Enable</source><translation>启用该功能</translation></message>
+	<message><source>Next Run</source><translation>下一次运行时间</translation></message>
+	<message><source>Priority</source><translation>任务优先级</translation></message>
+	<message><source>Interval Days</source><translation>下次执行的间隔天数</translation></message>
+	<message><source>Interval Hours</source><translation>下次执行的间隔小时</translation></message>
+	<message><source>Interval Minutes</source><translation>下次执行的间隔分钟</translation></message>
+	<message><source>enable_help</source><translation>将这个任务加入调度器</translation></message>
+	<message><source>next_run_help</source><translation>会根据下面的间隔时间自动计算时间,清空后回车即可设置为当前</translation></message>
+	<message><source>priority_help</source><translation>如果设置调度规则为基于优先级,则该选项有效
+默认为5,数字越低优先级越高,可取[1~15],如果同优先级,则按照先来后到规则进行调度</translation></message>
+	<message><source>interval_days_help</source><translation>可取[0~7]</translation></message>
+	<message><source>interval_hours_help</source><translation>可取[0~24]</translation></message>
+	<message><source>interval_minutes_help</source><translation>可取[0~60]</translation></message>
+</context>
+<context>
+    <name>Args</name>
+	<message><source>GeneralBattleConfig</source><translation>通用战斗</translation></message>
+	<message><source>Lock Team Enable</source><translation>锁定阵容</translation></message>
+	<message><source>Preset Enable</source><translation>启用切换预设队伍</translation></message>
+	<message><source>Preset Group</source><translation>第 X 个预设组</translation></message>
+	<message><source>Preset Team</source><translation>第 X 个预设队伍</translation></message>
+	<message><source>Buff Enable</source><translation>启用加成</translation></message>
+	<message><source>Buff Awake Click</source><translation>开启觉醒加成</translation></message>
+	<message><source>Buff Soul Click</source><translation>开启御魂加成</translation></message>
+	<message><source>Buff Gold 50 Click</source><translation>开启金币加成50%</translation></message>
+	<message><source>Buff Gold 100 Click</source><translation>开启金币加成100%</translation></message>
+	<message><source>Buff Exp 50 Click</source><translation>开启经验加成50%</translation></message>
+	<message><source>Buff Exp 100 Click</source><translation>开启金币加成100%</translation></message>
+	<message><source>Green Enable</source><translation>启用我方绿标</translation></message>
+	<message><source>GreenMarkType</source><translation>设置第 X 个式神为绿标</translation></message>
+	<message><source>Random Click Swipt Enable</source><translation>战斗时随机点击或者随机滑动</translation></message>
+	
+	<message><source>lock_team_enable_help</source><translation>如果锁定阵容将无法启用预设队伍、加成功能</translation></message>
+	<message><source>preset_enable_help</source><translation> </translation></message>
+	<message><source>preset_group_help</source><translation>可选[1~7]</translation></message>
+	<message><source>preset_team_help</source><translation>可选[1~5]</translation></message>
+	<message><source>buff_enable_help</source><translation>在准备阶段开启加成不太符合直觉,暂时还未实现,而且挺多的战斗是不允许准备阶段开启加成的</translation></message>
+	<message><source>green_enable_help</source><translation>在战斗开始的一瞬间点击绿标,无反馈点击</translation></message>
+	<message><source>green_mark_help</source><translation>可选[左一, 左二, 左三, 左四, 左五, 主阴阳师]</translation></message>
+	<message><source>random_click_swipt_enable_help</source><translation>防封优化,每三分钟的战斗可能触发2~5次,请注意这个与绿标功能冲突,可能会乱点绿标</translation></message>
+</context>
+<context>
+    <name>Args</name>
+	<message><source>Boss Number</source><translation>挑战鬼王数量</translation></message>
+	<message><source>RaidConfig</source><translation>个人突破</translation></message>
+	<message><source>RaidMode</source><translation>挑战模式</translation></message>
+	<message><source>AttackNumber</source><translation>挑战次数</translation></message>
+	<message><source>raid_mode_help</source><translation>默认为退四打九,退四打九指每次执行前都会退出四次,然后在进攻九次</translation></message>
+</context>
+<context>
+    <name>Args</name>
+	<message><source>Emergency</source><translation>突发检测</translation></message>
+	<message><source>FriendInvitation</source><translation>当出现协作邀请时</translation></message>
+	<message><source>Invitation Detect Interval</source><translation>检测间隔</translation></message>
+	<message><source>WhenNetworkAbnormal</source><translation>当网络异常时</translation></message>
+	<message><source>WhenNetworkError</source><translation>当网络出错需要重新连接服务器时</translation></message>
+	<message><source>Home Client Clear</source><translation>启用庭院客户端清空缓存</translation></message>
+	<message><source>friend_invitation_help</source><translation>默认全部接受</translation></message>
+	<message><source>invitation_detect_interval_help</source><translation>默认每隔10秒检测一次是否有协作</translation></message>
+	<message><source>when_network_abnormal_help</source><translation>默认会先等待10S</translation></message>
+	<message><source>when_network_error_help</source><translation>重启游戏</translation></message>
+	<message><source>home_client_clear_help</source><translation>有时会出现进入庭院要求清理缓存</translation></message>
 </context>
 </TS>

+ 21 - 17
module/gui/qml/Component/Args.qml

@@ -160,7 +160,7 @@ Item {
                 wrapMode: Text.WrapAnywhere
                 topPadding: 6
             }
-            FluCopyableText{
+            FluText{
                 id: string_description
                 anchors{
                     top: string_title.bottom
@@ -169,7 +169,8 @@ Item {
                 width: string_title.width
                 text: ""
                 font: FluTextStyle.Caption
-                wrapMode: Text.WrapAnywhere
+                wrapMode: Text.WordWrap
+//                textFormat: Text.PlainText
                 topPadding: 6
                 rightPadding: 6
             }
@@ -184,11 +185,11 @@ Item {
                     //判断是不是时间类型的变量2023-01-01
                     stringItem.isDateTime = true
                 }
-                string_title.text = modelData.title
+                string_title.text = qsTr(modelData.title)
                 if( typeof modelData.description === 'undefined'){
                     return
                 }
-                string_description.text = modelData.description
+                string_description.text = qsTr(modelData.description.replace("\\n","\n"))
             }
         }
     }
@@ -228,7 +229,7 @@ Item {
                 wrapMode: Text.WrapAnywhere
                 topPadding: 6
             }
-            FluCopyableText{
+            FluText{
                 id: itemArg_description
                 anchors{
                     top: itemArg_title.bottom
@@ -238,6 +239,7 @@ Item {
                 text: ""
                 font: FluTextStyle.Caption
                 wrapMode: Text.WrapAnywhere
+//                textFormat: Text.PlainText
                 topPadding: 6
                 rightPadding: 6
             }
@@ -248,11 +250,11 @@ Item {
                 }
                 itemArg_text.text = modelData.value
                 itemArg_text.placeholderText = modelData["default"]
-                itemArg_title.text = modelData.title
+                itemArg_title.text = qsTr(modelData.title)
                 if( typeof modelData.description === 'undefined'){
                     return
                 }
-                itemArg_description.text = modelData.description
+                itemArg_description.text = qsTr(modelData.description)
             }
         }
     }
@@ -292,7 +294,7 @@ Item {
                 wrapMode: Text.WrapAnywhere
                 topPadding: 6
             }
-            FluCopyableText{
+            FluText{
                 id: itemArg_description
                 anchors{
                     top: itemArg_title.bottom
@@ -302,6 +304,7 @@ Item {
                 text: ""
                 font: FluTextStyle.Caption
                 wrapMode: Text.WrapAnywhere
+//                textFormat: Text.PlainText
                 topPadding: 6
                 rightPadding: 6
             }
@@ -312,11 +315,11 @@ Item {
                 }
                 itemArg_text.text = modelData.value
                 itemArg_text.placeholderText = modelData["default"]
-                itemArg_title.text = modelData.title
+                itemArg_title.text = qsTr(modelData.title)
                 if( typeof modelData.description === 'undefined'){
                     return
                 }
-                itemArg_description.text = modelData.description
+                itemArg_description.text = qsTr(modelData.description)
             }
         }
     }
@@ -357,7 +360,7 @@ Item {
                 wrapMode: Text.WrapAnywhere
                 topPadding: 6
             }
-            FluCopyableText{
+            FluText{
                 id: itemArg_description
                 anchors{
                     top: itemArg_title.bottom
@@ -376,11 +379,11 @@ Item {
                     return
                 }
                 itemArg_text.selected = modelData.value
-                itemArg_title.text = modelData.title
+                itemArg_title.text = qsTr(modelData.title)
                 if( typeof modelData.description === 'undefined'){
                     return
                 }
-                itemArg_description.text = modelData.description
+                itemArg_description.text = qsTr(modelData.description)
             }
         }
     }
@@ -420,7 +423,7 @@ Item {
                 wrapMode: Text.WrapAnywhere
                 topPadding: 6
             }
-            FluCopyableText{
+            FluText{
                 id: itemArg_description
                 anchors{
                     top: itemArg_title.bottom
@@ -430,6 +433,7 @@ Item {
                 text: ""
                 font: FluTextStyle.Caption
                 wrapMode: Text.WrapAnywhere
+//                textFormat: Text.PlainText
                 topPadding: 6
                 rightPadding: 6
             }
@@ -440,11 +444,11 @@ Item {
                 }
                 itemArg_text.model = modelData.options
                 itemArg_text.show(modelData.value)
-                itemArg_title.text = modelData.title
+                itemArg_title.text = qsTr(modelData.title)
                 if( typeof modelData.description === 'undefined'){
                     return
                 }
-                itemArg_description.text = modelData.description
+                itemArg_description.text = qsTr(modelData.description)
             }
         }
     }
@@ -499,7 +503,7 @@ Item {
         const object = group_item.createObject(contentScrollable)
         if(object !== null){
             object.groupName = groupName
-            object.groupTitle = groupTitle
+            object.groupTitle = qsTr(groupTitle)
             object.argumentValue = argumentValue
 
             contentScrollable.content.push(object)

+ 13 - 10
module/gui/qml/Component/RunStatusIcon.qml

@@ -24,22 +24,25 @@ Item {
         color: root.color
         radius: radius
 
-        Behavior on radius {
-            NumberAnimation {
-                duration: root.animationDuration
-                easing.type: Easing.OutQuad
-            }
-        }
+//        Behavior on radius {
+//            enabled: false
+//            NumberAnimation {
+//                duration: root.animationDuration
+//                easing.type: Easing.OutQuad
+//            }
+//        }
 
-        SequentialAnimation on radius {
-            loops: Animation.Infinite
-            PropertyAnimation { to: root.maxRadius; duration: root.animationDuration }
-        }
+//        SequentialAnimation on radius {
+//            enabled: false
+//            loops: Animation.Infinite
+//            PropertyAnimation { to: root.maxRadius; duration: root.animationDuration }
+//        }
     }
 
     FluProgressRing{
         id: runProgress
         anchors.centerIn: parent
+        indeterminate: false
         width: parent.width/2
         height: parent.height/2
     }

+ 2 - 1
module/gui/utils.py

@@ -41,4 +41,5 @@ def check_admin():
         args = ' '.join(sys.argv)
         ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)
         sys.exit(0)
-    logger.log('管理员身份运行')
+    logger.log('管理员身份运行')
+

+ 16 - 0
module/ocr/models.py

@@ -9,3 +9,19 @@ class OcrModel:
 
 
 OCR_MODEL = OcrModel()
+
+
+
+if __name__ == "__main__":
+    model = OCR_MODEL.ch
+    import cv2
+    import time
+    image = cv2.imread(r"D:\ocr_test_5.png")
+
+    for i in range(10):
+        start_time = time.time()
+        result = model.detect_and_ocr(image)
+        print(result)
+        end_time = time.time()
+        print(f'耗时:{end_time-start_time}')
+

+ 1 - 1
script.py

@@ -87,7 +87,7 @@ class Script:
         from module.base.utils import save_image
         from module.handler.sensitive_info import (handle_sensitive_image,
                                                    handle_sensitive_logs)
-        if self.config.Error_SaveError:
+        if self.config.script.error.save_error:
             if not os.path.exists('./log/error'):
                 os.mkdir('./log/error')
             folder = f'./log/error/{int(time.time() * 1000)}'

+ 2 - 2
tasks/AreaBoss/config.py

@@ -3,8 +3,8 @@
 # github https://github.com/runhey
 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
 
 

+ 1 - 1
tasks/AreaBoss/config_boss.py

@@ -8,5 +8,5 @@ from pydantic import BaseModel, ValidationError, validator, Field
 class Boss(BaseModel):
     boss_number: int = Field(title='Boss Number',
                              default=3,
-                             description='[Boss数量]:默认为3\n 可选[1-3]',
+                             description='默认为3 可选[1-3]',
                              ge=1, le=3)

+ 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
 
 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 module.logger import logger
 from module.exception import TaskEnd

+ 14 - 14
tasks/GeneralBattle/config_general_battle.py → tasks/Component/GeneralBattle/config_general_battle.py

@@ -16,35 +16,35 @@ class GreenMarkType(str, Enum):
 class GeneralBattleConfig(BaseModel):
 
     # 是否锁定阵容, 有些的战斗是外边的锁定阵容甚至有些的战斗没有锁定阵容的
-    lock_team_enable: bool = Field(default=False, description='[锁定阵容]:默认为False \n如果锁定阵容将无法启用预设队伍、加成功能')
+    lock_team_enable: bool = Field(default=False, description='lock_team_enable_help')
 
     # 是否启动 预设队伍
-    preset_enable: bool = Field(default=False, description='[启用预设]:默认为False')
+    preset_enable: bool = Field(default=False, description='preset_enable_help')
     # 选哪一个预设组
-    preset_group: int = Field(default=1, description='[设置预设组]:默认为1, 可选[1-7]', ge=1, le=7)
+    preset_group: int = Field(default=1, description='preset_group_help', ge=1, le=7)
     # 选哪一个队伍
-    preset_team: int = Field(default=1, description='[设置预设队伍]:默认为1, 可选[1-5]', ge=1, le=5)
+    preset_team: int = Field(default=1, description='preset_team_help', ge=1, le=5)
     # 是否启动开启buff
-    buff_enable: bool = Field(default=False, description='[启用加成]:默认为False')
+    buff_enable: bool = Field(default=False, description='buff_enable_help')
     # 是否点击觉醒Buff
-    buff_awake_click: bool = Field(default=False, description='[觉醒加成]:默认为False')
+    buff_awake_click: bool = Field(default=False, description='')
     # 是否点击御魂buff
-    buff_soul_click: bool = Field(default=False, description='[御魂加成]:默认为False')
+    buff_soul_click: bool = Field(default=False, description='')
     # 是否点击金币50buff
-    buff_gold_50_click: bool = Field(default=False, description='[金币50加成]:默认为False')
+    buff_gold_50_click: bool = Field(default=False, description='')
     # 是否点击金币100buff
-    buff_gold_100_click: bool = Field(default=False, description='[金币100加成]:默认为False')
+    buff_gold_100_click: bool = Field(default=False, description='')
     # 是否点击经验50buff
-    buff_exp_50_click: bool = Field(default=False, description='[经验50加成]:默认为False')
+    buff_exp_50_click: bool = Field(default=False, description='')
     # 是否点击经验100buff
-    buff_exp_100_click: bool = Field(default=False, description='[经验100加成]:默认为False')
+    buff_exp_100_click: bool = Field(default=False, description='')
 
     # 是否开启绿标
-    green_enable: bool = Field(default=False, description='[启用绿标]:默认为False')
+    green_enable: bool = Field(default=False, description='green_enable_help')
     # 选哪一个绿标
-    green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='[设置绿标]:默认为左一 \n可选[左一, 左二, 左三, 左四, 左五, 主阴阳师]')
+    green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='green_mark_help')
 
     # 是否启动战斗时随机点击或者随机滑动
-    random_click_swipt_enable: bool = Field(default=False, description='[战斗时随机点击或滑动]:默认为False \n防封优化,请注意这个与绿标功能冲突,可能会乱点绿标')
+    random_click_swipt_enable: bool = Field(default=False, description='random_click_swipt_enable_help')
 
 

+ 3 - 3
tasks/GeneralBattle/general_battle.py → tasks/Component/GeneralBattle/general_battle.py

@@ -5,8 +5,8 @@ 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 tasks.Component.GeneralBattle.config_general_battle import GreenMarkType, GeneralBattleConfig
+from tasks.Component.GeneralBattle.assets import GeneralBattleAssets
 from module.logger import logger
 
 
@@ -43,7 +43,7 @@ class GeneralBattle(BaseTask, GeneralBattleAssets):
                     if self.appear(self.I_PRESET_ENSURE):
                         break
                 # 选择预设组
-                logger.info("select preset group")
+                logger.info("Select preset group")
                 x, y = None, None
                 match config.preset_group:
                     case 1: x, y = self.C_PRESET_GROUP_1.coord()

+ 1 - 1
tasks/OrochiJudgement/assets.py → tasks/Component/GeneralInvite/assets.py

@@ -7,6 +7,6 @@ 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: 
+class GeneralInviteAssets: 
 	pass
 

+ 10 - 0
tasks/Component/README.md

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

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

@@ -6,16 +6,16 @@ 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')
+    enable: bool = Field(default=False, description='enable_help')
+    next_run: datetime = Field(default="2023-01-01 00:00:00", description='next_run_help')
+    priority: int = Field(default=5, description='priority_help')
+    interval_days: int = Field(default=1, description='interval_days_help')
+    interval_hours: int = Field(default=0, description='interval_hours_help')
+    interval_minutes: int = Field(default=0, description='interval_minutes_help')
 
     @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:

+ 0 - 1
tasks/DemonEncounter/config.py

@@ -3,4 +3,3 @@
 # github https://github.com/runhey
 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
 from pydantic import BaseModel, Field
 
-from tasks.EternitySea.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 
 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
 from pydantic import BaseModel, Field
 
-from tasks.ExperienceYoukai.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 class ExperienceYoukai(BaseModel):
     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
 from pydantic import BaseModel, Field
 
-from tasks.FallenSun.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 
 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 - 2
tasks/GameUi/game_ui.py

@@ -5,8 +5,6 @@ import time
 
 from tasks.GameUi.assets import GameUiAssets
 from tasks.base_task import BaseTask
-from tasks.GeneralBattle.general_battle import GeneralBattle
-from tasks.AreaBoss.assets import AreaBossAssets
 from module.logger import logger
 
 

+ 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 - 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
tasks/GeneralBattle/res/res_buff.png


BIN
tasks/GeneralBattle/res/res_buff_awaken.png


BIN
tasks/GeneralBattle/res/res_buff_exp_100.png


BIN
tasks/GeneralBattle/res/res_buff_exp_50.png


BIN
tasks/GeneralBattle/res/res_buff_gold_100.png


BIN
tasks/GeneralBattle/res/res_buff_gold_50.png


BIN
tasks/GeneralBattle/res/res_buff_soul.png


BIN
tasks/GeneralBattle/res/res_exit.png


BIN
tasks/GeneralBattle/res/res_exit_ensure.png


BIN
tasks/GeneralBattle/res/res_false.png


BIN
tasks/GeneralBattle/res/res_local.png


BIN
tasks/GeneralBattle/res/res_prepare_dark.png


BIN
tasks/GeneralBattle/res/res_prepare_highlight.png


BIN
tasks/GeneralBattle/res/res_preset.png


BIN
tasks/GeneralBattle/res/res_preset_ensure.png


BIN
tasks/GeneralBattle/res/res_reward.png


BIN
tasks/GeneralBattle/res/res_statistics.png


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"
-    }
-]

+ 16 - 1
tasks/GlobalGame/assets.py

@@ -8,5 +8,20 @@ from module.atom.list import RuleList
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.
 class GlobalGameAssets: 
-	pass
+
+
+	# Image Rule Assets
+	# description 
+	I_ACCEPT = RuleImage(roi_front=(825,395,56,46), roi_back=(825,395,56,46), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_accept.png")
+	# description 
+	I_REJECT = RuleImage(roi_front=(825,493,53,51), roi_back=(825,493,53,51), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_reject.png")
+	# 勾玉 
+	I_JADE = RuleImage(roi_front=(661,466,43,46), roi_back=(661,466,43,46), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_jade.png")
+	# 网络异常 
+	I_NETWORK_ABNORMAL = RuleImage(roi_front=(583,330,221,67), roi_back=(583,330,221,67), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_network_abnormal.png")
+	# 已端口游戏服务器,需要重新连接,这种情况一般是断开很久了 
+	I_NETWORK_ERROR = RuleImage(roi_front=(431,253,416,208), roi_back=(431,253,416,208), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_network_error.png")
+	# 我还没有碰到这个情况没能截图 
+	I_CLIENT_CLEAR = RuleImage(roi_front=(578,369,151,72), roi_back=(578,369,151,72), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_client_clear.png")
+
 

+ 23 - 2
tasks/GlobalGame/config_emergency.py

@@ -2,9 +2,30 @@
 # @author runhey
 # github https://github.com/runhey
 from datetime import datetime, time
+from enum import Enum
 from pydantic import BaseModel, ValidationError, validator, Field
 
 
+class FriendInvitation(str, Enum):
+    ACCEPT = 'accept'
+    REJECT = 'reject'
+    ONLY_JADE = 'only_jade'  # 仅接受勾玉邀请
+
+class WhenNetworkAbnormal(str, Enum):
+    RESTART = 'restart'
+    WAIT_10S = 'wait_10s'
+
+class WhenNetworkError(str, Enum):
+    RESTART = 'restart'
+
+
+
+# 也可以是左边的邀请什么的
 class Emergency(BaseModel):
-    accept_friend_invitation: bool = Field(default=True,
-                                           description="default is true")
+    friend_invitation: FriendInvitation = Field(default=FriendInvitation.ACCEPT,description='friend_invitation_help')
+    invitation_detect_interval: int = Field(default=10, description='invitation_detect_interval_help')
+    when_network_abnormal: WhenNetworkAbnormal = Field(default=WhenNetworkAbnormal.WAIT_10S, description='when_network_abnormal_help')
+    when_network_error: WhenNetworkError = Field(default=WhenNetworkError.RESTART, description='when_network_error_help')
+    home_client_clear: bool = Field(default=True, description='home_client_clear_help')
+
+

+ 1 - 1
tasks/GoldYoukai/config.py

@@ -3,7 +3,7 @@
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
 
-from tasks.GoldYoukai.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 
 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
 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
 from pydantic import BaseModel, Field
 
-from tasks.Nian.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 
 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
 from pydantic import BaseModel, Field
 
-from tasks.Orochi.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 class Orochi(BaseModel):
     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 - 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
 from pydantic import BaseModel, Field
 
-from tasks.OrochiMoans.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 
 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 - 0
tasks/RealmRaid/assets.py

@@ -45,6 +45,8 @@ class RealmRaidAssets:
 	I_UNLOCK_2 = RuleImage(roi_front=(1002,643,30,41), roi_back=(1002,643,30,41), threshold=0.9, method="Template matching", file="./tasks/RealmRaid/res/res_unlock_2.png")
 	# 以锁图片,适配呱太 
 	I_LOCK_2 = RuleImage(roi_front=(1002,645,34,38), roi_back=(1002,645,34,38), threshold=0.9, method="Template matching", file="./tasks/RealmRaid/res/res_lock_2.png")
+	# description 
+	I_MEDAL_5_FROG = RuleImage(roi_front=(903,479,201,49), roi_back=(189,182,967,376), threshold=0.8, method="Template matching", file="./tasks/RealmRaid/res/res_medal_5_frog.png")
 
 
 	# Ocr Rule Assets

+ 4 - 4
tasks/RealmRaid/config.py

@@ -4,8 +4,8 @@
 from pydantic import BaseModel, Field
 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):
@@ -18,9 +18,9 @@ class AttackNumber(str, Enum):
 
 class RaidConfig(BaseModel):
     raid_mode: RaidMode = Field(title='Raid Mode', default=RaidMode.NORMAL,
-                                description='[挑战模式]:默认为退四打九\n 退四打九指每次执行前都会退出四次,然后在进攻九次')
+                                description='raid_mode_help')
     attack_number: AttackNumber = Field(title='Attack Number', default=AttackNumber.ALL,
-                                        description='[挑战次数]:默认为all,一直打到没有\n nine为打九次')
+                                        description='')
 
 class RealmRaid(BaseModel):
     scheduler: Scheduler = Field(default_factory=Scheduler)

+ 9 - 0
tasks/RealmRaid/res/image.json

@@ -151,5 +151,14 @@
     "method": "Template matching",
     "threshold": 0.9,
     "description": "以锁图片,适配呱太"
+  },
+  {
+    "itemName": "medal_5_frog",
+    "imageName": "res_medal_5_frog.png",
+    "roiFront": "903,479,201,49",
+    "roiBack": "189,182,967,376",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
   }
 ]

BIN
tasks/RealmRaid/res/res_medal_5_frog.png


+ 5 - 1
tasks/RealmRaid/script_task.py

@@ -4,7 +4,7 @@
 import time
 
 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.RealmRaid.assets import RealmRaidAssets
 from tasks.RealmRaid.config import RealmRaid, RaidMode, AttackNumber
@@ -100,6 +100,7 @@ class ScriptTask(GeneralBattle, GameUi, RealmRaidAssets):
         :return:
         """
         # 点击勋章的挑战 和挑战
+        time.sleep(0.2)
         is_click = False
         while 1:
             self.screenshot()
@@ -118,6 +119,9 @@ class ScriptTask(GeneralBattle, GameUi, RealmRaidAssets):
 
             if is_click:
                 continue
+            if self.appear_then_click(self.I_MEDAL_5_FROG, interval=1.5):
+                is_click = True
+                continue
             if self.appear_then_click(self.I_MEDAL_5, interval=1.5):
                 is_click = True
                 continue

+ 8 - 7
tasks/Script/config_device.py

@@ -28,17 +28,18 @@ class ControlMethod(str, Enum):
 
 class Device(BaseModel):
     serial: str = Field(default="auto",
-                        description='Common emulator Serial can be queried in the list belowUse "auto" to auto-detect emulators, but if multiple emulators are running or use emulators that do not support auto-detect, "auto" cannot be used and serial must be filled in manually')
+                        description='serial_help')
     handle: str = Field(default='auto',
-                        description='you can use auto or your emulator title')
-    package_name: PackageName = Field(default=PackageName.AUTO,
-                                      description='package name')
+                        description='handle_help')
+    package_name: PackageName = Field(title='Package Name',
+                                      default=PackageName.AUTO,
+                                      description='package_name_help')
     screenshot_method: ScreenshotMethod = Field(default=ScreenshotMethod.WINDOW_BACKGROUND,
-                                                description='only support window')
+                                                description='screenshot_method_help')
     control_method: ControlMethod = Field(default=ControlMethod.WINDOW_MESSAGE,
-                                          description='only support window')
+                                          description='control_method_help')
     adb_restart: bool = Field(default=False,
-                              description='')
+                              description='adb_restart_help')
 
 
 

+ 5 - 3
tasks/Script/config_error.py

@@ -8,8 +8,10 @@ from module.logger import logger
 
 class Error(BaseModel):
     handle_error: bool = Field(default=False,
-                               description='none')
+                               description='handle_error_help')
     save_error: bool = Field(default=False,
-                             description='none')
+                             description='')
     screenshot_length: int = Field(default=1,
-                                   description='The number of recent screenshots to save when something goes wrong')
+                                   description='')
+
+

+ 5 - 4
tasks/Script/config_optimization.py

@@ -12,10 +12,11 @@ class WhenTaskQueueEmpty(str, Enum):
 
 class Optimization(BaseModel):
     screenshot_interval: float = Field(default=0.3,
-                                       description='none')
+                                       description='screenshot_interval_help')
     combat_screenshot_interval: float = Field(default=1.0,
-                                              description='none')
+                                              description='combat_screenshot_interval_help')
     task_hoarding_duration: float = Field(default=0,
-                                          description='none')
+                                          description='task_hoarding_duration_help')
     when_task_queue_empty: WhenTaskQueueEmpty = Field(default=WhenTaskQueueEmpty.GOTO_HOME,
-                                                      description='you can select goto home where nothing to do')
+                                                      description='when_task_queue_empty_help')
+

+ 1 - 1
tasks/Sougenbi/config.py

@@ -3,7 +3,7 @@
 # github https://github.com/runhey
 from pydantic import BaseModel, Field
 
-from tasks.Sougenbi.config_scheduler import Scheduler
+from tasks.Component.config_scheduler import Scheduler
 
 
 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
-

+ 49 - 2
tasks/base_task.py

@@ -18,9 +18,14 @@ from module.logger import logger
 from module.base.timer import Timer
 from module.config.config import Config
 from module.device.device import Device
+from tasks.GlobalGame.assets import GlobalGameAssets
+from tasks.GlobalGame.config_emergency import FriendInvitation, WhenNetworkAbnormal, WhenNetworkError
 
+from module.exception import GameStuckError
 
-class BaseTask:
+
+
+class BaseTask(GlobalGameAssets):
     config: Config = None
     device: Device = None
 
@@ -38,12 +43,53 @@ class BaseTask:
 
         self.start_time = datetime.now()  # 启动的时间
 
+        self.friend_timer = None
+        if self.config.global_game.emergency.invitation_detect_interval:
+            self.interval_time = self.config.global_game.emergency.invitation_detect_interval
+            self.friend_timer = Timer(self.interval_time)
+
     def screenshot(self):
         """
         截图 引入中间函数的目的是 为了解决如协作的这类突发的事件
         :return:
         """
-        return self.device.screenshot()
+        self.device.screenshot()
+        # 判断勾协
+        if self.friend_timer and self.friend_timer.reached():
+            self.friend_timer.reset()
+            invite = self.appear(self.I_ACCEPT)
+            # 如果是全部接受
+            if invite and self.config.global_game.emergency.friend_invitation == FriendInvitation.ACCEPT:
+                # 如果是接受邀请
+                while 1:
+                    if self.appear_then_click(self.I_ACCEPT):
+                        continue
+                    if not self.appear(self.I_ACCEPT):
+                        break
+            # 如果是全部拒绝
+            elif invite and self.config.global_game.emergency.friend_invitation == FriendInvitation.REJECT:
+                while 1:
+                    if self.appear_then_click(self.I_REJECT):
+                        continue
+                    if not self.appear(self.I_REJECT):
+                        break
+            # 最后一个是仅仅接受勾协
+            elif invite and self.config.global_game.emergency.friend_invitation == FriendInvitation.ONLY_JADE:
+                while 1:
+                    if self.appear_then_click(self.I_ACCEPT):
+                        continue
+                    if not self.appear(self.I_ACCEPT):
+                        break
+            # 判断网络异常
+            if self.appear(self.I_NETWORK_ABNORMAL):
+                raise GameStuckError
+
+            # 判断网络错误
+            if self.appear(self.I_NETWORK_ERROR):
+                raise GameStuckError
+
+        return self.device.image
+        # 返回截图
 
     def appear(self, target: RuleImage, interval: float = None, threshold: float = None):
         """
@@ -370,6 +416,7 @@ class BaseTask:
                           hours=task_object.scheduler.interval_hours,
                           minutes=task_object.scheduler.interval_minutes, )
         next_run = start_time + delta
+        next_run.replace(microsecond=0)
 
         task_object.scheduler.next_run = next_run
         self.config.save()