From 4cf399a21945d106987d1b6d5f1dd22f5f395de8 Mon Sep 17 00:00:00 2001 From: fuyn Date: Tue, 10 Oct 2023 17:27:24 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E5=8F=AF=E9=80=89=E5=85=B3=E9=97=AD=20=E5=9C=A8=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arknights_mower/__main__.py | 1 + arknights_mower/solvers/base_schedule.py | 12 +++++++++--- arknights_mower/templates/conf.yml | 1 + ui/components.d.ts | 3 +-- ui/src/components/Depotpage.vue | 21 +++++++++++++++++++++ ui/src/pages/Settings.vue | 1 + ui/src/stores/config.js | 5 +++++ 7 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 ui/src/components/Depotpage.vue diff --git a/arknights_mower/__main__.py b/arknights_mower/__main__.py index cb356c78d..badb8c819 100644 --- a/arknights_mower/__main__.py +++ b/arknights_mower/__main__.py @@ -109,6 +109,7 @@ def set_maa_options(base_scheduler): maa_config["touch_option"] = conf["maa_touch_option"] maa_config["mall_ignore_when_full"] = conf["maa_mall_ignore_blacklist_when_full"] maa_config["credit_fight"] = conf["maa_credit_fight"] + maa_config["maa_depot_enable"] = conf["maa_depot_enable"] maa_config["rogue"] = conf["rogue"] maa_config["stationary_security_service"] = ( conf["maa_rg_enable"] == 1 and conf["maa_long_task_type"] == "sss" diff --git a/arknights_mower/solvers/base_schedule.py b/arknights_mower/solvers/base_schedule.py index 44b853901..4fe14eb6e 100644 --- a/arknights_mower/solvers/base_schedule.py +++ b/arknights_mower/solvers/base_schedule.py @@ -90,6 +90,7 @@ def __init__(self, device: Device = None, recog: Recognizer = None) -> None: self.maa_config = {} self.free_clue = None self.credit_fight = None + self.maa_depot_enable = False self.exit_game_when_idle = False self.simulator = None self.close_simulator_when_idle = False @@ -120,6 +121,8 @@ def run(self) -> None: self.free_clue = None if self.credit_fight is not None and self.credit_fight != get_server_weekday(): self.credit_fight = None + # if self.credit_fight is not None and self.credit_fight != get_server_weekday(): + # self.credit_fight = None self.todo_task = False self.collect_notification = False self.planned = False @@ -2226,7 +2229,7 @@ def initialize_maa(self): raise Exception("MAA 连接失败") def append_maa_task(self, type): - if type in ['StartUp', 'Visit', 'Award','Depot']: + if type in ['StartUp', 'Visit', 'Award']: self.MAA.append_task(type) elif type == 'Fight': _plan = self.maa_config['weekly_plan'][get_server_weekday()] @@ -2256,7 +2259,10 @@ def append_maa_task(self, type): 'credit_fight': self.maa_config['credit_fight'] and '' not in self.stages and self.credit_fight is None, "force_shopping_if_credit_full": self.maa_config['mall_ignore_when_full'] }) - + elif type == 'Depot': + self.MAA.append_task('Depot',{ + "enable": self.maa_config['maa_depot_enable'] + }) def maa_plan_solver(self, tasks='All', one_time=False): try: if not one_time and 'last_execution' in self.maa_config and self.maa_config['last_execution'] is not None and datetime.now() - timedelta( @@ -2277,7 +2283,7 @@ def maa_plan_solver(self, tasks='All', one_time=False): # 任务及参数请参考 docs/集成文档.md self.initialize_maa() if tasks == 'All': - tasks = ['StartUp', 'Fight', 'Visit', 'Mall', 'Award','Depot'] + tasks = ['StartUp','Depot','Fight', 'Visit', 'Mall', 'Award'] # tasks = ['StartUp', 'Fight', 'Recruit', 'Visit', 'Mall', 'Award'] for maa_task in tasks: if maa_task == 'Recruit': diff --git a/arknights_mower/templates/conf.yml b/arknights_mower/templates/conf.yml index 83bb190e5..ea4eb9ae1 100644 --- a/arknights_mower/templates/conf.yml +++ b/arknights_mower/templates/conf.yml @@ -218,6 +218,7 @@ theme: light maa_conn_preset: General maa_touch_option: maatouch maa_credit_fight: true +maa_depot_enable: false maa_rg_theme: Mizuki rogue: squad: '' diff --git a/ui/components.d.ts b/ui/components.d.ts index 2c48b986e..8ddfdff0d 100644 --- a/ui/components.d.ts +++ b/ui/components.d.ts @@ -10,6 +10,7 @@ export {} declare module '@vue/runtime-core' { export interface GlobalComponents { Clue: typeof import('./src/components/Clue.vue')['default'] + Depotpage: typeof import('./src/components/Depotpage.vue')['default'] Email: typeof import('./src/components/Email.vue')['default'] HelpText: typeof import('./src/components/HelpText.vue')['default'] MaaBasic: typeof import('./src/components/MaaBasic.vue')['default'] @@ -30,7 +31,6 @@ declare module '@vue/runtime-core' { NForm: typeof import('naive-ui')['NForm'] NFormItem: typeof import('naive-ui')['NFormItem'] NFormItemGi: typeof import('naive-ui')['NFormItemGi'] - NGi: typeof import('naive-ui')['NGi'] NGlobalStyle: typeof import('naive-ui')['NGlobalStyle'] NGrid: typeof import('naive-ui')['NGrid'] NIcon: typeof import('naive-ui')['NIcon'] @@ -54,7 +54,6 @@ declare module '@vue/runtime-core' { NTable: typeof import('naive-ui')['NTable'] NTabPane: typeof import('naive-ui')['NTabPane'] NTabs: typeof import('naive-ui')['NTabs'] - NThing: typeof import('naive-ui')['NThing'] NTimePicker: typeof import('naive-ui')['NTimePicker'] NTooltip: typeof import('naive-ui')['NTooltip'] NTransfer: typeof import('naive-ui')['NTransfer'] diff --git a/ui/src/components/Depotpage.vue b/ui/src/components/Depotpage.vue new file mode 100644 index 000000000..dbf95e9b7 --- /dev/null +++ b/ui/src/components/Depotpage.vue @@ -0,0 +1,21 @@ + + \ No newline at end of file diff --git a/ui/src/pages/Settings.vue b/ui/src/pages/Settings.vue index da7adea14..124eb4450 100644 --- a/ui/src/pages/Settings.vue +++ b/ui/src/pages/Settings.vue @@ -300,6 +300,7 @@ function render_label(option) { +
diff --git a/ui/src/stores/config.js b/ui/src/stores/config.js index 8eb7a9047..e7b6ca973 100644 --- a/ui/src/stores/config.js +++ b/ui/src/stores/config.js @@ -44,6 +44,7 @@ export const useConfigStore = defineStore('config', () => { const maa_rg_sleep_min = ref('00:00') const maa_rg_sleep_max = ref('00:00') const maa_credit_fight = ref(true) + const maa_depot_enable = ref(false) const maa_rg_theme = ref('Mizuki') const rogue = ref({}) const sss = ref({}) @@ -115,6 +116,7 @@ export const useConfigStore = defineStore('config', () => { maa_rg_sleep_max.value = response.data.maa_rg_sleep_max maa_rg_sleep_min.value = response.data.maa_rg_sleep_min maa_credit_fight.value = response.data.maa_credit_fight + maa_depot_enable.value = response.data.maa_depot_enable maa_rg_theme.value = response.data.maa_rg_theme rogue.value = response.data.rogue sss.value = response.data.sss @@ -175,6 +177,7 @@ export const useConfigStore = defineStore('config', () => { maa_rg_sleep_max: maa_rg_sleep_max.value, maa_rg_sleep_min: maa_rg_sleep_min.value, maa_credit_fight: maa_credit_fight.value, + maa_depot_enable: maa_depot_enable.value, maa_rg_theme: maa_rg_theme.value, rogue: rogue.value, sss: sss.value, @@ -231,6 +234,7 @@ export const useConfigStore = defineStore('config', () => { maa_rg_sleep_min, maa_rg_sleep_max, maa_credit_fight, + maa_depot_enable, maa_rg_theme, rogue, sss, @@ -295,6 +299,7 @@ export const useConfigStore = defineStore('config', () => { maa_rg_sleep_min, maa_rg_sleep_max, maa_credit_fight, + maa_depot_enable, maa_rg_theme, rogue, sss, From 838b481a5b279118dc66c70be5dfd75ba5cc3692 Mon Sep 17 00:00:00 2001 From: fuyn Date: Tue, 10 Oct 2023 17:28:45 +0800 Subject: [PATCH 2/3] Changes to be committed: modified: ui/components.d.ts --- ui/components.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/components.d.ts b/ui/components.d.ts index 8ddfdff0d..2cd78276e 100644 --- a/ui/components.d.ts +++ b/ui/components.d.ts @@ -31,6 +31,7 @@ declare module '@vue/runtime-core' { NForm: typeof import('naive-ui')['NForm'] NFormItem: typeof import('naive-ui')['NFormItem'] NFormItemGi: typeof import('naive-ui')['NFormItemGi'] + NGi: typeof import('naive-ui')['NGi'] NGlobalStyle: typeof import('naive-ui')['NGlobalStyle'] NGrid: typeof import('naive-ui')['NGrid'] NIcon: typeof import('naive-ui')['NIcon'] @@ -54,6 +55,7 @@ declare module '@vue/runtime-core' { NTable: typeof import('naive-ui')['NTable'] NTabPane: typeof import('naive-ui')['NTabPane'] NTabs: typeof import('naive-ui')['NTabs'] + NThing: typeof import('naive-ui')['NThing'] NTimePicker: typeof import('naive-ui')['NTimePicker'] NTooltip: typeof import('naive-ui')['NTooltip'] NTransfer: typeof import('naive-ui')['NTransfer'] From 48ad9cbd0d7141ab088fa0e8d8739641d1dee98a Mon Sep 17 00:00:00 2001 From: fuyn Date: Tue, 10 Oct 2023 17:33:19 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9C=A8=E4=BB=93=E5=BA=93=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=8A=A0=E5=85=A5=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/components/Depotpage.vue | 15 ++---- ui/src/pages/depot.vue | 84 ++++++++++++++++++--------------- 2 files changed, 52 insertions(+), 47 deletions(-) diff --git a/ui/src/components/Depotpage.vue b/ui/src/components/Depotpage.vue index dbf95e9b7..7f36d0748 100644 --- a/ui/src/components/Depotpage.vue +++ b/ui/src/components/Depotpage.vue @@ -3,19 +3,14 @@ import { storeToRefs } from 'pinia' import { useConfigStore } from '@/stores/config' const store = useConfigStore() -const { - maa_depot_enable -} = storeToRefs(store) +const { maa_depot_enable } = storeToRefs(store) \ No newline at end of file + + diff --git a/ui/src/pages/depot.vue b/ui/src/pages/depot.vue index efd4b553c..c7c4a01bc 100644 --- a/ui/src/pages/depot.vue +++ b/ui/src/pages/depot.vue @@ -1,49 +1,59 @@ @@ -54,7 +64,7 @@ import { useConfigStore } from '@/stores/config' const store = useConfigStore() import { storeToRefs } from 'pinia' -const { maa_gap } = storeToRefs(store) +const { maa_gap, maa_depot_enable } = storeToRefs(store) //模态框 const showModal = ref(false)