Need help with if/else condition in #Persistent.

Get help with using AutoHotkey and its commands and hotkeys
newcoder19
Posts: 4
Joined: 22 Oct 2019, 17:01

Need help with if/else condition in #Persistent.

22 Oct 2019, 20:42

Hello all,

I would like to ask for help with the script below. I want the script to Send 1 if F8 is press. I have searched but couldn't find how to add if/else inside #Persistent.

#Persistent
SetTimer, PressTheKey, 1000
Return

PressTheKey:
if (keyword = F8)
Send, {1}
Return

Thanks,
Hellbent
Posts: 712
Joined: 23 Sep 2017, 13:34

Re: Need help with if/else condition in #Persistent.

22 Oct 2019, 20:49

Hi NewCoder.

There seems to be a discrepancy between what you said you wanted and what the script you supplied is doing.

So here's both

Code: Select all

F8::Send, 1

Code: Select all

#Persistent
SetTimer, PressTheKey, 1000
Return

PressTheKey:
	if(GetKeyState("F8","P"))
		send, 1
	return

Return to “Ask For Help”

Who is online

Users browsing this forum: CheshireCat, flyingDman, Google [Bot], TAC109 and 163 guests