按键精灵 出现下标越界,我是新手,请教一下哪里出了问题
Hwnd0=Plugin.Window.Find(0,"精灵")CallPlugin.Window.Active(Hwnd0)CallPlugin.Window.Move...
Hwnd0 = Plugin.Window.Find(0, "精灵")
Call Plugin.Window.Active(Hwnd0)
Call Plugin.Window.Move(Hwnd0, 0, 0)
Dim myA
myA = Split(sRect, "|")
Ux = CLng(myA(0))
Uy = CLng(myA(1))
i=0
While i = 0
FindPic ux,uy,ux+1024,uy+768,"Attachment:\人物.bmp",0.9,zijiX,zijiY
If zijiX > 0 And zijiY > 0 Then
i=1
FindPic zijix,zjjiy,ziji+1024,ziji+768,"Attachment:\实验点.bmp",0.9,guaiX,guaiY
If guaiX > 0 And guaiY > 0 Then
i = 1
If guaiX > zijiX - 1 Then
KeyDown "D", 1
Else
KeyDown "A", 1
End If
KeyUp "D", 1
KeyUp "A", 1
End If
End If
Wend 展开
Call Plugin.Window.Active(Hwnd0)
Call Plugin.Window.Move(Hwnd0, 0, 0)
Dim myA
myA = Split(sRect, "|")
Ux = CLng(myA(0))
Uy = CLng(myA(1))
i=0
While i = 0
FindPic ux,uy,ux+1024,uy+768,"Attachment:\人物.bmp",0.9,zijiX,zijiY
If zijiX > 0 And zijiY > 0 Then
i=1
FindPic zijix,zjjiy,ziji+1024,ziji+768,"Attachment:\实验点.bmp",0.9,guaiX,guaiY
If guaiX > 0 And guaiY > 0 Then
i = 1
If guaiX > zijiX - 1 Then
KeyDown "D", 1
Else
KeyDown "A", 1
End If
KeyUp "D", 1
KeyUp "A", 1
End If
End If
Wend 展开
2个回答
展开全部
自己看看定义的什么? 数组还是变量? 下标不越界就怪了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你这个看起来像是控制一个小人不断接近某个物体的
把你的
Ux = CLng(myA(0))
Uy = CLng(myA(1))
换个方式表达的话应该就没事了
把你的
Ux = CLng(myA(0))
Uy = CLng(myA(1))
换个方式表达的话应该就没事了
追问
你说的没错,控制一个小人不断接近某个物体,能帮我改改吗?
追答
我不知道你的
Ux = CLng(myA(0))
Uy = CLng(myA(1))
有什么意义....完全可以写成常量ux=XXX这样
如果后面有用到的话我就不清楚你要什么效果了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询