I want to start an other usehook with my first usehook

Ask gaming related questions (AHK v1.1 and older)
Drughen
Posts: 2
Joined: 08 May 2021, 12:55

I want to start an other usehook with my first usehook

08 May 2021, 13:13

Hi,

I want to start another hotkey with my first hotkey but it just writes 2 instead of starting the second usehook, se example below

Example:

#UseHook
return
1::
send, 1
sleep, 92
send, abc
sleep, 105
send, 2 <---- i want this send 2 to start the usehook below how do i do that?
return
#UseHook off

#UseHook
return
2::
send, 2
sleep, 92
send, dfg
return
#UseHook off
User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: I want to start an other usehook with my first usehook

08 May 2021, 14:33

To send the same key as the hotkey, you can precede the hotkey with $ (just an alternative). To call another routine, use Gosub.
Drughen
Posts: 2
Joined: 08 May 2021, 12:55

Re: I want to start an other usehook with my first usehook

08 May 2021, 23:22

Thx taht works but it didnt solve my real problem.

The thing i wanna be able to do is to push 1 again and restart the usehook 1 again before usehook 2 is finnished. the real usehook 2 is a minute or so long and now i cant push the 1 button again until that is finnished.
User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: I want to start an other usehook with my first usehook

09 May 2021, 04:53

Code: Select all

#MaxThreadsPerHotkey 2
$1::
two := False
Send 1
Sleep, 92
Send abc
Sleep, 105
Gosub, $2
two := False
Return

$2::
two := True
Loop, 5 {
 Send 2
 Sleep, 92 * two
 Send % two ? "dfg" : ""
} Until !two
Return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 103 guests