按键精灵启动脚本后没反应

ub dfsdfsd()
Rem 检测五号真
FindPic 0,0,1600,900,"Attachment:\5号行脚真.bmp",0.4,intX,intY
If intX > 0 And intY > 0 Then
KeyPress "Num 5", 1
EndScript
Else
Goto 检测五号假
End If
Rem 检测五号假
FindPic 450,242,537,339,"Attachment:\5号行脚假.bmp",0.6,intX,intY
If intX > 0 And intY > 0 Then
Goto 检测六号
Else
Goto 检测五号真
End If
Rem 检测六号
KeyPress "M", 1
Delay 300
FindPic 231,141,267,167,"Attachment:\6号行脚真.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
KeyPress "M", 1
KeyPress "Num 6", 1
EndScript
Else
Goto 检测六号假
End If
Rem 检测六号假
FindPic 231,141,267,167,"Attachment:\6号行脚假.bmp",0.7,intX,intY
If intX > 0 And intY > 0 Then
KeyPress "M", 1
Delay 300
Goto 检测1,4号
Else
Goto 检测五号真
End If
Rem 检测1,4号
FindPic 749,388,786,431,"Attachment:\14号行脚下.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
KeyPress "M", 1
Delay 300
Goto 确认1
Else
Goto 检测2,3
End If
Rem 检测2,3
FindPic 741,385,790,433,"Attachment:\23号行脚下.bmp",0.6,intX,intY
If intX > 0 And intY > 0 Then
KeyPress "M", 1
Delay 300
Goto 确认2
Else
Goto 检测1,4号
End If
Rem 确认1
FindPic 542,564,1566,597,"Attachment:\1号确认.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
KeyPress "M", 1
Delay 200
KeyPress "Num 1", 1
EndScript
Else
Goto 确认4
End If
Rem 确认4
FindPic 542,564,1566,597,"Attachment:\4号确认.bmp",1,intX,intY
If intX > 0 And intY > 0 Then
KeyPress "M", 1
Delay 200
KeyPress "Num 4", 1
EndScript
Else
Goto 确认1
End If
Rem 确认2
FindPic 533,584,554,597,"Attachment:\2号脚确认.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
KeyPress "M", 1
Delay 200
KeyPress "Num 2", 1
EndScript
Else
Goto 确认3
End If
Rem 确认3
FindPic 533,584,554,597,"Attachment:\3号确认.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
KeyPress "M", 1
Delay 200
KeyPress "Num 3", 1
EndScript
Else
Goto 确认2
End If
End Sub

脚本好乱,没看明白,但是goto语句用的太多了。goto语句能不用尽量不要用。
而且不能所有的坐标都赋值给intX,intY啊,这样不行的。你可以用intX(1),intY(1)这样的。
建议LZ把这些找图的都设置成子程序,然后遇到什么情况call什么子程序就好了。
另外也可以进行多线程同时找图。不过这个我没试过,不知道会不会卡。
希望能对您有帮助。追问

怎么弄子程序啊

追答

sub a
end sub
大概就是这样。
希望能对您有帮助

追问

吐血

追答

什么?

温馨提示:内容为网友见解,仅供参考
第1个回答  2012-08-09
你这个是个子程序,要加 call dfsdfsd() 。
相似回答
大家正在搜