按键精灵 找图脚本,找到图执行点击后,不继续找图,
FindPic0,0,1360,768,"Attachment:\未合成.bmp",0.9,intX,intYIfintX>0AndintY>0ThenCall点击181...
FindPic 0, 0, 1360, 768, "Attachment:\未合成.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\开始融合.bmp", 0.7, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\选择图谱.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
MoveTo intX+64, intY+64
LeftClick 1
End If
FindPic 0, 0, 1360, 768, "Attachment:\选择图谱戴里克.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\喂食.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Goto 循环喂食
End If
FindPic 0, 0, 1360, 768, "Attachment:\融合精灵.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\合成完毕.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\融合精灵珊瑚龙.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\融合精灵犀角龙.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\融合精灵洛克.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\融合精灵尼多拉.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\购买雷.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 购买雷
End If
FindPic 0, 0, 1360, 768, "Attachment:\购买木.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 购买木
End If
FindPic 0, 0, 1360, 768, "Attachment:\购买水.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 购买水
End If
FindPic 0, 0, 1360, 768, "Attachment:\购买火.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 购买火
End If 展开
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\开始融合.bmp", 0.7, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\选择图谱.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
MoveTo intX+64, intY+64
LeftClick 1
End If
FindPic 0, 0, 1360, 768, "Attachment:\选择图谱戴里克.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\喂食.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Goto 循环喂食
End If
FindPic 0, 0, 1360, 768, "Attachment:\融合精灵.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\合成完毕.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\融合精灵珊瑚龙.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\融合精灵犀角龙.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\融合精灵洛克.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\融合精灵尼多拉.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
FindPic 0, 0, 1360, 768, "Attachment:\购买雷.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 购买雷
End If
FindPic 0, 0, 1360, 768, "Attachment:\购买木.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 购买木
End If
FindPic 0, 0, 1360, 768, "Attachment:\购买水.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 购买水
End If
FindPic 0, 0, 1360, 768, "Attachment:\购买火.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 购买火
End If 展开
2个回答
展开全部
你把同一级别要找的图放入一个FOR循环(或者DO循环,找到后点击完直接退出循环,执行以后的脚本,那么这层的所有找图都不会再执行了)
For 1
FindPic 0, 0, 1360, 768, "Attachment:\购买雷.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击
Exit For
End If
FindPic 0, 0, 1360, 768, "Attachment:\购买木.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击
Exit For
End If
FindPic 0, 0, 1360, 768, "Attachment:\购买水.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击
Exit For
End If
FindPic 0, 0, 1360, 768, "Attachment:\购买火.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击
Exit For
End If
next
或者你把同一级要找的图 全部用Else 来表示,如果找到图以后Else是不会成立的~~
具体操作还是要根据你需要的逻辑来编写代码!
For 1
FindPic 0, 0, 1360, 768, "Attachment:\购买雷.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击
Exit For
End If
FindPic 0, 0, 1360, 768, "Attachment:\购买木.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击
Exit For
End If
FindPic 0, 0, 1360, 768, "Attachment:\购买水.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击
Exit For
End If
FindPic 0, 0, 1360, 768, "Attachment:\购买火.bmp", 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击
Exit For
End If
next
或者你把同一级要找的图 全部用Else 来表示,如果找到图以后Else是不会成立的~~
具体操作还是要根据你需要的逻辑来编写代码!
更多追问追答
追问
这样么
FindPic 0, 0, 1360, 768, ".............
If intX > 0 And intY > 0 Then
Call 点击1818
End If
Else
FindPic 0, 0, 1360, 768, "..........
....
Else
FindPic 0, 0, 1360, 768, "...........
追答
差不多,
End If 要放到最后一个Else 的后面
展开全部
您好,大概思路如下
dim 地址(//图片数量)
地址(0)="Attachment:\未合成.bmp" : 地址(1)="Attachment:\开始融合.bmp"
For i = 0 to UBound(地址)
FindPic 0, 0, 1360, 768, 地址(i), 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
next
dim 地址(//图片数量)
地址(0)="Attachment:\未合成.bmp" : 地址(1)="Attachment:\开始融合.bmp"
For i = 0 to UBound(地址)
FindPic 0, 0, 1360, 768, 地址(i), 0.9, intX, intY
If intX > 0 And intY > 0 Then
Call 点击1818
End If
next
更多追问追答
追问
这样建立循环么?
dim 一层(10)
.........................
dim 二层(10)
...........................
追答
不是啊,是dim 图片地址(0)..dim 图片地址(1)...以此类推.多少个图就赋值多少个数组
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询