Skip to content

Commit

Permalink
docs: 文档格式错误
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Mar 9, 2025
1 parent b6f9ac4 commit fac63e4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
16 changes: 15 additions & 1 deletion docs/en_us/1.1-QuickStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def main():
AgentServer.join()
AgentServer.shut_down()

# register custom recognizer

# register your recognizer
@AgentServer.custom_recognition("MyReco")
class MyRecognition(CustomRecognition):
def analyze(context, ...):
Expand All @@ -73,6 +74,19 @@ class MyRecognition(CustomRecognition):
# return the result
return AnalyzeResult(box=(10, 10, 100, 100))


# register your action
@AgentServer.custom_action("MyAct")
class MyAction(CustomAction):
def run(context, ...):
# do click
context.controller.post_click(100, 10).wait()
# rewrite next task
context.override_next(node_name, ["TaskA", "TaskB"])

return True
```

For details, please refer to [this commit](https://github.com/MaaXYZ/MaaPracticeBoilerplate/commit/126a56cefc17bf6c8335c703387d8d3ee2dad4d1).

### Write Your Own Code
Expand Down
6 changes: 5 additions & 1 deletion docs/zh_cn/1.1-快速开始.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def main():
AgentServer.join()
AgentServer.shut_down()


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

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

# 注册自定义动作
@AgentServer.custom_action("MyAct")
Expand All @@ -83,8 +83,12 @@ class MyAction(CustomAction):
context.controller.post_click(100, 10).wait()
# 重写接下来要执行的任务
context.override_next(node_name, ["TaskA", "TaskB"])

return True
```

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

### 自行编写代码

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

0 comments on commit fac63e4

Please sign in to comment.