按键精灵识图问题

来源:百度知道 编辑:UC知道 时间:2024/05/13 11:23:40
我搞了个脚本,用了找图,但当我所找的图片还没出现的时候,鼠标会一直在点,是哪里出了问题?麻烦高手们帮我分析分析!

VBSCall FindPic(436,199,483,243,"C:\Documents and Settings\Administrator\桌面\1.bmp",0.9,x,y)
VBSCall FindPic(436,199,483,243,"C:\Documents and Settings\Administrator\桌面\2.bmp",0.9,x,y)
If x>=0 and y>=0
MoveTo 459 212
EndIf
Delay 100
LeftClick 1
Delay 200
MoveTo 780,370
Delay 100
LeftClick 1
EndIf
VBSCall FindPic(436,199,483,243,"C:\Documents and Settings\Administrator\桌面\1.bmp",0.9,x,y)
VBSCall FindPic(436,199,483,243,"C:\Documents and Settings\Administrator\桌面\2.bmp",0.9,x,y)
If x>=0 and y>=0
MoveTo 459 212
EndIf
Delay 100
LeftClick 1
Delay 200
MoveTo 810,370
Delay 100
LeftClick 1

问问题要有诚意,至少要放个5分吧
If x>=0 and y>=0
MoveTo 459 212
EndIf
当图没找到时,鼠标是不会移到坐标459,212的,但是上面这段语句后面的语句还是会执行的,你应该加入一个循环语句或其他什么的

问问题要有诚意,至少要放个5分吧
同意楼上的

VBSCall FindPic(436,199,483,243,"C:\Documents and Settings\Administrator\桌面\1.bmp",0.9,x,y)

VBSCall FindPic(436,199,483,243,"C:\Documents and Settings\Administrator\桌面\2.bmp",0.9,x,y)

两个找图命令不能这样用

而且,这脚本是你自己做的吗?你没看按键里关于找图的说明吗?这整个都是错的!

还有你这程序逻辑也不对

总结,你上面那一堆的代码全错,只有坐标在重新做下一个脚本的时候还有点用,其他的,全错。删了吧

鉴定完毕!谢谢!