Mouse-Hook for Rapidfire-Script?

Posts 1–6 of 6 · Page 1 of 1
Mouse-Hook for Rapidfire-Script?
So I am trying to code a rapidfire-script using a mouse hook to detect when the left mouse button has been pressed. The only problem is, when I send a click to the game (to fire the weapon) it gets detected via the mouse hook and so it results in an infinite loop. I don't want to use an additional hotkey (like H) in the game to fire the weapon because that requires input from the user (settings H to fire). I once saw a AHK/AutoIT script which does this, but I'm not familiar with this language.

Code:
*lbutton::
Loop
{
  GetKeyState, state, lbutton, P
  if State = U
    break
  Send, {lbutton}
  Sleep, 0.1
}
return
I don't see what it does different. I guess my question comes down to: Is there a way to send a left mouse click to a process, without it getting detected by a Mousehook?

// Edit: Oh btw, I am using GetAsyncKeyState(0x01) == -32768 to check if the left mouse button is pressed or not.
Code:
if (MouseButtons == System.Windows.Forms.MouseButtons.Left)
            {
                //SendKey
            }
or use

Code:
etAsyncKeyState(0x01) < 0
Use etAsyncKeyState(0x01) < 0
Quote Originally Posted by willy14 View Post
Use etAsyncKeyState(0x01) < 0
Why did you copy exactly what @rabir007said? Including the typo

Also, the correct syntax is
Code:
if(GetAsynKeyState(0x1) & Int16.MaxValue != 0){
     //Do Shit Here
}
Quote Originally Posted by MarkHC View Post

Why did you copy exactly what @rabir007said? Including the typo

Also, the correct syntax is
Code:
if(GetAsynKeyState(0x1) & Int16.MaxValue != 0){
     //Do Shit Here
}

No I didn't... I was trying to help.. Just drop it then
Use the above in a timer, and you are settled for success
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us