forked from feifadaima/AutoJs-Docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocumentation.json
More file actions
313 lines (313 loc) · 14.6 KB
/
documentation.json
File metadata and controls
313 lines (313 loc) · 14.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
{
"source": "..\\api\\documentation.md",
"methods": [
{
"textRaw": "input([i, ]text)",
"type": "method",
"name": "input",
"signatures": [
{
"params": [
{
"textRaw": "`i` {number} 表示要输入的为第i + 1个输入框 ",
"name": "i",
"type": "number",
"desc": "表示要输入的为第i + 1个输入框",
"optional": true
},
{
"textRaw": "`text` {string} 要输入的文本 ",
"name": "text",
"type": "string",
"desc": "要输入的文本"
}
]
},
{
"params": [
{
"name": "i",
"optional": true
},
{
"name": "text"
}
]
}
],
"desc": "<p>input表示函数名,括号内的<code>[i, ]text</code>为函数的参数。下面是参数列表,"number"表示参数i的类型为数值,"string"表示参数text的类型为字符串。</p>\n<p>例如input(1, "啦啦啦"),执行这个语句会在屏幕上的第2个输入框处输入"啦啦啦"。</p>\n<p>方括号[ ]表示参数为可选参数。也就是说,可以省略i直接调用input。例如input("嘿嘿嘿"),按照文档,这个语句会在屏幕上所有输入框输入"嘿嘿嘿"。</p>\n<p>调用有可选参数的函数时请不要写上方括号。</p>\n<p>我们再看第二个例子。图片和图色处理中detectsColor函数的部分说明。</p>\n"
},
{
"textRaw": "images.detectsColor(image, color, x, y[, threshold = 16, algorithm = \"diff\"])",
"type": "method",
"name": "detectsColor",
"signatures": [
{
"params": [
{
"textRaw": "`image` {Image} 图片 ",
"name": "image",
"type": "Image",
"desc": "图片"
},
{
"textRaw": "`color` {number} | {string} 要检测的颜色 ",
"name": "color",
"type": "number",
"desc": "| {string} 要检测的颜色"
},
{
"textRaw": "`x` {number} 要检测的位置横坐标 ",
"name": "x",
"type": "number",
"desc": "要检测的位置横坐标"
},
{
"textRaw": "`y` {number} 要检测的位置纵坐标 ",
"name": "y",
"type": "number",
"desc": "要检测的位置纵坐标"
},
{
"textRaw": "`threshold` {number} 颜色相似度临界值,默认为16。取值范围为0~255。 ",
"name": "threshold",
"type": "number",
"desc": "颜色相似度临界值,默认为16。取值范围为0~255。",
"optional": true,
"default": " 16"
},
{
"textRaw": "`algorithm` {string} 颜色匹配算法,包括: ",
"options": [
{
"textRaw": "\"equal\": 相等匹配,只有与给定颜色color完全相等时才匹配。 ",
"name": "equal",
"desc": "相等匹配,只有与给定颜色color完全相等时才匹配。"
},
{
"textRaw": "\"diff\": 差值匹配。与给定颜色的R、G、B差的绝对值之和小于threshold时匹配。 ",
"name": "diff",
"desc": "差值匹配。与给定颜色的R、G、B差的绝对值之和小于threshold时匹配。"
},
{
"textRaw": "\"rgb\": rgb欧拉距离相似度。与给定颜色color的rgb欧拉距离小于等于threshold时匹配。 ",
"name": "rgb",
"desc": "rgb欧拉距离相似度。与给定颜色color的rgb欧拉距离小于等于threshold时匹配。"
},
{
"textRaw": "\"rgb+\": 加权rgb欧拉距离匹配([LAB Delta E](https://en.wikipedia.org/wiki/Color_difference))。 ",
"name": "rgb+",
"desc": "加权rgb欧拉距离匹配([LAB Delta E](https://en.wikipedia.org/wiki/Color_difference))。"
},
{
"textRaw": "\"hs\": hs欧拉距离匹配。hs为HSV空间的色调值。 ",
"name": "hs",
"desc": "hs欧拉距离匹配。hs为HSV空间的色调值。"
}
],
"name": "algorithm",
"type": "string",
"desc": "颜色匹配算法,包括:",
"optional": true,
"default": " \"diff\""
}
]
},
{
"params": [
{
"name": "image"
},
{
"name": "color"
},
{
"name": "x"
},
{
"name": "y"
},
{
"name": "threshold ",
"optional": true,
"default": " 16"
},
{
"name": "algorithm ",
"optional": true,
"default": " \"diff\""
}
]
}
],
"desc": "<p>同样地,<code>[, threshold = 16, algorithm = "rgb"]</code>为可选参数,并且,等于号=后面的值为参数的默认值。也就是如果不指定该参数,则该参数将会为这个值。</p>\n<p>例如 <code>images.detectsColor(captureScreen(), "#112233", 100, 200)</code> 相当于 <code>images.detectsColor(captureScreen(), "#112233", 100, 200, 16, "rgb")</code>,\n而<code>images.detectsColor(captureScreen(), "#112233", 100, 200, 64)</code> 相当于<code>images.detectsColor(captureScreen(), "#112233", 100, 200, 64, "rgb")</code>。</p>\n<p>调用有可选参数及默认值的函数时请不要写上方括号和等于号。</p>\n"
}
],
"miscs": [
{
"textRaw": "关于本文档",
"name": "关于本文档",
"type": "misc",
"desc": "<p>本文档为Auto.js的文档,解释了Auto.js各个模块的API的使用方法、作用和例子。</p>\n<p>文档借助Node.js的文档构建工具生成,并在github上开源(<a href=\"https://github.com/hyb1996/AutoJs-Docs\">https://github.com/hyb1996/AutoJs-Docs</a> ),目前由开发者维护。</p>\n",
"miscs": [
{
"textRaw": "API稳定性",
"name": "api稳定性",
"desc": "<p>由于Auto.js处于活跃的更新和开发状态,API可能随时有变动,我们用Stability来标记模块、函数的稳定性。这些标记包括:</p>\n<pre><code class=\"lang-txt\">Stability: 0 - Deprecated\n\n弃用的函数、模块或特性,在未来的更新中将很快会被移除或更改。应该在脚本中移除对这些函数的使用,以免后续出现意料之外的问题。\n</code></pre>\n<pre><code class=\"lang-txt\">Stability: 1 - Experimental\n\n实验性的函数、模块或特性,在未来的更新中可能会更改或移除。应该谨慎使用这些函数或模块,或者仅用作临时或试验用途。\n</code></pre>\n<pre><code class=\"lang-txt\">Stability: 2 - Stable\n\n稳定的函数、模块或特性,在未来的更新中这些模块已有的函数一般不会被更改,会保证后向兼容性。\n</code></pre>\n",
"type": "misc",
"displayName": "API稳定性"
},
{
"textRaw": "如何阅读本文档",
"name": "如何阅读本文档",
"desc": "<p>先看一个例子,下面是<a href=\"coordinates-based-automation.html\">基于控件的操作模拟</a>的章节中input函数的部分说明。</p>\n",
"type": "misc",
"displayName": "如何阅读本文档"
}
],
"methods": [
{
"textRaw": "input([i, ]text)",
"type": "method",
"name": "input",
"signatures": [
{
"params": [
{
"textRaw": "`i` {number} 表示要输入的为第i + 1个输入框 ",
"name": "i",
"type": "number",
"desc": "表示要输入的为第i + 1个输入框",
"optional": true
},
{
"textRaw": "`text` {string} 要输入的文本 ",
"name": "text",
"type": "string",
"desc": "要输入的文本"
}
]
},
{
"params": [
{
"name": "i",
"optional": true
},
{
"name": "text"
}
]
}
],
"desc": "<p>input表示函数名,括号内的<code>[i, ]text</code>为函数的参数。下面是参数列表,"number"表示参数i的类型为数值,"string"表示参数text的类型为字符串。</p>\n<p>例如input(1, "啦啦啦"),执行这个语句会在屏幕上的第2个输入框处输入"啦啦啦"。</p>\n<p>方括号[ ]表示参数为可选参数。也就是说,可以省略i直接调用input。例如input("嘿嘿嘿"),按照文档,这个语句会在屏幕上所有输入框输入"嘿嘿嘿"。</p>\n<p>调用有可选参数的函数时请不要写上方括号。</p>\n<p>我们再看第二个例子。图片和图色处理中detectsColor函数的部分说明。</p>\n"
},
{
"textRaw": "images.detectsColor(image, color, x, y[, threshold = 16, algorithm = \"diff\"])",
"type": "method",
"name": "detectsColor",
"signatures": [
{
"params": [
{
"textRaw": "`image` {Image} 图片 ",
"name": "image",
"type": "Image",
"desc": "图片"
},
{
"textRaw": "`color` {number} | {string} 要检测的颜色 ",
"name": "color",
"type": "number",
"desc": "| {string} 要检测的颜色"
},
{
"textRaw": "`x` {number} 要检测的位置横坐标 ",
"name": "x",
"type": "number",
"desc": "要检测的位置横坐标"
},
{
"textRaw": "`y` {number} 要检测的位置纵坐标 ",
"name": "y",
"type": "number",
"desc": "要检测的位置纵坐标"
},
{
"textRaw": "`threshold` {number} 颜色相似度临界值,默认为16。取值范围为0~255。 ",
"name": "threshold",
"type": "number",
"desc": "颜色相似度临界值,默认为16。取值范围为0~255。",
"optional": true,
"default": " 16"
},
{
"textRaw": "`algorithm` {string} 颜色匹配算法,包括: ",
"options": [
{
"textRaw": "\"equal\": 相等匹配,只有与给定颜色color完全相等时才匹配。 ",
"name": "equal",
"desc": "相等匹配,只有与给定颜色color完全相等时才匹配。"
},
{
"textRaw": "\"diff\": 差值匹配。与给定颜色的R、G、B差的绝对值之和小于threshold时匹配。 ",
"name": "diff",
"desc": "差值匹配。与给定颜色的R、G、B差的绝对值之和小于threshold时匹配。"
},
{
"textRaw": "\"rgb\": rgb欧拉距离相似度。与给定颜色color的rgb欧拉距离小于等于threshold时匹配。 ",
"name": "rgb",
"desc": "rgb欧拉距离相似度。与给定颜色color的rgb欧拉距离小于等于threshold时匹配。"
},
{
"textRaw": "\"rgb+\": 加权rgb欧拉距离匹配([LAB Delta E](https://en.wikipedia.org/wiki/Color_difference))。 ",
"name": "rgb+",
"desc": "加权rgb欧拉距离匹配([LAB Delta E](https://en.wikipedia.org/wiki/Color_difference))。"
},
{
"textRaw": "\"hs\": hs欧拉距离匹配。hs为HSV空间的色调值。 ",
"name": "hs",
"desc": "hs欧拉距离匹配。hs为HSV空间的色调值。"
}
],
"name": "algorithm",
"type": "string",
"desc": "颜色匹配算法,包括:",
"optional": true,
"default": " \"diff\""
}
]
},
{
"params": [
{
"name": "image"
},
{
"name": "color"
},
{
"name": "x"
},
{
"name": "y"
},
{
"name": "threshold ",
"optional": true,
"default": " 16"
},
{
"name": "algorithm ",
"optional": true,
"default": " \"diff\""
}
]
}
],
"desc": "<p>同样地,<code>[, threshold = 16, algorithm = "rgb"]</code>为可选参数,并且,等于号=后面的值为参数的默认值。也就是如果不指定该参数,则该参数将会为这个值。</p>\n<p>例如 <code>images.detectsColor(captureScreen(), "#112233", 100, 200)</code> 相当于 <code>images.detectsColor(captureScreen(), "#112233", 100, 200, 16, "rgb")</code>,\n而<code>images.detectsColor(captureScreen(), "#112233", 100, 200, 64)</code> 相当于<code>images.detectsColor(captureScreen(), "#112233", 100, 200, 64, "rgb")</code>。</p>\n<p>调用有可选参数及默认值的函数时请不要写上方括号和等于号。</p>\n"
}
]
}
]
}