docs: tweaked english tasks json schema

This commit is contained in:
David
2023-08-22 18:41:24 +02:00
parent cbe6bbbf28
commit 6d2b62bde9
2 changed files with 29 additions and 29 deletions

View File

@@ -106,7 +106,7 @@
"type": "string",
"description": "要执行的任务"
},
"description": "可选项,执行后减少其他任务的执行计数。\n可选项执行后减少其他任务的执行计数。"
"description": "可选项,执行后减少其他任务的执行计数。"
},
"specificRect": {
"$ref": "#/definitions/Rectangle",

View File

@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "maa task config",
"title": "maa task config english",
"patternProperties": {
"^(?!\\$)": {
"type": "object",
@@ -39,82 +39,82 @@
"type": "array",
"items": {
"type": "string",
"description": "tasks to be performed"
"description": "Task to be performed"
}
},
"BaseTask": {
"properties": {
"algorithm": {
"type": "string",
"description": "algorithm type"
"description": "Algorithm type"
},
"action": {
"type": "string",
"pattern": "ClickSelf|ClickRand|DoNothing|Stop|ClickRect|Swipe",
"default": "DoNothing",
"description": "Optional, indicating the action after recognition\nIf not filled in, the default is DoNothing"
"description": "Optional, indicates the action to be taken after recognition\nDefaults to DoNothing when not filled in"
},
"sub": {
"$ref": "#/definitions/TaskNameList",
"description": "Optional, subtasks. After the current task is executed, each subtask will be executed in turn\nYou can nest dolls, and subtasks can be nested with subtasks. But be careful not to write an infinite loop"
"description": "Optional, subtask. Will execute each subtask in turn after executing the current task\nIt is possible to nest the sub-tasks, sub-tasks can be nested with sub-tasks. But be careful not to write a dead loop"
},
"subErrorIgnored": {
"type": "boolean",
"default": false,
"description": "Optional, whether to ignore errors from subtasks. The default is false\nWhen it is false, if a subtask fails, the follow-up task will not continue (equivalent to an error in this task)\nWhen it is true, it does not matter whether the subtask fails or not"
"description": "Optional, whether or not to ignore errors from sub-tasks. Default is false\nWIf false, if a subtask fails, the execution of the subsequent tasks will not be continued (which is equivalent to an error in this task)\nIf true, it has no effect on whether a subtask has an error or not"
},
"next": {
"$ref": "#/definitions/TaskNameList",
"description": "Optional, which means that after the current task is executed, the next task\n will be identified from the front to the back, and the first matching one will be executed.\n If not filled in, the current task will be executed by default and stop directly"
"description": "Optional, indicates the next task to be executed after the current task\nIt will be identified from front to back, and the first matching task will be executed\n If not filled in, the current task will be stopped by default"
},
"maxTimes": {
"type": "number",
"description": "Optional, indicating the maximum execution times of the task\nIf not filled in, the default is infinite\nAfter reaching the maximum number of times, if there is exceededNext field, execute exceededNext; otherwise, the task will stop directly"
"description": "Optional, indicates the maximum number of times the task can be executed\nDefault is infinite, if not filled in\nAfter reaching the maximum number of times, if there is exceededNext field, execute exceededNext; otherwise, the task will be stopped directly"
},
"exceededNext": {
"$ref": "#/definitions/TaskNameList",
"description": "Optional, indicating the task to be executed after reaching the maximum number of executions\nIf not filled in, it will stop when the maximum number of executions is reached; after filling in, it will execute here, not in next"
"description": "Optional, indicates the task to be executed after reaching the maximum number of executions\nIf not filled in, it will stop when it reaches the maximum number of executions; If filled in, it will execute the tasks here, not the ones in next"
},
"onErrorNext": {
"$ref": "#/definitions/TaskNameList",
"description": "Optional, indicating the subsequent tasks to be executed when an error occurs"
"description": "Optional, indicates the subsequent tasks to be executed in the event of an execution error"
},
"preDelay": {
"type": "number",
"description": "Optional, indicating how long the action will be delayed after recognition, in milliseconds; if not filled in, the default is 0"
"description": "Optional, indicates how long the action will be delayed after recognition, in milliseconds; default is 0, if not filled in"
},
"postDelay": {
"type": "number",
"description": "Optional, indicating how long the action will be delayed before recognizing next, in milliseconds; if not filled in, the default is 0"
"description": "Optional, indicates how long the action will be delayed before recognising next, in milliseconds; default is 0, if not filled in"
},
"roi": {
"$ref": "#/definitions/Rectangle",
"description": "Optional, indicating the range of recognition, the format is [ x, y, width, height ]\nAutomatic scaling based on 1280 * 720; default [0, 0, 1280, 720 ]\nFill in as much as possible to reduce The recognition range can reduce performance consumption and speed up recognition"
"description": "Optional, indicates the recognition range, the format is [x, y, width, height]\nAutomatic scaling based on 1280 * 720; default [0, 0, 1280, 720]\nFill in as much as possible to reduce the recognition range. This can reduce performance consumption and speed up recognition"
},
"cache": {
"type": "boolean",
"default": true,
"description": "Optional, indicating whether the task uses the cache, the default is true;\nAfter the first recognition, it will always be recognized only at the first recognition position in the future, enabling it can greatly save performance\nBut it is only applicable to pending recognition For tasks where the target position will not change at all, if the target position to be recognized will change, please set it to false"
"description": "Optional, indicates whether the task uses caching, default is true;\nAfter the first recognition, the subsequent recognition will always be carried out only in the location of the first recognition, enabling this can greatly save performance\nBut it is only appliable for tasks where the target position will not change at all, if the target position to be recognised will change, please set it to false"
},
"rectMove": {
"$ref": "#/definitions/Rectangle",
"description": "Optional, the movement of the target after recognition, it is not recommended to use this option. Automatic scaling based on 1280 * 720\nFor example, if the A icon is recognized, but the actual location to be clicked is a position next to the A icon, move it and then click. If possible, try to directly identify the position to be clicked, this option is not recommended\nWhen the action is Swipe, it means the end of the swipe"
"description": "Optional, movethe target after recognition, this option is not recommended. Automatic scaling based on 1280 * 720\nFor example, if an A icon is recognised, but the actual location to be clicked is a position next to the A icon, then move it and click it. If possible, try to recognise the position to be clicked directly, this option is not recommended\nWhen the action is Swipe, it means the end of the swipe"
},
"reduceOtherTimes": {
"type": "array",
"items": {
"type": "string",
"description": "tasks to be performed"
"description": "Task to be performed"
},
"description": "Optionally, decrements the execution count of other tasks after execution. \nOptional, decrements execution counts of other tasks after execution."
"description": "Optional, decrements the execution count of other tasks after execution"
},
"specificRect": {
"$ref": "#/definitions/Rectangle",
"description": "It is valid and mandatory when the action is ClickRect, indicating the specified click position (a random point within the range), and automatically scaled based on 1280 * 720\nIt is valid and mandatory when the action is Swipe, indicating the starting point of sliding"
"description": "Valid and mandatory when the action is ClickRect, indicates the specified click position (a random point within the range), auto-scaling based on 1280 * 720\nValid and mandatory when the action is Swipe, indicates the starting point of the swipe"
},
"specialParams": {
"$ref": "#/definitions/ParamsArray",
"description": "Special parameters used by some tasks (mostly handwritten thresholds etc.)"
"description": "Special parameters used for certain tasks (mostly handwritten thresholds, etc.)"
}
}
},
@@ -130,7 +130,7 @@
"pattern": "JustReturn"
}
},
"description": "Do not identify, execute directly action",
"description": "Execute the action without identifying it",
"required": [
"algorithm"
]
@@ -149,12 +149,12 @@
"template": {
"type": "string",
"default": "",
"description": "Optional, the file name of the picture to be matched\nIf not filled, write the default \"task name.png\""
"description": "Optional, the file name of the image to be matched\nDefauts to \"task name.png\", If not filled"
},
"templThreshold": {
"type": "number",
"default": 0.8,
"description": "Optional, the threshold of the image template matching score, which is considered to be recognized if it exceeds the threshold. \nThe default is 0.8, you can check the actual score according to the log"
"description": "Optional, the threshold of the matching score of the template image, it is considered recognised if it exceeds the threshold\nDefaults to 0.8, you can check what the actual score is based on the log"
},
"maskRange": {
"type": "array",
@@ -167,10 +167,10 @@
1,
255
],
"description": "Optional, grayscale mask range. For example, paint the part of the picture that does not need to be recognized black (the gray value is 0), and then set [ 1, 255 ], and ignore the blacked part immediately when matching"
"description": "Optional, grey scale mask range. For example, paint the part of the image that does not need to be recognised as black (grey value is 0), and then set [1, 255], the blackened part will be ignored when matching"
}
},
"description": "match picture"
"description": "Match image"
},
"OcrDetectTask": {
"allOf": [
@@ -188,12 +188,12 @@
"items": {
"type": "string"
},
"description": "Mandatory item, the text content to be recognized, as long as any match is found, it is considered to be recognized"
"description": "Mandatory, the text content to be recognised, as long as any one of them matches, it is considered to have been recognised"
},
"fullMatch": {
"type": "boolean",
"default": false,
"description": "Optional, whether text recognition needs whole-word matching (cannot be more than one word), the default is false\nfalse, as long as it is a substring: for example, text: [ \"Start\" ], when \"Start action\" is actually recognized, It is also regarded as a successful recognition; when \ntrue, it must recognize \"begin\", and one more word will not work"
"description": "Optional, whether the text recognition needs to match all the words (can't match more than one word), the default is false\nfalse, as long as a substring can be found: for example, text: [\"Start\"], the actual recognition of \"Start action\" is also considered successful;\ntrue, it must recognise \"Start\", not one word more"
},
"ocrReplace": {
"type": "array",
@@ -205,10 +205,10 @@
"type": "string"
}
},
"description": "Optional, to replace commonly misrecognized text (regular support)"
"description": "Optional, replacement of commonly misrecognised text (supports regex)"
}
},
"description": "text recognition",
"description": "Text recognition",
"required": [
"algorithm",
"text"