Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Public Declare Function timeGetTime Lib "winmm.dll" () As Long
Public Const Pi = 3.141592654
Public Type POINTAPI
X As Long
Y As Long
End Type
Public Function Wait(TimeOut)
Dim TimeNow As Long
On Error Resume Next
TimeNow = timeGetTime()
Do
DoEvents
Loop While TimeNow + TimeOut > timeGetTime()
End Function
'MoveMouseCurve
'Written by: Terrankiller
'http://www.terrankiller.com
Public Function MoveMouseCurve(X As Long, Y As Long, Steps As Long, Arch As Long)
Dim TmpX As Long, TmpY As Long, Step As Long, MP As POINTAPI
GetCursorPos MP
Randomize Timer: X = X + 5 * Rnd - 2
Randomize Timer: Y = Y + 5 * Rnd - 2
Randomize Timer: r1 = Round(5 * Rnd)
Randomize Timer: r2 = Round(5 * Rnd)
Randomize Timer: Arch1 = Round(Arch * Rnd)
Randomize Timer: Arch2 = Round(Arch * Rnd)
If MP.X > X Then w = 1 Else w = -1
If MP.Y > Y Then q = 1 Else q = -1
For i = 1 To Steps
CP = (i / Steps)
TmpX = MP.X + (X - MP.X) * CP + (w * Sin(Pi * r1 * CP) * Arch1)
TmpY = MP.Y + (Y - MP.Y) * CP + (q * Sin(Pi * r2 * CP) * Arch2)
SetCursorPos TmpX, TmpY
Wait (1)
Next i
End Function