Loop gets stuck spaming q+click
Posted: 14 Mar 2018, 05:37
Hello, this is my code:
This gets stuck sometimes: When i release the key "q" it doesn't stop. Doesn't happen all the time but it's annoying.
Tried this:
And got the same problem.
Tried this also:
The problem:
Sometimes when i hold down "q" it never stops spaming q+click.
Hope you can help me. Thank you!
Code: Select all
key:="q"
Hotkey, $%key%, Fkey
FKey:
StringTrimLeft thishotkey, a_thisHotkey, 1
Loop
{
if not GetKeyState(ThisHotkey, "P")
break
loop
{
Sendinput {%thisHotkey%}
Delay(0.005)
asd:=Readmemory(skill_address)
} until asd<>0
Delay(0.005)
sendinput {Click}
}
return
Tried this:
Code: Select all
key:="q"
Hotkey, $%key%, Fkey
Hotkey, $%key% up, Fkey2
FKey:
stop:=0
StringTrimLeft thishotkey, a_thisHotkey, 1
Loop
{
if stop=1
break
loop
{
Sendinput {%thisHotkey%}
Delay(0.005)
asd:=Readmemory(skill_address)
} until asd<>0
Delay(0.005)
sendinput {Click}
}
return
FKey2:
stop:=1
return
Tried this also:
Code: Select all
key:="q"
Hotkey, $%key%, Fkey
Hotkey, $%key% up, Fup
FKey:
settimer, spamkey, 10
return
spamkey:
StringTrimLeft thishotkey, a_thisHotkey, 1
Loop
{
if not GetKeyState(ThisHotkey, "P")
break
loop
{
Sendinput {%thisHotkey%}
Delay(0.005)
asd:=Readmemory(skill_address)
if a_index>10
auxbreak:=1
} until asd<>0 or a_index>10
if auxbreak=1
{
auxbreak:=0
break
}
Delay(0.005)
sendinput {Click}
}
return
Fup:
auxbreak:=1
settimer, spamkey, delete
return
Sometimes when i hold down "q" it never stops spaming q+click.
Hope you can help me. Thank you!