Skip to content

Commit 81c02ff

Browse files
authored
docs: 优化入门文档 (#936)
1 parent 4c212e9 commit 81c02ff

File tree

7 files changed

+156
-66
lines changed

7 files changed

+156
-66
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ _✨ 基于图像识别的自动化黑盒测试框架 ✨_
104104
- [MaaXuexi](https://github.com/ravizhan/MaaXuexi) ![python](https://img.shields.io/badge/Python-3776AB?logo=python&logoColor=white) ![Pipeline](https://img.shields.io/badge/Pipeline-%23876f69?logo=paddypower&logoColor=%23FFFFFF) ![license](https://img.shields.io/github/license/ravizhan/MaaXuexi) ![activity](https://img.shields.io/github/commit-activity/m/ravizhan/MaaXuexi?color=%23ff69b4) ![stars](https://img.shields.io/github/stars/ravizhan/MaaXuexi?style=social)
105105
学习强国 自动化助手。图像技术 + 模拟控制,解放双手!由 MaaFramework 强力驱动!
106106

107-
- [MAA_MHXY_MG](https://github.com/gitlihang/Maa_MHXY_MG) ![Pipeline](https://img.shields.io/badge/Pipeline-%23876f69?logo=paddypower&logoColor=%23FFFFFF) ![license](https://img.shields.io/github/license/gitlihang/Maa_MHXY_MG) ![activity](https://img.shields.io/github/commit-activity/m/gitlihang/Maa_MHXY_MG?color=%23ff69b4) ![stars](https://img.shields.io/github/stars/gitlihang/Maa_MHXY_MG?style=social) [![mirrorc](./docs/static/mirrorc-zh.svg)](https://mirrorchyan.com/zh/projects?source=maafw-badge)
107+
- [MAA_MHXY_MG](https://github.com/gitlihang/Maa_MHXY_MG) ![Pipeline](https://img.shields.io/badge/Pipeline-%23876f69?logo=paddypower&logoColor=%23FFFFFF) ![license](https://img.shields.io/github/license/gitlihang/Maa_MHXY_MG) ![activity](https://img.shields.io/github/commit-activity/m/gitlihang/Maa_MHXY_MG?color=%23ff69b4) ![stars](https://img.shields.io/github/stars/gitlihang/Maa_MHXY_MG?style=social) [![mirrorc](./docs/static/mirrorc-zh.svg)](https://mirrorchyan.com/zh/projects?source=maafw-badge)
108108
梦幻西游手游 小助手。图像技术 + 模拟控制,解放双手!由 MaaFramework 强力驱动!
109109

110110
- [MNMA](https://github.com/kqcoxn/MaaNewMoonAccompanying) ![Pipeline](https://img.shields.io/badge/Pipeline-%23876f69?logo=paddypower&logoColor=%23FFFFFF) ![python](https://img.shields.io/badge/Python-3776AB?logo=python&logoColor=white) ![license](https://img.shields.io/github/license/kqcoxn/MaaNewMoonAccompanying) ![activity](https://img.shields.io/github/commit-activity/m/kqcoxn/MaaNewMoonAccompanying?color=%23ff69b4) ![stars](https://img.shields.io/github/stars/kqcoxn/MaaNewMoonAccompanying?style=social) [![mirrorc](./docs/static/mirrorc-zh.svg)](https://mirrorchyan.com/zh/projects?source=maafw-badge)
@@ -257,9 +257,9 @@ _请留意,仅当您准备开发 MaaFramework 本身时,才需要阅读本
257257

258258
[![贡献者](https://contrib.rocks/image?repo=MaaXYZ/MaaFramework&max=1000)](https://github.com/MaaXYZ/MaaFramework/graphs/contributors)
259259

260-
## 讨论
260+
## 沟通交流
261261

262-
- 集成/开发交流 QQ 群: 595990173
262+
欢迎开发者加入官方 QQ 群595990173),交流集成与开发实践。群内仅讨论开发相关议题,不提供日常使用/客服支持;为保证讨论质量,长期离题或违规的成员可能会被移除。
263263

264264
## 赞助
265265

README_en.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,15 @@ It offers low-code simplicity while maintaining high extensibility. The framewor
142142

143143
- [MAG](https://github.com/Kazaorus/MAG) ![Pipeline](https://img.shields.io/badge/Pipeline-%23876f69?logo=paddypower&logoColor=%23FFFFFF) ![Python](https://img.shields.io/badge/Python-3776AB?logo=python&logoColor=white) ![license](https://img.shields.io/github/license/Kazaorus/MAG) ![activity](https://img.shields.io/github/commit-activity/m/Kazaorus/MAG?color=%23ff69b4) ![stars](https://img.shields.io/github/stars/Kazaorus/MAG?style=social)
144144
Assistant for Aether Gazer. Image recognition + simulation control to free your hands! Powered by MaaFramework!
145-
145+
146146
- [MAAAE](https://github.com/NewWYoming/MAAAE) ![Pipeline](https://img.shields.io/badge/Pipeline-%23876f69?logo=paddypower&logoColor=%23FFFFFF) ![python](https://img.shields.io/badge/Python-3776AB?logo=python&logoColor=white) ![license](https://img.shields.io/github/license/NewWYoming/MAAAE) ![activity](https://img.shields.io/github/commit-activity/m/NewWYoming/MAAAE?color=%23ff69b4) ![stars](https://img.shields.io/github/stars/NewWYoming/MAAAE?style=social)
147147
An assistant for Ash Echoes. Image technology + simulation control, freeing your hands! Powered by MaaFramework.
148148

149149
- [MBCCtools](https://github.com/quietlysnow/MBCCtools) ![Pipeline](https://img.shields.io/badge/Pipeline-%23876f69?logo=paddypower&logoColor=%23FFFFFF) ![license](https://img.shields.io/github/license/quietlysnow/MBCCtools) ![activity](https://img.shields.io/github/commit-activity/m/quietlysnow/MBCCtools?color=%23ff69b4) ![stars](https://img.shields.io/github/stars/quietlysnow/MBCCtools?style=social)
150150
Assistant for Path to Nowhere. Image recognition + simulation control to free your hands! Powered by MaaFramework!
151151

152152
- [MaaEOV](https://github.com/Tigerisu/MaaEOV) ![Pipeline](https://img.shields.io/badge/Pipeline-%23876f69?logo=paddypower&logoColor=%23FFFFFF) ![license](https://img.shields.io/github/license/Tigerisu/MaaEOV) ![activity](https://img.shields.io/github/commit-activity/m/Tigerisu/MaaEOV?color=%23ff69b4) ![stars](https://img.shields.io/github/stars/Tigerisu/MaaEOV?style=social)
153-
Assistant for *Echoes Of Vision*. Image recognition + simulation control to free your hands! Powered by MaaFramework!
153+
Assistant for _Echoes Of Vision_. Image recognition + simulation control to free your hands! Powered by MaaFramework!
154154

155155
- [MAA Star Resonance](https://github.com/26F-Studio/maa-star-resonance) ![Typescript](https://img.shields.io/badge/Typescript-8A2BE2?logo=typescript) ![license](https://img.shields.io/github/license/26F-Studio/maa-star-resonance) ![activity](https://img.shields.io/github/commit-activity/m/26F-Studio/maa-star-resonance?color=%23ff69b4) ![stars](https://img.shields.io/github/stars/26F-Studio/maa-star-resonance?style=social)
156156
A helper for Star Resonance. Using Electron + text image recognition + ADB simulation control technology, freeing your hands! Powered by MaaFramework and Quasar.
@@ -262,7 +262,7 @@ Thanks to the following developers for their contributions to MaaFramework:
262262

263263
## Discussion
264264

265-
- QQ Group: 595990173
265+
Developers are welcome to join the official QQ group (595990173) for integration and development discussions. The group is reserved for engineering topics; product-usage support is not provided, and off-topic or spam accounts may be removed to keep the channel focused.
266266

267267
## Sponsor
268268

docs/en_us/1.1-QuickStarted.md

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@ MaaFramework provides three integration solutions to meet different development
3232

3333
### Approach 2: JSON + Custom Logic Extension (Recommended)
3434

35-
**💡 Core feature of release v4.x**
36-
3735
**Features**:
3836

39-
- Retains the low-code advantage of JSON
40-
- Registers custom task modules through AgentServer
41-
- Seamlessly integrates with the [⭐ boilerplate](https://github.com/MaaXYZ/MaaPracticeBoilerplate).
37+
- Retains the low-code advantage of JSON; core flows remain visual and easy to edit
38+
- Hosts custom recognition/actions in the Agent process, making it easier to encapsulate advanced logic
39+
- Seamlessly integrates with the [⭐ boilerplate](https://github.com/MaaXYZ/MaaPracticeBoilerplate) to provide scaffolding and examples
4240

4341
```jsonc
4442
{
@@ -55,7 +53,7 @@ MaaFramework provides three integration solutions to meet different development
5553

5654
```
5755

58-
💡 The General UI will automatically connect to your AgentServer child process, and call the corresponding recognition/action when executing `MyReco`/`MyAct`.
56+
💡 The General UI automatically connects to your Agent process and invokes the registered recognition/action implementations when executing `MyReco`/`MyAct`.
5957

6058
```python
6159
# Python pseudo-code example
@@ -82,6 +80,9 @@ For a complete example, refer to the [template commit](https://github.com/MaaXYZ
8280

8381
### Approach 3: Full-Code Development
8482

83+
> [!NOTE]
84+
> MaaFramework offers full multi-language APIs, but code-only workflows lose ecosystem tools (visual editor, visual debugger, General UI). In most cases, the custom extensions in Approach 2 already cover advanced requirements without sacrificing those capabilities.
85+
8586
**Applicable Scenarios**:
8687

8788
- Deep customization requirements
@@ -108,9 +109,18 @@ def main():
108109

109110
## Resource Preparation
110111

112+
After you confirm your development approach, prepare the corresponding resource files. The example below uses the project boilerplate as a baseline.
113+
114+
> [!TIP]
115+
>
116+
> - If you use the project boilerplate, follow the `TIP` marks below for a ready path.
117+
> - If you choose full-code development, you still need resource files such as image assets and OCR models; otherwise related image-recognition features will be unavailable.
118+
111119
### File Structure Specification
112120

113-
*⭐If you use the boilerplate, just modify it directly in [folder](https://github.com/MaaXYZ/MaaPracticeBoilerplate/tree/main/assets/resource).*
121+
> [!TIP]
122+
>
123+
> ⭐If you use the boilerplate, modify the [folder](https://github.com/MaaXYZ/MaaPracticeBoilerplate/tree/main/assets/resource) directly.
114124
115125
```tree
116126
my_resource/
@@ -135,20 +145,22 @@ The files in `my_resource/pipeline` contain the main script execution logic and
135145

136146
You can refer to the [Task Pipeline Protocol](3.1-PipelineProtocol.md) for writing these files. You can find a simple [demo](https://github.com/MaaXYZ/MaaFramework/blob/main/sample/resource/pipeline/sample.json) for reference.
137147

138-
Tools:
148+
Recommended tools:
139149

140150
- [JSON Schema](https://github.com/MaaXYZ/MaaFramework/blob/main/tools/pipeline.schema.json)
141151
- [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=nekosu.maa-support)
142152
- Config resources based on `interface.json`
143153
- Support going to task definition, finding task references, renaming task, completing task, click to launch task
144154
- Support launching as MaaPiCli
145155
- Support screencap and crop image after connected
156+
- [MaaPipelineEditor](https://github.com/kqcoxn/MaaPipelineEditor)
157+
- No-code visual editor; supports drag-and-drop nodes and JSON import/export
146158

147159
### Image Files
148160

149161
The files in `my_resource/image` are primarily used for template matching images, feature detection images, and other images required by the pipeline. They are read based on the `template` and other fields specified in the pipeline.
150162

151-
Please note that the images used need to be cropped from the lossless original image and scaled to 720p. **UNLESS YOU EXACTLY KNOW HOW MAAFRAMEWORK PROCESSES, DO USE THE CROPPING TOOLS BELOW TO OBTAIN IMAGES.**
163+
Use lossless source images scaled to 720p before cropping. Unless you're very familiar with MaaFramework's processing, use the capture tools below to obtain images.
152164

153165
- [Image Cropping and ROI Extraction Tool](https://github.com/MaaXYZ/MaaFramework/tree/main/tools/ImageCropper)
154166
- [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=nekosu.maa-support)
@@ -160,38 +172,50 @@ Please note that the images used need to be cropped from the lossless original i
160172

161173
The files in `my_resource/model/ocr` are ONNX models obtained from [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) after conversion.
162174

163-
You can use our pre-converted files: [MaaCommonAssets](https://github.com/MaaXYZ/MaaCommonAssets/tree/main/OCR). Choose the language you need and store them according to the directory structure mentioned above.
175+
You can use our pre-converted files: [MaaCommonAssets](https://github.com/MaaXYZ/MaaCommonAssets/tree/main/OCR). Choose the language you need and store them according to the [directory structure above](#file-structure-specification).
164176

165177
If needed, you can also fine-tune the official pre-trained models of PaddleOCR yourself (please refer to the official PaddleOCR documentation) and convert them to ONNX files for use. You can find conversion commands [here](https://github.com/MaaXYZ/MaaCommonAssets/tree/main/OCR#command).
166178

167179
## Debug
168180

169-
- Use [Development Tool](https://github.com/MaaXYZ/MaaFramework/blob/main/README_en.md#development-tool).
170-
- Some tools will generate `config/maa_option.json` file in the same directory, including:
181+
After you finish preparing resources, you can start debugging.
182+
183+
> [!NOTE]
184+
> If you choose full-code development, some tools in this section may not work; consider writing your own debug helpers instead.
171185
172-
- `logging`: Save the log and generate `debug/maa.log`. Default true.
173-
- `save_draw`: Saves the image recognition visualization results. All image recognition visualization results drawings during the run will be saved. Default false.
174-
- `stdout_level`: The console displays the log level. The default is 2 (Error), which can be set to 0 to turn off all console logs, or to 7 to turn on all console logs.
186+
[Development tools overview](https://github.com/MaaXYZ/MaaFramework/blob/main/README_en.md#development-tool)
175187

176-
- If you integrate it yourself, you can enable debugging options through the `Toolkit.init_option` / `MaaToolkitConfigInitOption` interface. The generated json file is the same as above.
188+
Most tools will generate a `config/maa_option.json` file in the same directory, including:
189+
190+
- `logging`: Save the log and generate `debug/maa.log`. Default true.
191+
- `save_draw`: Save visualized image-recognition results during runtime. Default false.
192+
- `stdout_level`: Console log level. Default 2 (Error); set 0 to silence logs, or 7 to show all logs.
193+
- `save_on_error`: Save the current screenshot when a task fails. Default true.
194+
195+
If you integrate it yourself, you can enable debugging options through the `Toolkit.init_option` / `MaaToolkitConfigInitOption` interface. The generated json file is the same as above.
177196

178197
## Run
179198

180-
You can using Generic UI (MaaPiCli, MFA, MFW, etc) or by writing integration code yourself.
199+
> [!NOTE]
200+
> If you choose full-code development, the UI apps in this chapter may not work; consider writing your own interaction UI.
181201
182-
### Using MaaPiCli
202+
[General UI overview](https://github.com/MaaXYZ/MaaFramework/tree/main?tab=readme-ov-file#%E9%80%9A%E7%94%A8-ui)
183203

184-
*⭐If you use the boilerplate, follow its documentation directly and run `install.py` to automatically package the relevant files.*
204+
We define a [ProjectInterface protocol](3.3-ProjectInterfaceV2.md) to describe the resource files and runtime configuration so General UI can correctly load and run your project.
185205

186-
Use MaaPiCli in the `bin` folder of the Release package, and write `interface.json` and place it in the same directory to use it.
206+
*In short, write an `interface.json` to tell the General UI where your resources are and which tasks can be executed, so it can run for you.*
187207

188-
- [interface.json documentation](3.2-ProjectInterface.md)
189-
- [Sample](https://github.com/MaaXYZ/MaaFramework/blob/main/sample/interface.json)
208+
- [interface.json docs](3.3-ProjectInterfaceV2.md)
209+
- [Example](https://github.com/MaaXYZ/MaaFramework/blob/main/sample/interface.json)
190210

191-
Examples:
211+
Best-practice references:
192212

193213
- [M9A](https://github.com/MaaXYZ/M9A/tree/main/assets/interface.json)
194214

195-
### Writing Integration Code Yourself
215+
## Full-Code Development
216+
217+
Please refer to the [Integration Documentation](2.1-Integration.md) and the [Integrated Interface Overview](2.2-IntegratedInterfaceOverview.md).
218+
219+
## Communication
196220

197-
Please refer to the [Integration Documentation](2.1-Integration.md).
221+
Developers are welcome to join the official QQ group (595990173) for integration and development discussions. The group is reserved for engineering topics; product-usage support is not provided, and off-topic or spam accounts may be removed to keep the channel focused.

docs/en_us/4.1-BuildGuide.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,35 @@
33
> [!TIP]
44
> _You only need to read this chapter if you are ready to develop MaaFramework itself. If you only want to develop applications based on MaaFramework, please refer to [Quick Started](1.1-QuickStarted.md)._
55
6+
Before you start, ensure Git, Python 3, and CMake 3.24+ are installed, along with the toolchain for your platform (Windows: MSVC 2022; Linux/macOS: Ninja + g++/clang).
7+
68
## Local Development
79

8-
1. Download MaaDeps prebuilt
10+
1. Clone the repo with all submodules (recommended)
11+
12+
Submodules contain third-party dependencies and must be initialized before building. You can re-run this step anytime to keep them in sync.
13+
14+
```sh
15+
git clone --recurse-submodules https://github.com/MaaXYZ/MaaFramework.git
16+
```
17+
18+
or
19+
20+
```sh
21+
git clone https://github.com/MaaXYZ/MaaFramework.git
22+
cd MaaFramework
23+
git submodule update --init --recursive
24+
```
25+
26+
2. Download prebuilt MaaDeps
927

1028
```sh
1129
python3 tools/maadeps-download.py
1230
```
1331

14-
2. Configure cmake
32+
The script downloads and verifies the prebuilt dependencies. If the network is unstable, simply rerun it.
33+
34+
3. Configure CMake preset
1535

1636
- Windows
1737

@@ -25,14 +45,14 @@
2545
cmake --preset "NinjaMulti"
2646
```
2747

28-
3. Build the project using cmake
48+
4. Build and install
2949

3050
```bash
3151
cmake --build build --config Release
3252
cmake --install build --prefix install
3353
```
3454

35-
The generated binaries and related files are located in the `install` directory.
55+
Switch `--config` to `Debug`/`RelWithDebInfo` as needed. Binaries and related files are placed in the `install` directory by default.
3656

3757
For more details, refer to [Build CI](https://github.com/MaaXYZ/MaaFramework/blob/main/.github/workflows/build.yml).
3858

0 commit comments

Comments
 (0)