按键精灵代码最后的rem a处单独运行正常,一起运行总是鼠标极度偏移,请问咋回事?

RembWhile1=1FindPic0,0,1024,768,"Attachment:\答1.bmp",0.8,x,yIfx>0ThenMoveToX+7,Y+6Lef... Rem b

While 1 = 1

FindPic 0, 0, 1024, 768, "Attachment:\答1.bmp", 0.8, x, y
If x > 0 Then
MoveTo X + 7, Y + 6
LeftClick 1
goto a
End If

FindPic 0, 0, 1024, 768, "Attachment:\答2.bmp", 0.8, x, y
If x > 0 Then
MoveTo X + 7, Y + 6
LeftClick 1
goto a
End If

FindPic 0, 0, 1024, 768, "Attachment:\答3.bmp", 0.8, x, y
If x > 0 Then
MoveTo X + 7, Y + 6
LeftClick 1
goto a
End If

FindPic 0, 0, 1024, 768, "Attachment:\答4.bmp", 0.8, x, y
If x > 0 Then
MoveTo X + 7, Y + 6
LeftClick 1
goto a
End If

FindPic 0, 0, 1024, 768, "Attachment:\答5.bmp", 0.8, x, y
If x > 0 Then
MoveTo X + 7, Y + 6
LeftClick 1
goto a
End If

FindPic 0, 0, 1024, 768, "Attachment:\答6.bmp", 0.8, x, y
If x > 0 Then
MoveTo X + 7, Y + 6
LeftClick 1
//

goto a
End If

FindPic 0, 0, 1024, 768, "Attachment:\答7.bmp", 0.8, x, y
If x > 0 Then
MoveTo X + 7, Y + 6
LeftClick 1
goto a
End If

FindPic 0, 0, 1024, 768, "Attachment:\答8.bmp", 0.8, x, y
If x > 0 Then
MoveTo X + 7, Y + 6
LeftClick 1
goto a
End If

FindPic 0, 0, 1024, 768, "Attachment:\答9.bmp", 0.8, x, y
If x > 0 Then
MoveTo X + 7, Y + 6
LeftClick 1
goto a
End If

FindPic 0, 0, 1024, 768, "Attachment:\答10.bmp", 0.8, x, y
If x > 0 Then
MoveTo X + 7, Y + 6
LeftClick 1
goto a
End If

Wend

Rem a
FindPic 0, 0, 1024, 768, "Attachment:\tj.bmp", 0.8, intX, intY
If intX > 0 Then
MoveTo intX, intY
Delay 100
LeftClick 1
Delay 2000
End If
Goto b
下面是精简的代码,不知为什么不能正确点击?
Dim a(9)
a(0) = "Attachment:\答1.bmp"
a(1) = "Attachment:\答2.bmp"
a(2) = "Attachment:\答3.bmp"
a(3) = "Attachment:\答4.bmp"
a(4) = "Attachment:\答5.bmp"
a(5) = "Attachment:\答6.bmp"
a(6) = "Attachment:\答7.bmp"
a(7) = "Attachment:\答8.bmp"
a(8) = "Attachment:\答9.bmp"
a(9) = "Attachment:\答10.bmp"
Call 查找图片数组()
EndScript
Sub 查找图片数组()

For i=0 to 9
FindPic 0, 0, 1024, 768, a(i), 0.9, X, Y

If x>0 and y>0 Then

MoveTo x+7,y+6
LeftClick 1
Exit For
End If
next
End Sub
展开
 我来答
店若器M
游戏玩家

2018-09-13 · 非著名电竞玩家
知道大有可为答主
回答量:1万
采纳率:75%
帮助的人:2737万
展开全部
首先,你的语法重复太多,应该学会精简,但这不是主要原因,只是建议。
问题的关键是,前面的找图随便找到一个就去找REM A,但是,你却忽略了假如瞬间找到不到那个图咋办?你语句是直接跳到了REM B。那样就等于直接忽略了rem a 的图了。如果你一定要找最后的图,建议假如循环找到为止。那样就不会出错了。
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式