Skip to content

Commit

Permalink
Merge branch 'dev_shawn' of https://github.com/Fuynkio/arknights-mower
Browse files Browse the repository at this point in the history
…into dev_shawn
  • Loading branch information
fuyn101 committed Sep 27, 2023
2 parents 8b6adb9 + aa99655 commit 4db1b2b
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 31 deletions.
4 changes: 1 addition & 3 deletions arknights_mower/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ def set_maa_options(base_scheduler):
maa_config['maa_execution_gap'] = conf['maa_gap']
maa_config['buy_first'] = conf['maa_mall_buy']
maa_config['blacklist'] = conf['maa_mall_blacklist']
maa_config['recruitment_time'] = conf['maa_recruitment_time']
maa_config['recruit_only_4'] = conf['maa_recruit_only_4']
maa_config['conn_preset'] = conf['maa_conn_preset']
maa_config['touch_option'] = conf['maa_touch_option']
maa_config['mall_ignore_when_full'] = conf['maa_mall_ignore_blacklist_when_full']
Expand Down Expand Up @@ -179,7 +177,7 @@ def initialize(tasks, scheduler=None):
base_scheduler.error = False
base_scheduler.drone_room = None if conf['drone_room'] == '' else conf['drone_room']
base_scheduler.reload_room = list(filter(None, conf['reload_room'].replace(',', ',').split(',')))
base_scheduler.drone_execution_gap = 4
base_scheduler.drone_execution_gap = conf['drone_interval']
base_scheduler.run_order_delay = conf['run_order_delay']
base_scheduler.agent_base_config = agent_base_config
base_scheduler.exit_game_when_idle = conf['exit_game_when_idle']
Expand Down
19 changes: 0 additions & 19 deletions arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -2232,25 +2232,6 @@ def append_maa_task(self, type):
'expiring_medicine': 9999
})
self.stages.append(stage)
elif type == 'Recruit':
if self.maa_config['recruitment_time']:
recruitment_time = 460
else:
recruitment_time = 540
if self.maa_config['recruit_only_4']:
confirm = [4]
else:
confirm = [3, 4]
self.MAA.append_task('Recruit', {
'select': [4],
'confirm': confirm,
'times': 4,
'refresh': True,
"recruitment_time": {
"3": recruitment_time,
"4": 540
}
})
elif type == 'Mall':
self.MAA.append_task('Mall', {
'shopping': True,
Expand Down
8 changes: 5 additions & 3 deletions arknights_mower/templates/conf.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
adb: 127.0.0.1:62001
drone_count_limit: 92
drone_room: ''
drone_interval: 4
enable_party: 1
exhaust_require: ''
workaholic: ''
Expand Down Expand Up @@ -166,8 +167,6 @@ maa_gap: 4
maa_mall_blacklist: 加急许可,碳,碳素,家具零件
maa_mall_buy: 招聘许可,龙门币,技巧概要·卷2
maa_mall_ignore_blacklist_when_full: false
maa_recruit_only_4: false
maa_recruitment_time: false
maa_rg_sleep_max: 0:00
maa_rg_sleep_min: 0:00
webview:
Expand Down Expand Up @@ -208,4 +207,7 @@ sss:
type: 1
ec: 1
loop: 1
copilot: ''
copilot: ''
run_order_grandet_mode:
enable: true
buffer_time: 15
19 changes: 13 additions & 6 deletions ui/src/pages/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useConfigStore } from '@/stores/config'
import { usePlanStore } from '@/stores/plan'
import { storeToRefs } from 'pinia'
import { computed, inject, ref } from 'vue'
import { computed, inject } from 'vue'
import pinyinMatch from 'pinyin-match/es/traditional'
Expand All @@ -12,13 +12,13 @@ const config_store = useConfigStore()
const plan_store = usePlanStore()
const mobile = inject('mobile')
const axios = inject('axios')
const {
run_mode,
run_order_delay,
drone_room,
drone_count_limit,
drone_interval,
reload_room,
start_automatically,
free_blacklist,
Expand All @@ -29,10 +29,7 @@ const {
resting_threshold,
tap_to_launch_game,
exit_game_when_idle,
screenshot,
maa_rg_enable,
maa_rg_sleep_min,
maa_rg_sleep_max
screenshot
} = storeToRefs(config_store)
const { operators } = storeToRefs(plan_store)
Expand Down Expand Up @@ -228,6 +225,16 @@ function render_label(option) {
</template>
<n-input-number v-model:value="drone_count_limit" />
</n-form-item>
<n-form-item>
<template #label>
<span>无人机加速间隔</span>
<help-text>
<div>单位:小时</div>
<div>可填小数</div>
</help-text>
</template>
<n-input-number v-model:value="drone_interval" />
</n-form-item>
<n-form-item label="搓玉补货房间:">
<n-select
multiple
Expand Down
9 changes: 9 additions & 0 deletions ui/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@ const router = createRouter({
routes
})

router.beforeEach((to, from) => {
if (from.query.token && !to.query.token) {
return {
path: to.path,
query: from.query
}
}
})

export default router
5 changes: 5 additions & 0 deletions ui/src/stores/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const useConfigStore = defineStore('config', () => {
const adb = ref('')
const drone_count_limit = ref(0)
const drone_room = ref('')
const drone_interval = ref(4)
const enable_party = ref(true)
const free_blacklist = ref([])
const maa_adb_path = ref('')
Expand Down Expand Up @@ -70,6 +71,7 @@ export const useConfigStore = defineStore('config', () => {
adb.value = response.data.adb
drone_count_limit.value = response.data.drone_count_limit
drone_room.value = response.data.drone_room
drone_interval.value = response.data.drone_interval
enable_party.value = response.data.enable_party != 0
free_blacklist.value =
response.data.free_blacklist == '' ? [] : response.data.free_blacklist.split(',')
Expand Down Expand Up @@ -127,6 +129,7 @@ export const useConfigStore = defineStore('config', () => {
adb: adb.value,
drone_count_limit: drone_count_limit.value,
drone_room: drone_room.value,
drone_interval: drone_interval.value,
enable_party: enable_party.value ? 1 : 0,
free_blacklist: free_blacklist.value.join(','),
maa_adb_path: maa_adb_path.value,
Expand Down Expand Up @@ -183,6 +186,7 @@ export const useConfigStore = defineStore('config', () => {
adb,
drone_count_limit,
drone_room,
drone_interval,
enable_party,
free_blacklist,
maa_adb_path,
Expand Down Expand Up @@ -239,6 +243,7 @@ export const useConfigStore = defineStore('config', () => {
load_config,
drone_count_limit,
drone_room,
drone_interval,
enable_party,
free_blacklist,
maa_adb_path,
Expand Down

0 comments on commit 4db1b2b

Please sign in to comment.