Help with simple script Topic is solved

Ask gaming related questions (AHK v1.1 and older)
mrquib

Help with simple script  Topic is solved

28 Apr 2017, 02:07

Apologies this is my first ever script so I hope this request makes sense.

I created this so that when I hold F5, it will repeatedly press F5 very quickly. Here's the script:


$F5:: ;
IfWinActive Ragnarok
{
Loop 1
{
Send {F5} ;
sleep 25
}
}
return

My problem is that when I press another key, the continuous F5 presses stop, even though I'm still holding the F5 key. I was wondering if there's a simple change I can make so that the repeated F5s won't stop when I press other keys...

Thanks in advance
Rohwedder
Posts: 7625
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Help with simple script

28 Apr 2017, 03:06

Hallo,
"Loop 1" does not make much sense.
Try:

Code: Select all

#IfWinActive Ragnarok
$F5:: ;starts only when Ragnarok is active
	Loop
	{
		Send {F5}
		sleep 25
	}
	Until, !GetKeyState("F5", "P")
return
or

Code: Select all

$F5::
	While, WinActive("Ragnarok")
	{ ;stops when Ragnarok is no longer active
		Send {F5}
		sleep 25
	}
	Until, !GetKeyState("F5", "P")
return
mrquib

Re: Help with simple script

28 Apr 2017, 12:55

It works. Thank you for your help!

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 26 guests