Arienda Posted December 1, 2009 Posted December 1, 2009 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
picea892 Posted December 2, 2009 Posted December 2, 2009 I think you may need to change to the _ispressed function in order to accomplish that task. Look it up in the help
jebus495 Posted December 2, 2009 Posted December 2, 2009 $rand=Random(200,500) sleep($rand) Can be turned into: sleep(Random(200,500))
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now