SmoothMouse (better then my last one)

Discussion in 'Programming General' started by slashshot007, Apr 15, 2007.

SmoothMouse (better then my last one)
  1. Unread #1 - Apr 15, 2007 at 3:38 PM
  2. slashshot007
    Joined:
    May 6, 2006
    Posts:
    164
    Referrals:
    0
    Sythe Gold:
    0

    slashshot007 Active Member

    SmoothMouse (better then my last one)

    i made a better version:

    Code:
    	Sub MoveMouseSmooth(ByVal x As Integer, ByVal y As Integer, ByVal steps As Integer)
    		Dim i As Integer, x2 As Integer, y2 As Integer
    		x2 = (x - Windows.Forms.Cursor.Position.X) / steps
    		y2 = (y - Windows.Forms.Cursor.Position.Y) / steps
    		For i = 1 To steps
    			Windows.Forms.Cursor.Position = New Point(Windows.Forms.Cursor.Position.X + x2, Windows.Forms.Cursor.Position.Y + y2)
    			Wait(5)
    		Next
    		Windows.Forms.Cursor.Position = New Point(x, y)
    	End Sub
    this time the speed is changed by changing the number of steps.

    the number of steps obviously varies. if the selected object is far away, then more steps. if its close, then less steps.
    but you want no less then ten, and no more then 150 lol.
     
< Just a question new at this... | Ceating dlls >

Users viewing this thread
1 guest


 
 
Adblock breaks this site