Skip to content

Latest commit

 

History

History
166 lines (122 loc) · 5.16 KB

README-en.md

File metadata and controls

166 lines (122 loc) · 5.16 KB

MFW-PyQt6

Simplified Chinese | English

A general-purpose GUI project for MAAFramework based on PyQT6

Development Environment

  • Python 3.12

Usage

Direct Use

  • pip install -r requirements.txt
  • python main.py

Using GitHub Actions for Automatic Building

  • Modify the project name and project address in depoly\deploy.py to your project name and project address, and upload it to the GitHub repository root directory
  • Modify MaaXXX in deploy\install.yml to your project name and upload it to the .github/workflows directory of the GitHub repository
  • Push a new version

Feature Description

Multi-Configuration Startup

  • Click the add button for resources in the scheduled task interface to add resources
  • Each resource can have multiple configurations, independent of each other
  • The operation after completion can choose to start a certain configuration file in other resources
  • Combined with the task executed after startup, seamless startup of multiple resources can be achieved

Parameter Startup

  • The -r parameter can accept the resource name, for example python main.py -r resource1 or MFW.exe -r resource1
  • The -c parameter can accept the configuration file name, for example python main.py -c config1 or MFW.exe -c config1

External Notifications

  • Currently supports four notification methods: DingTalk, Feishu, SMTP, and WxPusher

Resource Update

  • If the update address is filled in when adding a resource, one-click update can be performed

Dynamic Loading of Custom Actions/Recognizers

  • What is a Custom Action/Recognizer
  • Requires custom actions/recognizers to use Python 3.12
  • If the custom action/recognizer contains third-party libraries, the third-party libraries need to be installed in _internal (Windows and macOS) or the MFW-PyQt6 root directory (Linux)
  • Name and place the custom action/recognizer files as required
  • Required structure: Here is an example
Project Folder/custom/
├── action/
│   ├── Action1
│   │    └── main.py
│   └── Action2
│        └── main.py
└── Recognition/
    ├── Recognizer1
    │    └── main.py
    └── Recognizer2
         └── main.py
  • Among them, Action1, Action2, Recognizer1, Recognizer2 are the names used in the pipeline, for example
### Custom Program Configuration

- Create `./config/custom.json`.
- The content should be:

```json
"my_custom_task": {
        "recognition": "Custom",
        "custom_recognition": "Recognizer1",
        "action": "Custom",
        "custom_action": "Action1"
    }
  • The object name in main.py is required to be the same as the folder name, for example
  class Recognizer1(CustomRecognition):
    def analyze(context, ...):
        # Get the image, then perform your own image operations
        image = context.tasker.controller.cached_image
        # Return the image analysis result
        return AnalyzeResult(box=(10, 10, 100, 100))

Custom Program Configuration

  • Create ./config/custom.json.
  • The content should be:
{
    "option1": {
        "optionname": "option1",
        "optiontype": "switch",
        "optioncontent": false,
        "text": {
            "title": "Switch",
            "content": "This is a switch"
        }
    },
    "option2": {
        "optionname": "option2",
        "optiontype": "combox",
        "optioncontent": [
            "content1",
            "content2",
            "content3"
        ],
        "text": {
            "title": "Combobox",
            "content": "This is a combobox"
        }
    },
    "option3": {
        "optionname": "option3",
        "optiontype": "lineedit",
        "optioncontent": "content3",
        "text": {
            "title": "Lineedit",
            "content": "This is a lineedit"
        }
    }
}
  • The processed data will be saved to ./config/custom_config.json for custom programs to read.

License

PyQt-MAA is licensed under GPL-3.0 License.

Acknowledgments

Open Source Libraries

  • PyQt-Fluent-Widgets
    A fluent design widgets library based on C++ Qt/PyQt/PySide. Make Qt Great Again.
  • MaaFramework
    An automation black-box testing framework based on image recognition

Developers

Thanks to the following developers for their contributions to PyQt-MAA.

Contributors to MFW-PyQt6