按键精灵找多图并点击
按键精灵找图语句怎样做到找多图,当找到其中一张点击,然后继续找到一张后继续点击,……一直循环找...
按键精灵找图语句怎样做到找多图,当找到其中一张点击,然后继续找到一张后继续点击,…… 一直循环找
展开
展开全部
Function countSubStr(string1,string2)
'查找string2在string1中出现的次数
start = 1
length = 1
countSubStr = 0
While start < len(string1) + 1
str = Left(string1, length)
If Instr(start, str, string2)>0 Then
countSubStr = countSubStr + 1
End If
start = start + 1
length = length + 1
Wend
End Function
Function locationPic(x1,y1,x2,y2,picName)
'查找图片,找到后鼠标移动到坐标
'查找区域为左上坐标x1,y1到右下坐标x2,y2
'返回boolean"True",否则返回"False",true=-1,false=0
'默认附件路径
FindPic x1, y1, x2, y2, "Attachment:\" & picName & ".bmp", 0.8, tempX, tempY
If tempX > 0 And tempY > 0 Then
MoveTo tempX, tempY
locationPic = True
Else
locationPic = False
End If
End Function
Function findMultiPics(x1,y1,x2,y2,pics)
'找多图,结合循环和判断语句可以有更多玩法,
'返回值类型为boolean,true=-1,false=0
'查找区域为左上坐标x1,y1到右下坐标x2,y2
'pics可以是单图名称,也可以用 | 符号连接的多个图片名
'找多图时按照下标顺序查找,找到后返回True,不再继续查找
'默认附件路径,在函数locationPic()中设置
separation = "|"
picArr = split(pics, separation)
cntSS = countSubStr(pics, separation)
If cntSS = 0 Then
findMultiPics = locationPic(x1, y1, x2, y2, pics)
Else
picCnt = 0
While picCnt <= cntSS
findMultiPics = locationPic(x1, y1, x2, y2, picArr(picCnt))
If findMultiPics = True Then
Goto ExitWhile
End If
picCnt = picCnt + 1
Wend
Rem ExitWhile
End If
End Function
Function loopFindMultiPics(x1,y1,x2,y2,pics)
'增强版找多图,找不到目标图片就一直找,直到找到为止
'返回值类型为boolean,true=-1,false=0
'查找区域为左上坐标x1,y1到右下坐标x2,y2
'pics可以是单图名称,也可以用 | 符号连接的多个图片名
'找多图时按照下标顺序查找,找到后返回True,不再继续查找
'默认附件路径,在函数locationPic()中设置
separation = "|"
picArr = split(pics, separation)
cntSS = countSubStr(pics, separation)
Do
If cntSS = 0 Then
loopFindMultiPics = locationPic(x1, y1, x2, y2, pics)
If loopFindMultiPics = True Then
Exit Do
End If
Else
picCnt=0
While picCnt <= cntSS
loopFindMultiPics = locationPic(x1, y1, x2, y2, picArr(picCnt))
If loopFindMultiPics = True Then
Exit Do
End If
picCnt = picCnt + 1
Wend
End If
Loop
End Function
'想要返回偏移坐标可以调用tempX和tempY
'查找string2在string1中出现的次数
start = 1
length = 1
countSubStr = 0
While start < len(string1) + 1
str = Left(string1, length)
If Instr(start, str, string2)>0 Then
countSubStr = countSubStr + 1
End If
start = start + 1
length = length + 1
Wend
End Function
Function locationPic(x1,y1,x2,y2,picName)
'查找图片,找到后鼠标移动到坐标
'查找区域为左上坐标x1,y1到右下坐标x2,y2
'返回boolean"True",否则返回"False",true=-1,false=0
'默认附件路径
FindPic x1, y1, x2, y2, "Attachment:\" & picName & ".bmp", 0.8, tempX, tempY
If tempX > 0 And tempY > 0 Then
MoveTo tempX, tempY
locationPic = True
Else
locationPic = False
End If
End Function
Function findMultiPics(x1,y1,x2,y2,pics)
'找多图,结合循环和判断语句可以有更多玩法,
'返回值类型为boolean,true=-1,false=0
'查找区域为左上坐标x1,y1到右下坐标x2,y2
'pics可以是单图名称,也可以用 | 符号连接的多个图片名
'找多图时按照下标顺序查找,找到后返回True,不再继续查找
'默认附件路径,在函数locationPic()中设置
separation = "|"
picArr = split(pics, separation)
cntSS = countSubStr(pics, separation)
If cntSS = 0 Then
findMultiPics = locationPic(x1, y1, x2, y2, pics)
Else
picCnt = 0
While picCnt <= cntSS
findMultiPics = locationPic(x1, y1, x2, y2, picArr(picCnt))
If findMultiPics = True Then
Goto ExitWhile
End If
picCnt = picCnt + 1
Wend
Rem ExitWhile
End If
End Function
Function loopFindMultiPics(x1,y1,x2,y2,pics)
'增强版找多图,找不到目标图片就一直找,直到找到为止
'返回值类型为boolean,true=-1,false=0
'查找区域为左上坐标x1,y1到右下坐标x2,y2
'pics可以是单图名称,也可以用 | 符号连接的多个图片名
'找多图时按照下标顺序查找,找到后返回True,不再继续查找
'默认附件路径,在函数locationPic()中设置
separation = "|"
picArr = split(pics, separation)
cntSS = countSubStr(pics, separation)
Do
If cntSS = 0 Then
loopFindMultiPics = locationPic(x1, y1, x2, y2, pics)
If loopFindMultiPics = True Then
Exit Do
End If
Else
picCnt=0
While picCnt <= cntSS
loopFindMultiPics = locationPic(x1, y1, x2, y2, picArr(picCnt))
If loopFindMultiPics = True Then
Exit Do
End If
picCnt = picCnt + 1
Wend
End If
Loop
End Function
'想要返回偏移坐标可以调用tempX和tempY
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
G="1.BMP|2.BMP|3.BMP|4.BMP|"
GG = Split(G, "|")
For I=0 TO UBound(GG)
FindPic 0,0,1024,768,"Attachment:\"&GG(I),0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX,intY
LeftClick 1
End If
Next
//哎 没分
GG = Split(G, "|")
For I=0 TO UBound(GG)
FindPic 0,0,1024,768,"Attachment:\"&GG(I),0.9,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX,intY
LeftClick 1
End If
Next
//哎 没分
追问
是不是要用到大漠的插件?
追答
不用
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询