按键精灵找色/找图/找字的图文操作步骤
时间:2022-10-26 17:19
当前不少网友表示自己才接触按键精灵这款应用,还不晓得怎样找色/找图/找字的操作,接下来就为你们分享按键精灵找色/找图/找字的图文教程,大家都来一起学习吧。
按键精灵找色/找图/找字的图文操作步骤
先讲下找色功能,在桌面上按下Print Screen键,截下整个桌面的截图

在桌面上按下Print Screen键,截下整个桌面的截图,再打开按键精灵新建脚本,进入抓点抓色功能,切换图像能看见刚才截的图

按下热键Ctrl+Alt+1添加点1,坐标和颜色代码分别为(53,103和6CF999)。注意:由于屏幕上的颜色有很多地方是一样的,所以尽量选择颜色独特的点

回到基本面板,找到颜色图形一栏,输入颜色代码(6CF999)。坐标就是屏幕分辨率,弱想要快速精确找色可以缩小查找范围(300,300)

那么电脑内部指令代码的关键变量为(intX,intY)
完整句段为:
FindColor 0,0,300,300,"6CF999",intX,intY
If intX > 0 And intY > 0 Then
(执行的命令)
End If

(执行的命令)有多种多样,以鼠标移动到某一点双击为例
代码为:
MoveTo 235, 648
LeftDoubleClick 1

记得加上延迟,能提高脚本运行效率
代码为:
Delay 1000(即为1秒)

完整句段代码:
Delay 1000
FindColor 0,0,300,300,"6CF999",intX,intY
If intX > 0 And intY > 0 Then
Delay 1000
MoveTo 235, 648
Delay 1000
LeftDoubleClick 1
Delay 1000
End If

点击调试,F10为测试热键

下面讲下找图功能

回到上一,发现刚刚截的图还在,点击鼠标拖动鼠标。图片另存为自己能找到的文件夹内,图片格式为BMP

执行代码示例:
FindPic 0,0,1024,768,"C:按键精灵2014�1.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
End If
(0.9这里意思为相似度,即90%的颜色一样即可视为触发条件)
(找到后鼠标停留的点为区域的左上角)

最后讲一下找字功能
当图片颜色背景不一样时,同样可以找到图片,找字只能适用于固定形状的图片,验证码的文字不固定所以找字无法实现。找字也属于找图的一种,当四个角为一样的颜色(系统默认为透明色)

先要先处理一下图片,按下Print Screen键截图,打开画图工具Ctrl+v黏贴

放大图片,按下Ctrl+G显示网络格,选定识别的文字 (注意:要留下4个角)

再新建画板,将画板尽量拉小,Ctrl+v粘贴

放大图片,将网络格子文字周围不一样的颜色统统改成一样的颜色

另存为02图片为BMP格式,更改代码,"C:按键精灵2014�2.bmp" (其他格式图片可能会不识别)

最后找到图片之后会发现鼠标点到了左上角,并没有点中
再次增加指令代码:
MoveR X, Y(X, Y,为任意移动范围)

上文就讲解了按键精灵找色/找图/找字的图文操作过程,希望有需要的朋友都来学习哦。