按键精灵代码执行

查看 39|回复 2
作者:dfdndz1   
首先找到图2,并点击图2,接着找图3,找到图3,再找图4,找到图4并点。    哪位大老帮忙看一下下面的代码,前面图2、图3都能执行,就是不去找图4,不知是哪里语法错误。
Dim intX, intY
Rem 开始找图
FindPic 0,0,1920,1080,"Attachment:\2.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
End If
TracePrint intX
TracePrint intY
If intX > 0 And intY > 0 Then
MoveTo intX+20,intY+20
LeftClick 1
Delay 100
Else
Delay 500
End If
FindPic 0,0,1920,1080,"Attachment:\3.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
End If
TracePrint intX
TracePrint intY
If intX > 0 And intY > 0 Then
MoveTo intX+20,intY+20
LeftClick 1
Delay 100
Goto 开始找图

Else
Delay 500
Goto 开始找图

End If
FindPic 0,0,1920,1080,"Attachment:\4.bmp",0.9,intX,intY
If intX > 0 And intY > 0 Then
End If
TracePrint intX
TracePrint intY
If intX > 0 And intY > 0 Then
MoveTo intX+20,intY+20
LeftClick 1
Delay 100
Else
Delay 500
End If

代码, 按键精灵

xhd7908491   

FindPic 0,0,1024,768,"Attachment:\2.bmp",0.9,X,Y"找图2
If X > 0 And Y > 0 Then "找到图2
MoveTo X, Y"鼠标移动到XY
Delay 100
LeftClick 1"单击2
Delay 5000"让它加载
FindPic 0,0,1024,768,"Attachment:\3.bmp",0.9,XX,YY"加载后找图3
If XX > 0 And YY > 0 Then
    MoveTo XX, YY"鼠标移动到XXYY
    Delay 100
    LeftClick 1"单击
    Delay 5000"让它加载
    FindPic 0,0,1024,768,"Attachment:\4.bmp",0.9,XXX,YYY
    If XXX > 0 And YYY > 0 Then
        MoveTo XXX, YYY"鼠标移动到XXYY
        Delay 100
        LeftClick 1"单击
    End If
   
   
End If
End If
xhd7908491   

下面是单击图3,单击图4,没备注好,难为情了
您需要登录后才可以回帖 登录 | 立即注册

返回顶部