按键精灵的循环

来源:百度知道 编辑:UC知道 时间:2024/05/20 06:16:37
VBS dim a,b.
//声明变量
VBSCall GetCursorPos(a,b)
//得到当前鼠标的坐标位置 并保存到变量x,y中
//VBSCall MessageBox("坐标为:x="+cstr(x)+" y="+cstr(y))
//弹出窗口 输出坐标的值
//VBSCall Call SetCursorPos(0,0)
dim t
t=Inputbox("请办理入延时时间:","时间")
dim addt
addt = 0
dim i

for(i=0,i++,i<100000,100000)
VBSCall MessageBox("坐标为:x="+cstr(a)+" y="+cstr(b))
VBSCall MessageBox("坐标为:x="+cstr(addt))
VBSCall Call SetCursorPos(a,b)
RightClick 1
Delay t
addt = addt + t
VBSCall FindPic(0,0,1280,800,"d:\start.bmp",0.9,intX,intY)
If intX>0 and intY>0 then
MoveTo intX+25,intY+8
LeftClick 1
EndIf
If addt > 7000 then
MoveTo 628,606
KeyPress 81,1
RightClick 1
EndFor

//我想让程序在FOR endfor循环,但是,发现这个就是总体的循环,请问如何修改?谢谢,是按键精灵的程序。

for(i=0,i++,i<100000,100000)
这个循环的写法我没有看明白!你是要循环100000次,就直接写for 100000 就行了,如果你是想用变量i来控制循环,那你的循环体里面也没有对i的操作,也是起不到控制效果!如果要用变量来控制,建议你用if i<100000 。。。i=i+1...endif! 反正你这句循环命令的写法应该是错的了!
If addt > 7000 then
MoveTo 628,606
KeyPress 81,1
RightClick 1
EndFor

EndFor前面少了个endif,这里也会是导致执行不正确的原因之一!