-
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)
-
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.
-
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´t) can help you to think in other way.
i Hope Help.