我完全是个新手,刚刚编了一个rem goto的语句,却不知道错哪了,高手求教啊!

2024-12-12 12:46:35
推荐回答(1个)
回答1:

好多错误啊,有10多处,没法给你一一指出了,自己看代码。另外,按键精灵有智能纠错功能的,你没有去用吗?

rem a
FindPic 0,0,1440,900,"Attachment:\右按钮.bmp",1,intX,intY
If intX > 0 And intY > 0 Then
MoveTo intX, intY
LeftClick 20
Delay 1000
MoveTo 314, 152
LeftClick 1
Delay 1000
MoveTo 783, 501
LeftClick 1
MoveTo 959, 555
Delay 1000
LeftClick 1
goto x
else
goto a
end if
rem x
FindPic 0,0,1440,900,"Attachment:\加载.bmp",1,intX1,intY1
FindPic 0,0,1440,900,"Attachment:\战绩值.bmp",1,intX2,intY2
FindPic 0,0,1440,900,"Attachment:\离开.bmp",1,intX3,intY3
FindPic 0,0,1440,900,"Attachment:\返回.bmp",1,intX4,intY4
If intX1 > 0 And intY1 > 0 Then
goto x
elseIf intX2 > 0 And intY2 > 0 Then
goto b
elseIf intX3 > 0 And intY3 > 0 Then
goto c
elseIf intX4 > 0 And intY4 > 0 Then
goto d
else
goto a
end if
rem b
FindPic 0,0,1440,900,"Attachment:\战绩值.bmp",0.5,intX,intY
If intX > 0 And intY > 0 Then
MoveTo 500, 450
RightClick 1
Delay 1000
rightclick 1
MoveTo 700, 450
rightclick 1
Delay 1000
goto b
else
goto c
end if
rem c
FindPic 0,0,1440,900,"Attachment:\离开.bmp",0.5,intX2,intY2
If intX > 0 And intY > 0 Then
MoveTo intX1+3, intY1+10
delay 500
LeftClick 1
goto d
else
goto c
end if
rem d
FindPic 0,0,1440,900,"Attachment:\返回.bmp",0.5,intX2,intY2
If intX > 0 And intY > 0 Then
MoveTo intX1+3, intY1+10
delay 500
LeftClick 1
goto a
else
goto d
end if

还有一些逻辑上的错误我没有去改了,比如最后那个rem d的下一行的后面的变量是intX2和intY2,接下来的判断语句却是intX和intY,再下一行又变为intX1和intY1了,好乱啊。总之你这个代码是没法运行的。你慢慢改吧。