按键精灵 后台找图问题 10
Hwnd=Plugin.Window.MousePoint()DoDelay3000CallPlugin.Bkgnd.KeyPress(Hwnd,77)Delay1000...
Hwnd = Plugin.Window.MousePoint()
Do
Delay 3000
Call Plugin.Bkgnd.KeyPress(Hwnd, 77)
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, 662, 22)
Delay 500
Call Plugin.Bkgnd.SendString(Hwnd, "2120")
Delay 500
Call Plugin.Bkgnd.LeftClick(Hwnd, 762, 22)
Delay 500
Call Plugin.Bkgnd.SendString(Hwnd, "1487")
Delay 500
Call Plugin.Bkgnd.LeftClick(Hwnd, 841, 23)
Delay 500
Call Plugin.Bkgnd.KeyPress(Hwnd, 77)
Delay 500
Call Plugin.Bkgnd.KeyPress(Hwnd, 70)
Delay 1000
XY = Plugin.Bkgnd.FindPic(Hwnd, 0, 0, 1366, 768, "C:\Users\Administrator\Desktop\新建文件夹 (2)\去东越.bmp", 0, 0.9)
iZB = InStr(XY, "|")
X = CLng(Left(XY, iZB - 1))
Y = CLng(Right(XY, Len(XY) - iZB))
If X > 0 and Y > 0 Then
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, X, Y)
Delay 1000
XY = Plugin.Bkgnd.FindPic(Hwnd, 0, 0, 1366, 768, "C:\Users\Administrator\Desktop\新建文件夹 (2)\确认传送.bmp", 0, 0.9)
iZB = InStr(XY, "|")
X = CLng(Left(XY, iZB - 1))
Y = CLng(Right(XY, Len(XY) - iZB))
If X > 0 and Y > 0 Then
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, X, Y)
Delay 8000
Exit Do
End If
End If
Loop
Do
Delay 3000
Call Plugin.Bkgnd.KeyPress(Hwnd, 77)
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, 662, 22)
Delay 500
Call Plugin.Bkgnd.SendString(Hwnd, "415")
Delay 500
Call Plugin.Bkgnd.LeftClick(Hwnd, 762, 22)
Delay 500
Call Plugin.Bkgnd.SendString(Hwnd, "3029")
Delay 500
Call Plugin.Bkgnd.LeftClick(Hwnd, 841, 23)
Delay 500
Call Plugin.Bkgnd.KeyPress(Hwnd, 77)
Delay 500
Call Plugin.Bkgnd.KeyPress(Hwnd, 70)
Delay 1000
XY = Plugin.Bkgnd.FindPic(Hwnd, 0, 0, 1366, 768, "C:\Users\Administrator\Desktop\新建文件夹 (2)\去开封.bmp", 0, 0.9)
iZB = InStr(XY, "|")
X = CLng(Left(XY, iZB - 1))
Y = CLng(Right(XY, Len(XY) - iZB))
If X > 0 and Y > 0 Then
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, X, Y)
Delay 1000
XY = Plugin.Bkgnd.FindPic(Hwnd, 0, 0, 1366, 768, "C:\Users\Administrator\Desktop\新建文件夹 (2)\去开封1.bmp", 0, 0.9)
iZB = InStr(XY, "|")
X = CLng(Left(XY, iZB - 1))
Y = CLng(Right(XY, Len(XY) - iZB))
If X>0 and Y>0 Then
Call Plugin.Bkgnd.LeftClick(Hwnd, X, Y)
Delay 8000
Exit Do
End If
End If
Loop
执行第一个循环 找到图执行命令后跳出 执行第二个循环 到找图时却找不到了 不能继续执行命令 但是把第二个循环单独新建一个脚本 是可以找到图并执行命令的 展开
Do
Delay 3000
Call Plugin.Bkgnd.KeyPress(Hwnd, 77)
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, 662, 22)
Delay 500
Call Plugin.Bkgnd.SendString(Hwnd, "2120")
Delay 500
Call Plugin.Bkgnd.LeftClick(Hwnd, 762, 22)
Delay 500
Call Plugin.Bkgnd.SendString(Hwnd, "1487")
Delay 500
Call Plugin.Bkgnd.LeftClick(Hwnd, 841, 23)
Delay 500
Call Plugin.Bkgnd.KeyPress(Hwnd, 77)
Delay 500
Call Plugin.Bkgnd.KeyPress(Hwnd, 70)
Delay 1000
XY = Plugin.Bkgnd.FindPic(Hwnd, 0, 0, 1366, 768, "C:\Users\Administrator\Desktop\新建文件夹 (2)\去东越.bmp", 0, 0.9)
iZB = InStr(XY, "|")
X = CLng(Left(XY, iZB - 1))
Y = CLng(Right(XY, Len(XY) - iZB))
If X > 0 and Y > 0 Then
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, X, Y)
Delay 1000
XY = Plugin.Bkgnd.FindPic(Hwnd, 0, 0, 1366, 768, "C:\Users\Administrator\Desktop\新建文件夹 (2)\确认传送.bmp", 0, 0.9)
iZB = InStr(XY, "|")
X = CLng(Left(XY, iZB - 1))
Y = CLng(Right(XY, Len(XY) - iZB))
If X > 0 and Y > 0 Then
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, X, Y)
Delay 8000
Exit Do
End If
End If
Loop
Do
Delay 3000
Call Plugin.Bkgnd.KeyPress(Hwnd, 77)
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, 662, 22)
Delay 500
Call Plugin.Bkgnd.SendString(Hwnd, "415")
Delay 500
Call Plugin.Bkgnd.LeftClick(Hwnd, 762, 22)
Delay 500
Call Plugin.Bkgnd.SendString(Hwnd, "3029")
Delay 500
Call Plugin.Bkgnd.LeftClick(Hwnd, 841, 23)
Delay 500
Call Plugin.Bkgnd.KeyPress(Hwnd, 77)
Delay 500
Call Plugin.Bkgnd.KeyPress(Hwnd, 70)
Delay 1000
XY = Plugin.Bkgnd.FindPic(Hwnd, 0, 0, 1366, 768, "C:\Users\Administrator\Desktop\新建文件夹 (2)\去开封.bmp", 0, 0.9)
iZB = InStr(XY, "|")
X = CLng(Left(XY, iZB - 1))
Y = CLng(Right(XY, Len(XY) - iZB))
If X > 0 and Y > 0 Then
Delay 1000
Call Plugin.Bkgnd.LeftClick(Hwnd, X, Y)
Delay 1000
XY = Plugin.Bkgnd.FindPic(Hwnd, 0, 0, 1366, 768, "C:\Users\Administrator\Desktop\新建文件夹 (2)\去开封1.bmp", 0, 0.9)
iZB = InStr(XY, "|")
X = CLng(Left(XY, iZB - 1))
Y = CLng(Right(XY, Len(XY) - iZB))
If X>0 and Y>0 Then
Call Plugin.Bkgnd.LeftClick(Hwnd, X, Y)
Delay 8000
Exit Do
End If
End If
Loop
执行第一个循环 找到图执行命令后跳出 执行第二个循环 到找图时却找不到了 不能继续执行命令 但是把第二个循环单独新建一个脚本 是可以找到图并执行命令的 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询