Jump to content

Spam Button On Key Down


Arienda
 Share

Recommended Posts

I'm trying to write a program to spam a designated key when i hold down a key. The current program i have words but it has more of a toggle feature.

What could i do to only spam 1 when i hold down the ` key and stop spamming when i let go of the ` key. I also made it where if i didn't target the right window it sends they key normally.

Opt('SendKeyDownDelay', 50)
HotKeySet("{end}","stop")

Global $sendKey, $rand

HotKeySet("{`}", "spamthebutton")

While 1
    Sleep(100)
WEnd

Func spamthebutton()
    $sendKey = NOT $sendKey
    
    if WinActive("World of Warcraft") then
        While $sendKey
            $rand=Random(200,500)
            sleep($rand)
            Send("1")
        WEnd
    Else
        Send("`")
    EndIf

EndFunc

func stop()
    Exit
endfunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...