• Log in or sign up for an account here: https://www.sythe.org/login

[source]movemouse smooth

slashshot007

Active Member
Joined
May 6, 2006
Sythe Gold
0
Messages
164
[source]movemouse smooth
this whole code is purely made by me except for the wait function, and probably could be alot shorter.
recomended speed: 1-5
Code:
 Sub movemousesmooth(ByVal x As Integer, ByVal y As Integer, ByVal speed As Integer)
        Dim currentlocationx As Integer, currentlocationy As Integer, random As Integer
        currentlocationx = Windows.Forms.Cursor.Position.X
        currentlocationy = Windows.Forms.Cursor.Position.Y
        Do Until currentlocationx = x And currentlocationy = y
            If speed = 1 Then
                random = 1
            Else
                random = CStr(Int(Rnd() * speed))
                If random = 0 Then random = CStr(Int(Rnd() * speed))
            End If
            If currentlocationx > x Then currentlocationx = currentlocationx - random
            If currentlocationx < x Then currentlocationx = currentlocationx + random
            If currentlocationy > y Then currentlocationy = currentlocationy - random
            If currentlocationy < y Then currentlocationy = currentlocationy + random
            Windows.Forms.Cursor.Position = New Point(currentlocationx, currentlocationy)
            Wait(0.5)
        Loop
    End Sub

heres the wait function that goes with it:
Code:
	Public Declare Function timeGetTime Lib "winmm.dll" () As Long
	Public Sub Wait(ByVal TimeOut As Long)
		Dim CurrentTime As Long
		CurrentTime = timeGetTime()
		Do
			System.Windows.Forms.Application.DoEvents()
		Loop While CurrentTime + TimeOut > timeGetTime()
	End Sub

its probably not the least detectable one, but it still works.

EDIT:
Usage:

movemousesmooth(500,500,3)
moves to the 500,500 corrridiniates with a speed of 3. (I don't reccoment a speed over 5)
 
Runescape Gamblingrunescape gambling
Back
Top