From 20de15e0115c594706a8f707fe0c5add28ca94c5 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Wed, 27 Dec 2023 00:56:15 +0800 Subject: [PATCH] Add: Dialogue clicker settings --- config/template.json | 5 +++++ module/config/argument/args.json | 14 ++++++++++++++ module/config/argument/argument.yaml | 10 ++++++++++ module/config/argument/menu.json | 7 +++++++ module/config/argument/task.yaml | 10 ++++++++++ module/config/config_generated.py | 3 +++ module/config/i18n/en-US.json | 19 +++++++++++++++++++ module/config/i18n/es-ES.json | 21 ++++++++++++++++++++- module/config/i18n/ja-JP.json | 19 +++++++++++++++++++ module/config/i18n/zh-CN.json | 19 +++++++++++++++++++ module/config/i18n/zh-TW.json | 21 ++++++++++++++++++++- module/webui/process_manager.py | 4 ++++ 12 files changed, 150 insertions(+), 2 deletions(-) diff --git a/config/template.json b/config/template.json index 953863a6d..88a76434d 100644 --- a/config/template.json +++ b/config/template.json @@ -194,5 +194,10 @@ "RogueDebug": { "DebugMode": false } + }, + "Daemon": { + "Daemon": { + "Enable": true + } } } \ No newline at end of file diff --git a/module/config/argument/args.json b/module/config/argument/args.json index bde713911..d382f09f1 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -1291,5 +1291,19 @@ "value": false } } + }, + "Daemon": { + "Daemon": { + "Enable": { + "type": "state", + "value": true, + "option": [ + true + ], + "option_bold": [ + true + ] + } + } } } \ No newline at end of file diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 2d2e0c2e0..7b029707a 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -252,3 +252,13 @@ RogueBlessing: RogueDebug: DebugMode: false + +# ==================== Tool ==================== + +Daemon: + Enable: + type: state + value: true + option: [ true ] + option_bold: [ true, ] + diff --git a/module/config/argument/menu.json b/module/config/argument/menu.json index 1d51b5eec..1d71e0235 100644 --- a/module/config/argument/menu.json +++ b/module/config/argument/menu.json @@ -26,5 +26,12 @@ "Weekly", "Rogue" ] + }, + "Tool": { + "menu": "list", + "page": "tool", + "tasks": [ + "Daemon" + ] } } \ No newline at end of file diff --git a/module/config/argument/task.yaml b/module/config/argument/task.yaml index a235be9a7..2067b574a 100644 --- a/module/config/argument/task.yaml +++ b/module/config/argument/task.yaml @@ -44,6 +44,7 @@ Daily: Freebies: - Scheduler - SupportReward + # ==================== Weekly ==================== Weekly: @@ -60,3 +61,12 @@ Weekly: - RogueCurio - RoguePath - RogueDebug + +# ==================== Tool ==================== + +Tool: + menu: 'list' + page: 'tool' + tasks: + Daemon: + - Daemon diff --git a/module/config/config_generated.py b/module/config/config_generated.py index 990e0d471..480990676 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -136,3 +136,6 @@ class GeneratedConfig: # Group `RogueDebug` RogueDebug_DebugMode = False + + # Group `Daemon` + Daemon_Enable = True # True diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index abfd647db..bb91a64dd 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -11,6 +11,10 @@ "Weekly": { "name": "Weekly", "help": "" + }, + "Tool": { + "name": "Tools", + "help": "" } }, "Task": { @@ -53,6 +57,10 @@ "Rogue": { "name": "Simulated Universe", "help": "" + }, + "Daemon": { + "name": "Dialogue Clicker", + "help": "" } }, "Scheduler": { @@ -884,6 +892,17 @@ "help": "No stop conditions, no error handling, stop when encountering an error. Please report errors according to the doc: https://github.com/LmeSzinc/StarRailCopilot/wiki/RogueMap_cn" } }, + "Daemon": { + "_info": { + "name": "Dialogue Clicker", + "help": "Tools need to stop the scheduler and then run independently" + }, + "Enable": { + "name": "Dialogue Clicker", + "help": "Monitor game, automatically click dialogue, phone chatting, and blessing in simulated universe (follow the simulated universe task settings)", + "True": "Enabled" + } + }, "Gui": { "Aside": { "Install": "Install", diff --git a/module/config/i18n/es-ES.json b/module/config/i18n/es-ES.json index 27e73a77b..8c8574ecc 100644 --- a/module/config/i18n/es-ES.json +++ b/module/config/i18n/es-ES.json @@ -11,6 +11,10 @@ "Weekly": { "name": "Semanario", "help": "" + }, + "Tool": { + "name": "útiles", + "help": "" } }, "Task": { @@ -53,6 +57,10 @@ "Rogue": { "name": "Universo Simulado", "help": "" + }, + "Daemon": { + "name": "Clic de diálogo", + "help": "" } }, "Scheduler": { @@ -63,7 +71,7 @@ "Enable": { "name": "Activar tarea", "help": "Añadir tarea al Planificador.", - "True": "Verdadero", + "True": "Activado", "False": "Falso" }, "NextRun": { @@ -884,6 +892,17 @@ "help": "Sin condiciones de parada, sin manejo de errores, deténgase cuando encuentre un error. Informe el error de acuerdo con el documento: https://github.com/LmeSzinc/StarRailCopilot/wiki/RogueMap_cn" } }, + "Daemon": { + "_info": { + "name": "Clic de diálogo", + "help": "Las herramientas necesitan detener el programador y luego ejecutarlo de forma independiente" + }, + "Enable": { + "name": "Clic de diálogo", + "help": "Monitorear el juego, hacer clic automáticamente en el diálogo, chatear por teléfono y bendecir en el universo simulado (sigue la configuración de tareas del universo simulado)", + "True": "Activado" + } + }, "Gui": { "Aside": { "Install": "Instalar", diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 572f9ae5f..fd1d223f9 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -11,6 +11,10 @@ "Weekly": { "name": "Menu.Weekly.name", "help": "Menu.Weekly.help" + }, + "Tool": { + "name": "Menu.Tool.name", + "help": "Menu.Tool.help" } }, "Task": { @@ -53,6 +57,10 @@ "Rogue": { "name": "Task.Rogue.name", "help": "Task.Rogue.help" + }, + "Daemon": { + "name": "Task.Daemon.name", + "help": "Task.Daemon.help" } }, "Scheduler": { @@ -884,6 +892,17 @@ "help": "RogueDebug.DebugMode.help" } }, + "Daemon": { + "_info": { + "name": "Daemon._info.name", + "help": "Daemon._info.help" + }, + "Enable": { + "name": "Daemon.Enable.name", + "help": "Daemon.Enable.help", + "True": "True" + } + }, "Gui": { "Aside": { "Install": "インストール", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 779e35086..7664e11c0 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -11,6 +11,10 @@ "Weekly": { "name": "每周", "help": "" + }, + "Tool": { + "name": "工具", + "help": "" } }, "Task": { @@ -53,6 +57,10 @@ "Rogue": { "name": "模拟宇宙", "help": "" + }, + "Daemon": { + "name": "剧情连点器", + "help": "" } }, "Scheduler": { @@ -884,6 +892,17 @@ "help": "无停止条件,无异常处理,遇错误即停止,请按文档上报异常:https://github.com/LmeSzinc/StarRailCopilot/wiki/RogueMap_cn" } }, + "Daemon": { + "_info": { + "name": "剧情连点器", + "help": "工具需要停止调度器再单独运行" + }, + "Enable": { + "name": "剧情连点器", + "help": "监听画面自动点击剧情、手机聊天、模拟宇宙祝福(遵循模拟宇宙任务设置)", + "True": "已启用" + } + }, "Gui": { "Aside": { "Install": "安装", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 94471e287..de1d41ff5 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -11,6 +11,10 @@ "Weekly": { "name": "每週", "help": "" + }, + "Tool": { + "name": "工具", + "help": "" } }, "Task": { @@ -53,6 +57,10 @@ "Rogue": { "name": "模擬宇宙", "help": "" + }, + "Daemon": { + "name": "劇情連點器", + "help": "" } }, "Scheduler": { @@ -881,7 +889,18 @@ }, "DebugMode": { "name": "開發模式", - "help": "無停止條件,無異常處理,遇錯誤即停止,請依文件回報異常:https://github.com/LmeSzinc/StarRailCopilot/wiki/RogueMap_cn" + "help": "無停止條件,無異常處理,遇錯誤即停止,請依檔案回報異常:https://github.com/LmeSzinc/StarRailCopilot/wiki/RogueMap_cn" + } + }, + "Daemon": { + "_info": { + "name": "劇情連點器", + "help": "工具需要停止調度器再單獨運作" + }, + "Enable": { + "name": "劇情連點器", + "help": "監聽畫面自動點擊劇情、手機聊天、模擬宇宙祝福(遵循模擬宇宙任務設定)", + "True": "已啟用" } }, "Gui": { diff --git a/module/webui/process_manager.py b/module/webui/process_manager.py index bad0db104..f414654f8 100644 --- a/module/webui/process_manager.py +++ b/module/webui/process_manager.py @@ -147,6 +147,10 @@ class ProcessManager: if e is not None: AzurLaneAutoScript.stop_event = e StarRailCopilot(config_name=config_name).loop() + elif func == "Daemon": + from tasks.base.daemon import Daemon + + Daemon(config=config_name, task="Daemon").run() else: logger.critical(f"No function matched: {func}") logger.info(f"[{config_name}] exited. Reason: Finish\n")