need to add sleep to script

Ask gaming related questions (AHK v1.1 and older)
mdrake
Posts: 10
Joined: 26 Mar 2019, 16:10

need to add sleep to script

Post by mdrake » 04 Jun 2023, 22:26

Hi i'm looking to add a sleep to this script. I want to add a 1 sec sleep after i hit mouse wheel down once and it hits 2 and when it lets me do it again to hit h.2h2h

Code: Select all

~Wheeldown::
  if (toggle := !toggle)
    send 2
  else
    send h
[Mod edit: [code][/code] tags added.]

Thanks.
Last edited by gregster on 04 Jun 2023, 23:17, edited 1 time in total.
Reason: Looks like AHK v1 code. Moved from v2 help...

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

Re: need to add sleep to script

Post by Rohwedder » 05 Jun 2023, 01:32

Hallo,
your second sentence with the two "and" is ambiguous! Perhaps?:

Code: Select all

~Wheeldown::
if (toggle := !toggle)
	send 2
else
	send h
Sleep, 1000
Return

mdrake
Posts: 10
Joined: 26 Mar 2019, 16:10

Re: need to add sleep to script

Post by mdrake » 05 Jun 2023, 09:37

Thanks, that works

Post Reply

Return to “Gaming Help (v1)”