你从网站上弄的代码,不是你要的功能,他那个代码没有保障在四次点击,每一个坐标都点到。
要实现你这个功能,用数组比较方便,代码我不解释了,你自己看着办,代码如下:
Dim Num(4), x(4), y(4)
x(1) = 1 : y(1) = 1
x(2) = 10 : y(2) = 10
x(3) = 33 : y(3) = 33
x(4) = 654 : y(4) = 75
While True
For i = 1 To 4
Num(i) = 0
Next
n = 1
While n < 5
Randomize
a = Int(4 * Rnd + 1)
For i = 1 To n
If Num(i) = a Then
Exit For
End If
If i >= n Then
Num(n) = a
n = n + 1
Exit For
End If
Next
Wend
//MessageBox Num(1) & "|" & Num(2) & "|" & Num(3) & "|" & Num(4)
For i = 1 To 4
m = Num(i)
Call Plugin.Bkgnd.LeftdoubleClick(Hwnd, x(m), y(m))
Delay 100
Next
Wend
如果你只想点击四个坐标一次,你就把While True……Wend去掉。