Skip to content

Commit b15dd7f

Browse files
committed
fix: 修复活动智能作战次数直接崩溃的问题
1 parent ef85d8e commit b15dd7f

7 files changed

Lines changed: 56 additions & 20 deletions

File tree

.github/versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"MaaFramework": "v5.10.2",
3-
"MFAAvalonia": "v2.12.0"
3+
"MFAAvalonia": "v2.12.1"
44
}

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919
}
2020
],
2121
"files.associations": {
22+
"*.py": "python",
2223
"**/assets/**/*.json": "jsonc"
2324
},
25+
"python.languageServer": "Pylance",
26+
"editor.semanticHighlighting.enabled": true,
2427
"[json][jsonc]": {
2528
"editor.formatOnSave": true,
2629
"editor.insertSpaces": true,
@@ -33,5 +36,7 @@
3336
"[markdown]": {
3437
"editor.formatOnSave": true,
3538
"editor.defaultFormatter": "esbenp.prettier-vscode"
36-
}
39+
},
40+
"python-envs.defaultEnvManager": "ms-python.python:conda",
41+
"python-envs.defaultPackageManager": "ms-python.python:conda"
3742
}

agent/customs/special_treat/activity.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,19 @@ def run(self, context: Context, argv: CustomAction.RunArg) -> bool:
9696
return False
9797
Prompter.log(f"剩余次数:{left_times}")
9898
context.override_pipeline(
99-
{"每日活动作战_速战": {"custom_action_param": f"t={left_times}"}},
100-
{"每日活动作战2_速战": {"custom_action_param": f"t={left_times}"}},
99+
{
100+
"每日活动作战_速战": {"custom_action_param": f"t={left_times}"},
101+
"每日活动作战2_速战": {
102+
"custom_action_param": f"t={left_times}"
103+
},
104+
},
101105
)
102106
return True
103107
context.override_pipeline(
104-
{"每日活动作战_速战": {"custom_action_param": f"t=20"}},
105-
{"每日活动作战2_速战": {"custom_action_param": f"t=20"}},
108+
{
109+
"每日活动作战_速战": {"custom_action_param": f"t=20"},
110+
"每日活动作战2_速战": {"custom_action_param": f"t=20"},
111+
},
106112
)
107113
Prompter.log(f"未检测到活动进度!")
108114
return False

agent/customs/utils/prompter.py

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
from maa.controller import Controller
55

66
import time
7+
from typing import Any, Literal, overload
78

89

9-
def cprint(content: str = "", interval: int = 0.1):
10+
def cprint(content: str = "", interval: float = 0.1):
1011
interval /= 2
1112
time.sleep(interval)
1213
print("info:" + content)
@@ -31,12 +32,39 @@ def log(
3132
cprint("——" * 5)
3233

3334
@staticmethod
35+
@overload
3436
def error(
3537
content: str,
36-
e: Exception = None,
37-
reco_detail=None,
38-
use_defult_postfix=True,
39-
):
38+
e: Exception | str | None = None,
39+
reco_detail: None = None,
40+
use_defult_postfix: bool = True,
41+
) -> Literal[False]: ...
42+
43+
@staticmethod
44+
@overload
45+
def error(
46+
content: str,
47+
e: Exception | str | None,
48+
reco_detail: Literal[True] | dict[str, Any],
49+
use_defult_postfix: bool = True,
50+
) -> CustomRecognition.AnalyzeResult: ...
51+
52+
@staticmethod
53+
@overload
54+
def error(
55+
content: str,
56+
*,
57+
reco_detail: Literal[True] | dict[str, Any],
58+
use_defult_postfix: bool = True,
59+
) -> CustomRecognition.AnalyzeResult: ...
60+
61+
@staticmethod
62+
def error(
63+
content: str,
64+
e: Exception | str | None = None,
65+
reco_detail: Literal[True] | dict[str, Any] | None = None,
66+
use_defult_postfix: bool = True,
67+
) -> Literal[False] | CustomRecognition.AnalyzeResult:
4068
if use_defult_postfix:
4169
content += "失败,请立即停止运行程序!"
4270
cprint("——" * 5)

assets/interface.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"interface_version": 2,
33
"name": "MaaDuDuL",
4-
"title": "MDDL 嘟嘟脸小助手(kqcoxn/MaaDuDuL) v0.2.16 - MFAA | 游戏版本:圣诞节&回忆之池",
4+
"title": "MDDL 嘟嘟脸小助手(kqcoxn/MaaDuDuL) v0.2.17 - MFAA | 游戏版本:圣诞节&回忆之池",
55
"icon": "logo.png",
66
"description": "嘟嘟脸小助手",
7-
"version": "v0.2.16",
7+
"version": "v0.2.17",
88
"welcome": "欢迎使用 MDDL!",
99
"contact": "QQ群: 926874985",
1010
"license": "LICENSE",

assets/resource/Changelog.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
# v0.2.16
1+
# v0.2.17
22

3-
> 2026.5.2
3+
> 2026.5.3
44
55
## 主要内容
66

7-
- **功能优化**
8-
- 添加活动作战智能次数上限机制
97
- **问题修复**
10-
- 添加活动作战智能次数上限机制
11-
- 再次修复圣团可能卡在世界树导致后续圣团未完成的问题
8+
- 修复活动智能作战次数直接崩溃的问题
129

1310
> 更多日志与累积更新请在公告相关板块中查看
1411

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"agent": "python dev/run_agent.py",
66
"debug": "pnpm dlx @weinibuliu/maa-debugger@latest",
77
"reset": "git reset --soft HEAD~1",
8-
"release": "git tag -a v0.2.16 -m \"release v0.2.16\" && git push origin v0.2.16"
8+
"release": "git tag -a v0.2.17 -m \"release v0.2.17\" && git push origin v0.2.17"
99
},
1010
"devDependencies": {
1111
"prettier-plugin-multiline-arrays": "^3.0.6"

0 commit comments

Comments
 (0)