Skip to content

Commit fac63e4

Browse files
committed
docs: 文档格式错误
1 parent b6f9ac4 commit fac63e4

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

docs/en_us/1.1-QuickStarted.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ def main():
6464
AgentServer.join()
6565
AgentServer.shut_down()
6666

67-
# register custom recognizer
67+
68+
# register your recognizer
6869
@AgentServer.custom_recognition("MyReco")
6970
class MyRecognition(CustomRecognition):
7071
def analyze(context, ...):
@@ -73,6 +74,19 @@ class MyRecognition(CustomRecognition):
7374
# return the result
7475
return AnalyzeResult(box=(10, 10, 100, 100))
7576

77+
78+
# register your action
79+
@AgentServer.custom_action("MyAct")
80+
class MyAction(CustomAction):
81+
def run(context, ...):
82+
# do click
83+
context.controller.post_click(100, 10).wait()
84+
# rewrite next task
85+
context.override_next(node_name, ["TaskA", "TaskB"])
86+
87+
return True
88+
```
89+
7690
For details, please refer to [this commit](https://github.com/MaaXYZ/MaaPracticeBoilerplate/commit/126a56cefc17bf6c8335c703387d8d3ee2dad4d1).
7791

7892
### Write Your Own Code

docs/zh_cn/1.1-快速开始.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def main():
6464
AgentServer.join()
6565
AgentServer.shut_down()
6666

67+
6768
# 注册自定义识别器
6869
@AgentServer.custom_recognition("MyReco")
6970
class MyRecognition(CustomRecognition):
@@ -73,7 +74,6 @@ class MyRecognition(CustomRecognition):
7374
# 返回图像分析结果
7475
return AnalyzeResult(box=(10, 10, 100, 100))
7576

76-
详情可参考 [模板 Commit](https://github.com/MaaXYZ/MaaPracticeBoilerplate/commit/126a56cefc17bf6c8335c703387d8d3ee2dad4d1)。
7777

7878
# 注册自定义动作
7979
@AgentServer.custom_action("MyAct")
@@ -83,8 +83,12 @@ class MyAction(CustomAction):
8383
context.controller.post_click(100, 10).wait()
8484
# 重写接下来要执行的任务
8585
context.override_next(node_name, ["TaskA", "TaskB"])
86+
87+
return True
8688
```
8789

90+
详情可参考 [模板 Commit](https://github.com/MaaXYZ/MaaPracticeBoilerplate/commit/126a56cefc17bf6c8335c703387d8d3ee2dad4d1)
91+
8892
### 自行编写代码
8993

9094
可以将低代码作为一种“封装”进行调用,亦可注册自定义回调使用

0 commit comments

Comments
 (0)