Using this code, and if you start pressing buttons fast enough it starts acting really weirdly. I was playing a game and got disconnected because of spamming (not intended). It started started acting as if I held the button down permanently, I wasn't. Then it'd start sending things I didn't want to be sent.
#include <misc.au3>
Dim $i[3] = ["2", "1", "0"]
$dll = DllOpen("user32.dll")
$c = 0
While 1
If _IsPressed("62", $dll) Then ;numpad 2
$c = 2
ElseIf _IsPressed("65", $dll) Then ; numpad 5
$c = 1
ElseIf _IsPressed("68", $dll) Then ; numpad 8
$c = 0
Else
$c = -1
EndIf
If $c > -1 Then
Send("{ENTER}")
Sleep(50)
Send("Sending # " & $i[$c])
Sleep(50)
Send("{ENTER}")
Sleep(100)
$c = -1
EndIf
Sleep(100)
WEnd
The output if you hit the keys fast...
8885
Sending 1
1282
5Sending 0#include <misc.au3>
Dim $i[3] = ["2", "1", "0"]
$dll = DllOpen("user32.dll")
$active = 1
$c = 0
While 1
If $active Then
If _IsPressed("62", $dll) Then
$c = 2
ElseIf _IsPressed("65", $dll) Then
$c = 1
ElseIf _IsPressed("68", $dll) Then
$c = 0
Else
$c = -1
EndIf
If $c > -1 Then
Send("{ENTER}")
Sleep(50)
Send("Sending # " & $i[$c])
Sleep(50)
Send("{ENTER}")
Sleep(100)
$c = -1
EndIf
EndIf
Sleep(100)
WEnd
2
5
2Sending 1852
58285
It varies, sometimes it'll just sit there and spam endlessly, other times it'll just say like "Sleep(50)" and continue doing what it's doing, or spit out my whole script. Is this a known issue, when I searched it didn't come up with anything like this.