Send.keys help...

Posts 16–18 of 18 · Page 2 of 2
mouse_event is deprecated, use SendInput instead. (lol doesn't matter much anyway) Lobby? What are you talking about? Why did you set dwExtraInfo to 1? Just leave it to 0.

An additional value associated with the mouse event. An application calls GetMessageExtraInfo to obtain this extra information.
One more thing, you need to set the MOUSEEVENTF_ABSOLUTE flag aswell:
[highlight=vb.net]Public Const MOUSEEVENTF_ABSOLUTE As Integer = &H8000
Public Const MOUSEEVENTF_LEFTDOWN As Integer = &H2
Public Const MOUSEEVENTF_LEFTUP As Integer = &H4
Private Sub DoCrap()
mouse_event(MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_ABSOLUTE, 0, 0, 0, 0)
Sleep((Rnd() * 50) * 100) 'Shouldn't you be using Threading.Thread.Sleep(number) instead?
mouse_event(MOUSEEVENTF_LEFTUP Or MOUSEEVENTF_ABSOLUTE, 0, 0, 0, 0)
End Sub[/highlight]

Quote Originally Posted by MOUSEEVENTF_ABSOLUTE
The dx and dy parameters contain normalized absolute coordinates. If not set, those parameters contain relative data: the change in position since the last reported position. This flag can be set, or not set, regardless of what kind of mouse or mouse-like device, if any, is connected to the system. For further information about relative mouse motion, see the following Remarks section.
http://msdn.microsoft.com/en-us/libr...(v=VS.85).aspx
If you have timer problems, you could always let the timer STOP b4 it does something...

like:
[highlight=vb.net]
Timer1 byval blablablabla
if getasynckeystate keys.U = true 'or whatever your method to track if U is pressed is...
Timer1.Stop 'stops timer
Sendkeys.send ("c") 'will still do this, altho. the timer is stopped. ^^
End If[/highlight]
Your API decl for GetAsyncKeyState is incorrect. VB6 "Long" datatype was an signed 32-bit integer. VB.NET's "Long" datatype is a signed 64-bit integer. VB6's ints were 16bits. Here is the VB.NET dec

[highlight=vb.net]
Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vk As Int32) As Int16
[/highlight]
Posts 16–18 of 18 · Page 2 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?