大漠的FindStrFast 对于我们找字来说非常的方便,由于参数较多,我们可以简单在按键精灵中封装一下。
封装
//-----------------------找字----------------------// Sub 找字(zbf, name, pianse) x1 = split(zbf, ",")(0) : y1 = split(zbf, ",")(1) : x2 = split(zbf, ",")(2) : y2 = split(zbf, ",")(3) dm_ret = dm.FindStrFast(x1,y1,x2,y2,name,pianse,1.0, tpX, tpY) If tpX >= 0 and tpY >= 0 Then tuzhi = 1 Else tuzhi = - 1 End If Delay 500 End Sub
说明
1、zbf,坐标范围的字符串
2、name,字库中的字符串
3、pianse,字的偏色范围
4、tpX、tpY返回的坐标
5、找见返回tuzhi=1,负责tuzhi=-1,为以后调用判断使用
应用举例
name ="剑侠" pianse = "cae6ab-000000" zbf= "251,201,278,220," Call 找字(zbf,name,pianse) If tuzhi = 1 Then Delay500 dm.MoveTo tpX + 30, tpY Delay 500 dm.LeftClick Exit Do Else Delay 1000 End If