[HELP] moving mouse

Posts 114 of 14 · Page 1 of 1
[HELP] moving mouse
Can you guy's help me im trying to make a afk bot for ca but i have no idea how to make button1 move the coordinates of the mouse.
[php]

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Cursor.Position = New Point(x, y)

End Sub
[/php]

Just set the 'x' and 'y' values to the x and y co-ordinates of where you want the mouse to go.

Having trouble finding mouse coords?

create a timer of interval 1 and set it to enabled and create a label.



[php]
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

Label1.Text = (Cursor.Position.X & ", " & Cursor.Position.Y)

End Sub[/php]

Hope that helps,

J-Deezy
Thanks..........
Okay for mouse click.

First declare this shizniz just under "Public Class Form1"

[php] Private Declare Sub mouse_event Lib "user32" (ByVal dwflags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cbuttons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSELEFTDOWN = &H2
Private Const MOUSELEFTUP = &H4

[/php]

Then anywhere you need it to simulate a mouse click just put this

[php]
mouse_event(MOUSELEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSELEFTUP, 0, 0, 0, 0)
[/php]

That simulates a single click.

Just post if you need anything else (fast I'm sleeping soon :P)

EDIT: If you plan on using the mouse click in numerous places then make a sub

[php]
Private Sub MouseClick()

mouse_event(MOUSELEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSELEFTUP, 0, 0, 0, 0)

End Sub
[/php]

Then whenever you want to click the mouse. Just do this

[php]
Call MouseClick()
[/php]
Quote Originally Posted by dylan40 View Post
Ok thanks very much add me on msn please to help me when i need it niceone61@hotmail.com
Just PM me here, I'm usually on MPGH when I'm on the computer so I'll see it.

Do you know how to make the person move around in CA programmatically?
close this endrit?
Quote Originally Posted by /b/oss View Post
close this endrit?
Why? It's still open for discussion.

Just because the original question was answered does not mean the thread should be closed yet, there is still active discussion going on.
no i dont know how to make him move but it will shot.... with auto clicker
Oh yeah, make sure it only shoots every now and then, otherwise you'll run outta ammo before the game ends. I was trying to make mine using "SendMessage" so you could AFK and still use your computer didn't work though cos CA patched sendmessage.
Although the problem is solved, here is a nice mouse move effect I just created. Its simple. It smoothly takes the cursor to the position you want. Not like directly jumping to the co-ordinates !!


First declare these:

[php]
'Set the x and y co-ordinates to your adjustments... In this case it will take the cursor to start menu.
Dim x As Integer = 10
Dim y As Integer = Screen.PrimaryScreen.Bounds.Height - 20
Public Declare Function SetCursorPos Lib "user32" (ByVal X As Integer, ByVal Y As Integer) As Integer
Dim i As Integer = MousePosition.Y
Dim j As Integer = MousePosition.X
Dim boolx As Boolean = False
Dim booly As Boolean = False[/php]

Then add a timer and set its interval to 1. Then add the following code in the timer:

[php]If Not boolx Then
If x <= j Then
SetCursorPos(j, i)
j -= 4
Else
SetCursorPos(j, i)
j += 4
boolx = True

End If
End If
If Not booly Then
If y <= i Then
SetCursorPos(j, i)
i -= 4
Else
SetCursorPos(j, i)
i += 4
If boolx Then
booly = True

End If
End If
End If[/php]

Now run the application. The code might not be perfect. It needs improvement...Just posted to give you an idea.

Enjoy smooth mouse ride.
Quote Originally Posted by Hassan View Post
Although the problem is solved, here is a nice mouse move effect I just created. Its simple. It smoothly takes the cursor to the position you want. Not like directly jumping to the co-ordinates !!


First declare these:

[php]
'Set the x and y co-ordinates to your adjustments... In this case it will take the cursor to start menu.
Dim x As Integer = 10
Dim y As Integer = Screen.PrimaryScreen.Bounds.Height - 20
Public Declare Function SetCursorPos Lib "user32" (ByVal X As Integer, ByVal Y As Integer) As Integer
Dim i As Integer = MousePosition.Y
Dim j As Integer = MousePosition.X
Dim boolx As Boolean = False
Dim booly As Boolean = False[/php]

Then add a timer and set its interval to 1. Then add the following code in the timer:

[php]If Not boolx Then
If x <= j Then
SetCursorPos(j, i)
j -= 4
Else
SetCursorPos(j, i)
j += 4
boolx = True

End If
End If
If Not booly Then
If y <= i Then
SetCursorPos(j, i)
i -= 4
Else
SetCursorPos(j, i)
i += 4
If boolx Then
booly = True

End If
End If
End If[/php]

Now run the application. The code might not be perfect. It needs improvement...Just posted to give you an idea.

Enjoy smooth mouse ride.
I haven't tested it but this looks niiiice. Good thinking. I like it Pretty simple and understandable, why didn't I think of it
Cuz you're noob ^_____^

Naw, easy but creative thought =D
Quote Originally Posted by Blubb1337 View Post
Cuz you're noob ^_____^
Thanks man

I think i'm going to go cry myself to sleep now...QQ

Nah jokes :P
Posts 114 of 14 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?