Results 1 to 3 of 3

Thread: Auto Click help

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2009
    Posts
    1

    Exclamation Auto Click help

    I made a simple auto clicker in vb. It works great in all windows applications, such as microsoft word, paint, etc. But when I try to use it in a game, like Conquer it will not work. It will click in the predetermined coordinates but nothing happens in the game. Its as if it were clicking straight through the game. Can someone help me fix this?

    the code looks like this:

    Public Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (ByVal lpPoint As POINTAPI) As Long
    Public Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
    Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)


    Function MoveMouse()

    Dim MousePos As POINTAPI
    Call GetCursorPos(MousePos)

    Cursor.Position = New Point(xpos, ypos)

    mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0)
    Sleep(1000)
    mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0)
    Sleep(1000)
    mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0)
    Sleep(1000)
    mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0)

    xpos = screenresx
    ypos = screenresy

    Return (MousePos)
    End Function

    (with some unnecessary code not posted)

  2. #2
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: Auto Click help

    Unfortunately, you posted in the wrong section of the forum. Your code is NET but you're in the VB6 forum.
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  3. #3
    Member
    Join Date
    Jul 2009
    Posts
    33

    Re: Auto Click help

    I tried to do it long time ago.
    Solution:
    i read about Mouse Hook, but i was beginer and ignore it and stop the project.
    some minutes ago for other project i read about HOOK.

    Look it
    http://msdn.microsoft.com/en-us/libr...90(VS.85).aspx
    Here has a MOUSE HOOK or KeyBoardHook, you can write a function to Click and Inject into game, can work? (in the theory)

    If dont solve (probaly don&#180;t) can help you to think in other way.
    i Hope Help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width