Script that hits a key and left-clicks

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Konaka54

Script that hits a key and left-clicks

01 Jun 2017, 08:21

I keep trying to make this (simple) script but I never manage to get it to work. Could you help with making it?

I need a script that constantly spams Q and left-clicks every about 5 seconds without stopping at any time(except when I turn off the script).
User avatar
divanebaba
Posts: 805
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: Script that hits a key and left-clicks

25 Jun 2017, 22:12

Try this.
Copy the the code into an empty text- or ahk-script-file and name it like you want. For text files you have to rename the ending from .txt to .ahk
Doubleclick to run script. Position your cursor, where you want to send the Q char. Press F6 to start spamming. Press F7 to stop spamming.

Code: Select all

$F6:: ; starting script by pressing key F6
breakthis = ; empty this variable to loop further
loop
{
	sleep 5000 ; sleeps 5000 ms
	sendinput Q ; sending Q char
	sendinput {LButton} ; sending left mouse button click
	if (breakthis) ; needed to stop the script. Otherwise it could be difficult to stop the script
	break

}

$F7:: ; stopping the script by pressing key F7
	breakthis = 1
return
Nice spammings from Germany :D :D
Einfach nur ein toller Typ. :mrgreen:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, Google [Bot], WAZAAAAA and 417 guests