From c77f1a30b3f64779c4aae414f2f874e47e332aad Mon Sep 17 00:00:00 2001 From: Zebartin <1500012724@pku.edu.cn> Date: Tue, 20 Jun 2023 01:28:41 +0800 Subject: [PATCH] Add: Config of Assignment --- config/template.json | 12 +++++++++ module/config/argument/args.json | 39 ++++++++++++++++++++++++++++ module/config/argument/argument.yaml | 7 +++++ module/config/argument/menu.json | 3 ++- module/config/argument/task.yaml | 3 +++ module/config/config_generated.py | 4 +++ module/config/config_manual.py | 1 + module/config/i18n/en-US.json | 22 ++++++++++++++++ module/config/i18n/ja-JP.json | 22 ++++++++++++++++ module/config/i18n/zh-CN.json | 22 ++++++++++++++++ module/config/i18n/zh-TW.json | 22 ++++++++++++++++ src.py | 4 +++ 12 files changed, 160 insertions(+), 1 deletion(-) diff --git a/config/template.json b/config/template.json index 7811b8717..6d9cc227e 100644 --- a/config/template.json +++ b/config/template.json @@ -59,5 +59,17 @@ "Command": "BattlePass", "ServerUpdate": "04:00" } + }, + "Assignment": { + "Scheduler": { + "Enable": false, + "NextRun": "2020-01-01 00:00:00", + "Command": "Assignment", + "ServerUpdate": "04:00" + }, + "Assignment": { + "Filter": "Nameless Land Nameless People > Akashic Records > The Invisible Hand > Root Out the Turpitude", + "Duration": 20 + } } } \ No newline at end of file diff --git a/module/config/argument/args.json b/module/config/argument/args.json index b4b93b751..59513ff00 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -258,5 +258,44 @@ "display": "hide" } } + }, + "Assignment": { + "Scheduler": { + "Enable": { + "type": "checkbox", + "value": false + }, + "NextRun": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + }, + "Command": { + "type": "input", + "value": "Assignment", + "display": "hide" + }, + "ServerUpdate": { + "type": "input", + "value": "04:00", + "display": "hide" + } + }, + "Assignment": { + "Filter": { + "type": "textarea", + "value": "Nameless Land Nameless People > Akashic Records > The Invisible Hand > Root Out the Turpitude" + }, + "Duration": { + "type": "select", + "value": 20, + "option": [ + 4, + 8, + 12, + 20 + ] + } + } } } \ No newline at end of file diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index e1a940f3b..df4c8c937 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -77,3 +77,10 @@ Dungeon: Team: value: 1 option: [ 1, 2, 3, 4, 5, 6 ] + +Assignment: + Filter: |- + Nameless Land Nameless People > Akashic Records > The Invisible Hand > Root Out the Turpitude + Duration: + value: 20 + option: [4, 8, 12, 20] \ No newline at end of file diff --git a/module/config/argument/menu.json b/module/config/argument/menu.json index 4be8fdcd5..e164e6947 100644 --- a/module/config/argument/menu.json +++ b/module/config/argument/menu.json @@ -13,7 +13,8 @@ "tasks": [ "Dungeon", "DailyQuest", - "BattlePass" + "BattlePass", + "Assignment" ] } } \ No newline at end of file diff --git a/module/config/argument/task.yaml b/module/config/argument/task.yaml index df48b67ff..6edcdb991 100644 --- a/module/config/argument/task.yaml +++ b/module/config/argument/task.yaml @@ -29,3 +29,6 @@ Daily: - Scheduler BattlePass: - Scheduler + Assignment: + - Scheduler + - Assignment diff --git a/module/config/config_generated.py b/module/config/config_generated.py index 6693be31f..606ae94c2 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -41,3 +41,7 @@ class GeneratedConfig: # Group `Dungeon` Dungeon_Name = 'Calyx_Golden_Memories' # Calyx_Golden_Memories, Calyx_Golden_Aether, Calyx_Golden_Treasures, Calyx_Crimson_Destruction, Calyx_Crimson_Preservation, Calyx_Crimson_Calyx_Crimson_Hunt, Calyx_Crimson_Abundance, Calyx_Crimson_Erudition, Calyx_Crimson_Harmony, Calyx_Crimson_Nihility, Stagnant_Shadow_Quanta, Stagnant_Shadow_Gust, Stagnant_Shadow_Fulmination, Stagnant_Shadow_Blaze, Stagnant_Shadow_Spike, Stagnant_Shadow_Rime, Stagnant_Shadow_Mirage, Stagnant_Shadow_Icicle, Stagnant_Shadow_Doom, Cavern_of_Corrosion_Path_of_Gelid_Wind, Cavern_of_Corrosion_Path_of_Jabbing_Punch, Cavern_of_Corrosion_Path_of_Drifting, Cavern_of_Corrosion_Path_of_Providence, Cavern_of_Corrosion_Path_of_Holy_Hymn, Cavern_of_Corrosion_Path_of_Conflagration Dungeon_Team = 1 # 1, 2, 3, 4, 5, 6 + + # Group `Assignment` + Assignment_Filter = 'Nameless Land Nameless People > Akashic Records > The Invisible Hand > Root Out the Turpitude' + Assignment_Duration = 20 # 4, 8, 12, 20 diff --git a/module/config/config_manual.py b/module/config/config_manual.py index 695b688ad..bfc10ec90 100644 --- a/module/config/config_manual.py +++ b/module/config/config_manual.py @@ -8,6 +8,7 @@ class ManualConfig: SCHEDULER_PRIORITY = """ Restart + > Assignment > Dungeon > DailyQuest > BattlePass """ diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index 65f9764e1..42a1e73dc 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -29,6 +29,10 @@ "BattlePass": { "name": "Nameless Honor", "help": "" + }, + "Assignment": { + "name": "Assignment", + "help": "" } }, "Scheduler": { @@ -216,6 +220,24 @@ "6": "6" } }, + "Assignment": { + "_info": { + "name": "Assignment Settings", + "help": "" + }, + "Filter": { + "name": "Assignment Priority", + "help": "Example: Nameless Land Nameless People > Akashic Records > The Invisible Hand > Root Out the Turpitude" + }, + "Duration": { + "name": "Assignment Duration", + "help": "", + "4": "4", + "8": "8", + "12": "12", + "20": "20" + } + }, "Gui": { "Aside": { "Install": "Install", diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 53e8ae4c1..4a4b759b3 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -29,6 +29,10 @@ "BattlePass": { "name": "ナナシの勲功", "help": "" + }, + "Assignment": { + "name": "Task.Assignment.name", + "help": "Task.Assignment.help" } }, "Scheduler": { @@ -216,6 +220,24 @@ "6": "6" } }, + "Assignment": { + "_info": { + "name": "Assignment._info.name", + "help": "Assignment._info.help" + }, + "Filter": { + "name": "Assignment.Filter.name", + "help": "Assignment.Filter.help" + }, + "Duration": { + "name": "Assignment.Duration.name", + "help": "Assignment.Duration.help", + "4": "4", + "8": "8", + "12": "12", + "20": "20" + } + }, "Gui": { "Aside": { "Install": "インストール", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 92c0655c2..97e327582 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -29,6 +29,10 @@ "BattlePass": { "name": "无名勋礼", "help": "" + }, + "Assignment": { + "name": "委托设置", + "help": "" } }, "Scheduler": { @@ -216,6 +220,24 @@ "6": "6" } }, + "Assignment": { + "_info": { + "name": "委托设置", + "help": "" + }, + "Filter": { + "name": "委托优先级", + "help": "中文或英文皆可,须保证没有错字漏字\n比如:无名之地,无名之人 > 阿卡夏记录 > The Invisible Hand > 根除恶孽" + }, + "Duration": { + "name": "委托时长", + "help": "", + "4": "4", + "8": "8", + "12": "12", + "20": "20" + } + }, "Gui": { "Aside": { "Install": "安装", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 896196f48..4314a64e9 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -29,6 +29,10 @@ "BattlePass": { "name": "無名勳禮", "help": "" + }, + "Assignment": { + "name": "委託設置", + "help": "" } }, "Scheduler": { @@ -216,6 +220,24 @@ "6": "6" } }, + "Assignment": { + "_info": { + "name": "委託設置", + "help": "" + }, + "Filter": { + "name": "委託優先級", + "help": "中文或英文皆可,須保證沒有錯字漏字\n比如:無名之地,無名之人 > 阿卡夏記錄 > The Invisible Hand > 根除惡孽" + }, + "Duration": { + "name": "委託時長", + "help": "", + "4": "4", + "8": "8", + "12": "12", + "20": "20" + } + }, "Gui": { "Aside": { "Install": "安裝", diff --git a/src.py b/src.py index d4c3ff97d..e39464425 100644 --- a/src.py +++ b/src.py @@ -34,6 +34,10 @@ class StarRailCopilot(AzurLaneAutoScript): from tasks.battle_pass.battle_pass import BattlePassUI BattlePassUI(config=self.config, device=self.device).run() + def assignment(self): + from tasks.assignment.assignment import Assignment + Assignment(config=self.config, device=self.device).run() + if __name__ == '__main__': src = StarRailCopilot('src')