#InstallKeybdHook #SingleInstance force #MaxThreadsPerHotkey 2 dir = %A_Appdata%\KeySpammer inifile = KeySettings speckeys = {LControl}{RControl}{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}{AppsKey}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Space}{Home}{End}{PgUp}{PgDn}{Del}{Ins}{BS}{Capslock}{TAB}{Numlock}{PrintScreen}{Pause} ifNotExist %dir% { FileCreateDir, %dir% FileInstall, C:\Users\runbo130297\Dropbox\KeySpammer\toggleon.wav, %dir%\toggleon.wav FileInstall, C:\Users\runbo130297\Dropbox\KeySpammer\toggleoff.wav, %dir%\toggleoff.wav } IniRead, Key, %dir%\%inifile%.ini, Settings, SpamKey IniRead, CPS, %dir%\%inifile%.ini, Settings, CPS if (Key = "ERROR" or not Key) { IniWrite, F5, %dir%\%inifile%.ini, Settings, Spamkey Key := "F5" } if (CPS = "ERROR" or not CPS) { IniWrite, 30, %dir%\%inifile%.ini, Settings, CPS CPS = 30 } Gui, Font, s8, Tahoma Gui, Add, Text, x8 y8, Key: Gui, Add, Button, y3 x31 h23 w75 gGetSpamKey, SpamKey Gui, Add, Text, x9 y35, at Gui, Add, Edit, x23 y31 w33 Limit Number R1 vCPS, %CPS% Gui, Add, Text, x59 y35, clicks/sec Gui, Add, Text, x14, Press F7 to start! Gui Show, AutoSize, Spam it! GuiControl,, SpamKey, %Key% Gui, -0x20000 return $F7:: Gui, Submit, NoHide if not CPS { MsgBox,, Error, You have to enter a frequency. return } GuiControl, Disabled, %Key% GuiControl, Disabled, %CPS% if speckeys contains %Key% SpamKey := "{" Key "}" else if Key := "Delete" SpamKey := "{Del}" else SpamKey := Key sleepms := 1000 / CPS sleepms := Floor(sleepms) toggle := !toggle if (toggle) { GuiControl, Move, Press, x37 GuiControl,, Press, Running! SoundPlay, %dir%\toggleon.wav } else { GuiControl,, Running!, Press F7 to start! GuiControl, Move, Press F7 to start!, x14 SoundPlay, %dir%\toggleoff.wav } loop { if (toggle) SendInput %SpamKey% else { GuiControl, Enabled, %Key% GuiControl, Enabled, %CPS% Break } sleep %sleepms% } return GetSpamKey: GuiControl,, Press, Press a key! GuiControl, Move, Press, x28 GuiControl, Disabled, %Key% GuiControl, Focus, Press PreKey := Key Input, Key, L1 B, %speckeys% if not Key StringTrimLeft, Key, ErrorLevel, 7 GuiControl,, %PreKey%, %Key% GuiControl, Enabled, %Key% GuiControl,, Press, Press F7 to start! GuiControl, Move, Press, x14 return GuiEscape: GuiClose: Gui, Submit IniWrite, %Key%, %dir%\%inifile%.ini, Settings, Spamkey IniWrite, %CPS%, %dir%\%inifile%.ini, Settings, CPS ExitApp return