用户遇见情况:
- 抓抓只能捕获10个坐标的特征
- 手动太浪费时间
- 减少图片带来的内存溢出
多点找色特征串解析:
- 取点445,275颜色1FC5F4偏色050505
- 取点301,242颜色D97700偏色050505
- 抓抓生成的特征:"1FC5F4-050505","-144|-33|D97700-050505"
结论:第一坐标无需体现在生成特征
第二坐标开始-144是因为第二坐标x301-第一坐标x445=-144,y同理,并采用|间隔
1FC5F4-050505、D97700-050505即坐标获取的颜色+对应的偏色数
代码一览:Dim 获取特征= 取多点特征(431,246,433, 248,"101010")
TracePrint 获取特征["参数1"],获取特征["参数2"]
TracePrint "*={"&获取特征["参数1"]&","&获取特征["参数2"]&"}"'直接复制出来*改成你要的变量名称
Dim intX,intY'测试下
FindMultiColor 0,0,0,0,"25AFC7-101010",获取特征["参数2"],0,0.9,intX,intY
If intX > -1 And intY > -1 Then
TracePrint intX
TracePrint intY
End If
Function 取多点特征(x1, y1, x2, y2,偏色)
Dim rColor,结果1,结果2
For y=y1 To y2
For x = x1 To x2
rColor = GetPixelColor(x, y)
If x = x1 and y = y1 Then
//TracePrint rColor
结果1 =结果1& Chr(34) & rColor &"-"&偏色& Chr(34)
Else
结果2 =结果2 &x-x1&"|"&y-y1&"|"&rColor&"-"&偏色&","
End If
Delay 50
Next
Next
//TracePrint 结果
取多点特征={"参数1":结果1,"参数2":chr(34)&Mid(结果2,1,len(结果2)-1)&chr(34)}
End Function
代码演化:Dim 获取特征= 取多点特征(431,246,433, 248,"101010")
TracePrint 获取特征["参数1"],获取特征["参数2"]
TracePrint "Dim *={"&获取特征["参数1"]&","&获取特征["参数2"]&"}"'直接复制出来*改成你要的变量名称
Dim 雷电图标={"25AFC7-101010","1|0|2AD1E1-101010,2|0|135F6C-101010,0|1|1C8897-101010,1|1|156A75-101010,2|1|020A0B-101010,0|2|166C82-101010,1|2|020E10-101010,2|2|010708-101010"}
TracePrint 多点找色(雷电图标,1)
Function 多点找色(特征,是否点击)
Dim intX,intY
FindMultiColor 0,0,0,0,"25AFC7-101010",获取特征["参数2"],0,0.9,intX,intY
If intX > -1 And intY > -1 Then
If 是否点击 = 1 Then
Tap intX,intY
End If
End If
End Function
Function 取多点特征(x1, y1, x2, y2,偏色)
Dim rColor,结果1,结果2
For y=y1 To y2
For x = x1 To x2
rColor = GetPixelColor(x, y)
If x = x1 and y = y1 Then
//TracePrint rColor
结果1 =结果1& Chr(34) & rColor &"-"&偏色& Chr(34)
Else
结果2 =结果2 &x-x1&"|"&y-y1&"|"&rColor&"-"&偏色&","
End If
Delay 50
Next
Next
//TracePrint 结果
取多点特征={"参数1":结果1,"参数2":chr(34)&Mid(结果2,1,len(结果2)-1)&chr(34)}
End Function