hello, i'm trying to work a custom autofire (with several time interval to choose from), based on the hold down type, which worked pretty fine at first.
but, while modifying it, i encountered a problem : it doesn't stop even when releasing the key.
since i don't know precisely what caused this (i think it was when i started to try using Input to choose the interval from a pool), i simply decided to start over from scratch.
so now, here is my new base script, which still has the same problem:
Code:
EnableAutoFire = 0
~WheelDown::
KeyWait, WheelDown, D
If EnableAutoFire = 0
EnableAutoFire = 1
else
EnableAutoFire = 0
return
~$LButton::
While (GetKeyState ("LButton", "P") && EnableAutoFire) {
Click
Sleep 180
}
return
here is what it should do:
1) enabling / disabling autofire with mouse wheel down
2) repeatedly send a click event as long as autofire is on and the left mouse button is pressed
1) works just fine
2) doesn't work. it starts sending clicks when the left button is pressed, but doesn't stop when the button is released.
using the mouse wheel down stop the firing just fine though. this behaviour is the same in the game, in notepad++, firefox or just any software in Windows
apparently, the problem comes from the GetKeyState ("LButton", "P") which doesn't return the right value.
in fact, adding
MsgBox % GetKeyState ("LButton", "P") in the loop will pop up a message box saying
LButton instead of
1 or
0 whether the button is still pressed or not.
any idea?
i already tried reinstalling autohotkey, didn't solve anything.