script request Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
zeonyfox
Posts: 6
Joined: 28 Aug 2019, 00:33

script request

25 Sep 2019, 22:15

Hello, beggar here 8-) . I need a script that will cause the Tab key to input the following actions:

2 key
(.1 second delay)
1 key
(.1 second delay)
2 key
(.1 second delay)
1 key
(.1 second delay)
2 key
(.1 second delay)
1 key
(.1 second delay)
2 key
(.1 second delay)
1 key

Thanks bros
User avatar
Dumitas
Posts: 167
Joined: 14 Dec 2017, 21:32

Re: script request  Topic is solved

26 Sep 2019, 00:08

This should do:

Code: Select all

Tab::
Send, {2}
Sleep, 100 ;100ms = 0.1 seconds
Send, {1}
Sleep, 100
Send, {2}
Sleep, 100
Send, {1}
Sleep, 100
Send, {2}
Sleep, 100
Send, {1}
Sleep, 100
Send, {2}
Sleep, 100
Send, {1}
Sleep, 100
return
Image
zeonyfox
Posts: 6
Joined: 28 Aug 2019, 00:33

Re: script request

26 Sep 2019, 01:02

@Dumitas Hey I remember you helped me last time time too. The script works exactly as I requested, thank you.
User avatar
boiler
Posts: 9195
Joined: 21 Dec 2014, 02:44

Re: script request

26 Sep 2019, 09:26

In case you do more of these and want more compact code, here are a couple of other approaches:

Code: Select all

Num := [2, 1, 2, 1, 2, 1, 2, 1]

Tab::
	loop, % Num.MaxIndex()
	{
		Send, % Num[A_Index]
		Sleep, 100
	}
return


Code: Select all

Tab::
	loop, 8
	{
		Send, % (Num := (Num != 2 ? 2 : 1))
		Sleep, 100
	}
return

Return to “Ask For Help”

Who is online

Users browsing this forum: AHKStudent, dpfbin2, Rohwedder, teadrinker, whynotregister, william_ahk, Xtra and 43 guests