Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Loop gets stuck


  • Please log in to reply
2 replies to this topic
Camere
  • Guests
  • Last active:
  • Joined: --
I'm attempting to use a script to simply create a turbo hotkey for a button on my keyboard, and it's working, however the script will very often seemingly not realize that the key has been released. The loop will get stuck until press the button a couple times to get the script to realize that the button is no longer held down.

I've tried using both of these scripts:

$F::
Loop  
{
    if not GetKeyState("F", "P")  
        break  
	send f
}
return

and

$F1::
while GetKeyState("F1", "P")  ; While the F1 key is being held down physically.
{
    Click
}
return

I've tried adding sleep to the script to make the the script less spammy, however the same thing continues to happen.

How can i make the script more reliably realize that the button is no longer being held down? It happens way too often (literally 50% of the time I press the button the script continues to spam the script even after I release the button)

Camere
  • Guests
  • Last active:
  • Joined: --
Sorry, second script is supposed to be

$f::
while GetKeyState("f", "P")
{
    send f
}
return


Ohnitiel
  • Members
  • 755 posts
  • Last active: Sep 08 2016 06:26 PM
  • Joined: 25 Aug 2011
Sorry, but this fact is not true for me. I even tried holding to see if it would get stuck, but that actually turned of my PC at around the 1700 time it sent (I think it did that as a emergency, believing hat the key was stuck).