按键精灵吧 关注:499,600贴子:1,010,171
  • 5回复贴,共1

【求教】为什么脚本运行到子程序D就暂停了?图片没问题。

只看楼主收藏回复

Hwnd = Plugin.Window.Foreground()
Call Plugin.Window.Move(Hwnd, 0, 0)
Do
G="清除红包.BMP"
GG = Split(G,"|")
For I=0 TO UBound(GG)
FindPic 0,0,450,850,"Attachment:\"&GG(I),1,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX,intY
LeftClick 1
End If
Next
For i = 1 To 10
If i = 1 Then
Call chengxuA
ElseIf i = 2 Then
Call chengxuB
ElseIf i = 3 Then
Call chengxuC
ElseIf i = 4 Then
Call chengxuD
ElseIf i = 5 Then
Call chengxuE
ElseIf i = 6 Then
Call chengxuF
ElseIf i = 7 Then
Call chengxuG
ElseIf i = 8 Then
Call chengxuH
ElseIf i = 9 Then
Call chengxuI
ElseIf i = 10 Then
Call chengxuJ
End If
next
loop
Sub chengxuA
FindPic 0,0,450,850,"Attachment:\点通缉.BMP",1,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX,intY
LeftClick 1
Else
End If
End Sub
Sub chengxuB
G="进入标记.BMP|进入标记2.BMP"
GG = Split(G,"|")
For I=0 TO UBound(GG)
FindPic 0,0,450,850,"Attachment:\"&GG(I),1,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX,intY+15
LeftClick 1
End If
Next
End Sub
Sub chengxuC
G="追击2.BMP"
GG = Split(G,"|")
For I=0 TO UBound(GG)
FindPic 0,0,450,850,"Attachment:\"&GG(I),1,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX,intY
LeftClick 1
End If
Next
End Sub
Sub chengxuD
FindPic 0,0,450,850,"Attachment:\点门客.BMP",1,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX,intY
LeftClick 1
End If
End Sub
Sub chengxuE
G="追击.BMP"
GG = Split(G,"|")
For I=0 TO UBound(GG)
FindPic 0,0,450,850,"Attachment:\"&GG(I),1,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX,intY
LeftClick 1
End If
Next
G="关闭.BMP"
GG = Split(G,"|")
For I=0 TO UBound(GG)
Delay 1800
FindPic 0,0,450,850,"Attachment:\"&GG(I),1,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX,intY
LeftClick 1
End If
Next
End Sub
Sub chengxuF
G="战斗.BMP"
GG = Split(G,"|")
For I=0 TO UBound(GG)
FindPic 0,0,450,850,"Attachment:\"&GG(I),1,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX,intY
LeftClick 1
End If
Next
End Sub
Sub chengxuG
G="跳过.BMP"
GG = Split(G,"|")
For I=0 TO UBound(GG)
FindPic 0,0,450,850,"Attachment:\"&GG(I),1,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX,intY
LeftClick 1
End If
Next
End Sub
Sub chengxuH
G="跳过结算界面.BMP"
GG = Split(G,"|")
For I=0 TO UBound(GG)
FindPic 0,0,450,850,"Attachment:\"&GG(I),1,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX,intY
LeftClick 1
End If
Next
End Sub
Sub chengxuI
G="关闭聊天窗口.BMP"
GG = Split(G,"|")
For I=0 TO UBound(GG)
FindPic 0,0,450,850,"Attachment:\"&GG(I),1,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX,intY
LeftClick 1
End If
Next
End Sub
Sub chengxuJ
G="关闭.BMP"
GG = Split(G,"|")
For I=0 TO UBound(GG)
FindPic 0,0,450,850,"Attachment:\"&GG(I),1,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX,intY
LeftClick 1
End If
Next
End Sub


IP属地:重庆1楼2022-11-05 01:14回复
    你这样写……好吧,可以稍微简易一点的。
    封装一下找图。你在找图里面,加个调试,看看,是什么问题。是找不到还是什么,你找到是因为,图片很稳定,在运行的过程中多多少少有点延迟,你就找一次,很有可能找一次,图片还没出现,他就跳过了。可以加个调试看看情况


    IP属地:广西来自Android客户端2楼2022-11-05 03:13
    收起回复
      你这样写,相当于百分百出现图片的情况下,因为有网络延迟,真不是百分百出现。按你这样写法,还不如写直接点击,都不用找图。
      所以,最好每个图都找几次,找到退出循环。找不到多少次后也要退出,并且写找不到该怎么样。


      IP属地:广西来自Android客户端3楼2022-11-05 03:15
      收起回复