Skip to content

Commit

Permalink
Merge pull request #414 from EightyDollars/dev_shawn
Browse files Browse the repository at this point in the history
fix:招募四星以上干员时产生异常无法继续公招
  • Loading branch information
ZhaoZuohong authored Nov 22, 2023
2 parents e8406e6 + f10b919 commit c3f570e
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 26 deletions.
1 change: 1 addition & 0 deletions arknights_mower/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def set_recruit_options(base_scheduler, conf):
recruit_config["recruit_robot"] = conf["recruit_robot"]
recruit_config["recruitment_time"] = conf["recruitment_time"]
recruit_config["recruit_execution_gap"] = conf["recruit_gap"]
recruit_config["recruit_auto_5"] = conf["recruit_auto_5"]
base_scheduler.recruit_config = recruit_config
logger.debug(f"更新公招设置:{base_scheduler.recruit_config}")

Expand Down
Binary file added arknights_mower/resources/riic_manufacture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 12 additions & 4 deletions arknights_mower/solvers/recruit.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def run(self, priority: list[str] = None, send_message_config={}, recruit_config
agent = []
for item in self.agent_choose[pos]['result']:
agent.append(item['name'])
logger.info("{}:[".format(pos) + ",".join(self.agent_choose[pos]['tags']) + "]:{}".format(",".join(agent)))
logger.info(
"{}:[".format(pos) + ",".join(self.agent_choose[pos]['tags']) + "]:{}".format(",".join(agent)))
if self.agent_choose or self.result_agent:
self.send_message(recruit_template.render(recruit_results=self.agent_choose,
recruit_get_agent=self.result_agent,
Expand All @@ -105,10 +106,13 @@ def add_recruit_param(self, recruit_config):
self.recruit_config = {
"recruitment_time": {
"3": recruitment_time,
"4": 540
"4": 540,
"5": 540,
"6": 540
},
"recruit_robot": recruit_config['recruit_robot'],
"permit_target": recruit_config['permit_target']
"permit_target": recruit_config['permit_target'],
"recruit_auto_5": recruit_config['recruit_auto_5']
}

if not self.recruit_config['recruit_robot']:
Expand Down Expand Up @@ -247,7 +251,10 @@ def recruit_tags(self):
"出稀有标签辣",
"html")
logger.info('稀有tag,发送邮件')
if len(recruit_cal_result) > 1:
if self.recruit_config['recruit_auto_5'] == 3:
self.back()
return
if len(recruit_cal_result) > 1 and self.recruit_config['recruit_auto_5'] != 1:
self.back()
return

Expand Down Expand Up @@ -291,6 +298,7 @@ def recruit_tags(self):
self.device.tap((left + x[2][0][0] - 5, up + x[2][0][1] - 5))

# 9h为True 3h50min为False
logger.debug("开始选择时长")
recruit_time_choose = self.recruit_config["recruitment_time"]["3"]
if recruit_result_level >= 3:
if recruit_result_level == 1:
Expand Down
61 changes: 41 additions & 20 deletions ui/src/components/Recruit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useConfigStore } from '@/stores/config'
const store = useConfigStore()
import { storeToRefs } from 'pinia'
const { recruit_enable, recruitment_permit, recruitment_time, recruit_robot, recruit_gap } =
const { recruit_enable, recruitment_permit, recruitment_time, recruit_robot, recruit_gap,recruit_auto_5} =
storeToRefs(store)
import { ref, inject } from 'vue'
Expand All @@ -11,7 +11,7 @@ const mobile = inject('mobile')
const recruit_4 = ref('900')
</script>

<template>
<template >
<n-card>
<template #header>
<n-checkbox v-model:checked="recruit_enable">
Expand Down Expand Up @@ -66,14 +66,40 @@ const recruit_4 = ref('900')
</td>
</tr>
<tr>
<td>五星</td>
<td rowspan="2">五星</td>
<td>
<n-radio-group name="recruit_4" v-model:value="recruit_4">
<n-radio-group name="recruit_4" v-model:value="recruit_4">
<n-space justify="start">
<n-radio value="900">
邮件通知
<help-text>
<div>发送邮件通知,不自动选择</div>
</help-text>
</n-radio>
</n-space>
</n-radio-group>
</td>
</tr>
<tr>
<td>
<n-radio-group name="recruit_auto_5" v-model:value="recruit_auto_5">
<n-space justify="start">
<n-radio value="900">
邮件通知
<n-radio :value="1">
自动选择
<help-text>
<div>发送邮件通知,不自动选择</div>
<div>自动选择五星tag</div>
</help-text>
</n-radio>
<n-radio :value="2">
半自动选择
<help-text>
<div>只有一个选项时自动进行选择</div>
</help-text>
</n-radio>
<n-radio :value="3">
手动选择
<help-text>
<div>不自动选择</div>
</help-text>
</n-radio>
</n-space>
Expand Down Expand Up @@ -135,33 +161,28 @@ h4 {
margin: 12px 0 10px 0;
}
.recruit-3 td {
&:nth-child(1) {
width: 64px;
}
&:nth-child(2) {
width: 200px;
}
}
.big-table {
margin-top: 10px;
max-width: 360px;
max-width: 480px;
th {
text-align: center;
}
tr{
width: 70px;
}
td {
height: 24px;
&:nth-child(1) {
width: 70px;
width: 60px;
text-align: center;
}
&:nth-child(2) {
padding-left: 18px;
width: 420px;
text-align: center;
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions ui/src/stores/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const useConfigStore = defineStore('config', () => {
const check_mail_enable = ref(true)
const report_enable = ref(true)
const recruit_gap = ref(false)
const recruit_auto_5=ref("hand")

async function load_shop() {
const response = await axios.get(`${import.meta.env.VITE_HTTP_URL}/shop`)
Expand Down Expand Up @@ -136,6 +137,7 @@ export const useConfigStore = defineStore('config', () => {
check_mail_enable.value = response.data.check_mail_enable
report_enable.value = response.data.report_enable
recruit_gap.value = response.data.recruit_gap
recruit_auto_5.value=response.data.recruit_auto_5
}

function build_config() {
Expand Down Expand Up @@ -200,7 +202,8 @@ export const useConfigStore = defineStore('config', () => {
sendKey: sendKey.value,
check_mail_enable: check_mail_enable.value,
report_enable: report_enable.value,
recruit_gap: recruit_gap.value
recruit_gap: recruit_gap.value,
recruit_auto_5: recruit_auto_5.value
}
}

Expand Down Expand Up @@ -272,6 +275,7 @@ export const useConfigStore = defineStore('config', () => {
sendKey,
check_mail_enable,
report_enable,
recruit_gap
recruit_gap,
recruit_auto_5
}
})

0 comments on commit c3f570e

Please sign in to comment.