I have been using AHK for spamming my "fire button" in gaming for some time now... *shamelessly admits*
And i have always had this little problem with my spamming getting stuck on the "ON" state, if the code runs too fast...
I've finally decided i've had enough trying to "tweak it enough for it to be reliable, by myself", and decided to open this thread and get some proffecional help...
Basically, the method i use is to have a hotkey with an inside
while{getKeyState(HOTKEY_KEY_HERE,"P"){SPAM_CODE_HERE}}, with works fine most of the time, but every now and then, gets stuck on the "ON" state...My search has found a few similar questions here, but the closest clue i got was from this post, and the situation described is not really the same. Aditionally, the problem im having might be completely unrelated to that described there (threads)...
Here is my actual code, any tips on improving it are welcome:
#SingleInstance,force
SendMode,Input
Process,Priority,,R
;=======================================================================================================
$XButton1::
{
While(GetKeyState("XButton1","P"))
{
Send,{XButton1 down}
Sleep,25
Send,{XButton1 up}
Sleep,25
}
}
Return
;=======================================================================================================
$F1::
{
While(GetKeyState("F1","P"))
{
Send,{F1 down}
Sleep,25
Send,{F1 up}
Sleep,25
}
}
Return
;=======================================================================================================
::`/tg::
{
send,Frag!{space}Get{space}down!{enter}
}
BTW, yes, i have tried the same code with keyboard and mouse hooks...Problem persists.
Thanks in advance for any help.




