Results 1 to 14 of 14
  1. #1
    dylan40's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    In ya head yo. oya.
    Posts
    851
    Reputation
    11
    Thanks
    136
    My Mood
    Happy

    [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.

  2. #2
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    [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

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  3. #3
    dylan40's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    In ya head yo. oya.
    Posts
    851
    Reputation
    11
    Thanks
    136
    My Mood
    Happy
    Thanks..........

  4. #4
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    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]
    Last edited by Jason; 05-18-2010 at 11:47 AM.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  5. The Following User Says Thank You to Jason For This Useful Post:

    Blubb1337 (05-18-2010)

  6. #5
    dylan40's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    In ya head yo. oya.
    Posts
    851
    Reputation
    11
    Thanks
    136
    My Mood
    Happy
    Ok thanks very much add me on msn please to help me when i need it niceone61@hotmail.com

  7. #6
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    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?

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  8. #7
    /b/oss's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    13,651
    Reputation
    795
    Thanks
    3,547
    close this endrit?

  9. #8
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Major_the_hacker 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.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  10. #9
    dylan40's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    In ya head yo. oya.
    Posts
    851
    Reputation
    11
    Thanks
    136
    My Mood
    Happy
    no i dont know how to make him move but it will shot.... with auto clicker

  11. #10
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    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.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  12. #11
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    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.

  13. #12
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by FLAMESABER 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

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  14. #13
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Cuz you're noob ^_____^

    Naw, easy but creative thought =D



  15. #14
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    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

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

Similar Threads

  1. Help with Moving Mouse
    By flameswor10 in forum C++/C Programming
    Replies: 8
    Last Post: 01-09-2011, 08:50 AM
  2. [HELP] Fast Mouse Click Code[Solved]
    By <(-_-)> in forum Visual Basic Programming
    Replies: 6
    Last Post: 04-01-2010, 08:41 PM
  3. [HELP]Fast Mouse Click[Solved]
    By <(-_-)> in forum Visual Basic Programming
    Replies: 5
    Last Post: 03-27-2010, 09:24 PM
  4. [Help]Moving things around`
    By Samueldo in forum Visual Basic Programming
    Replies: 7
    Last Post: 01-07-2010, 03:31 PM
  5. Move mouse via-keyboard
    By VvITylerIvV in forum Combat Arms Discussions
    Replies: 3
    Last Post: 12-08-2009, 09:49 PM