i need help code

Ask gaming related questions (AHK v1.1 and older)
juanll2002
Posts: 9
Joined: 29 Sep 2022, 03:49

i need help code

Post by juanll2002 » 01 Oct 2022, 05:36

need help stay pressed key A and hold down for 10 seconds,stop later press the left arrow key for 1 second and repeat the same until deactivation tranks for help


Consider the following

Code: Select all

#UseHook On

x::
KeyWait x
n := TRUE
While (n)
{
    Send {a down}
    Sleep 10000
    Send {a up}
    Send {right down}
    sleep 2000	
    Send {right up}
    
}
Return

3:: n := FALSE
[Mod edit: [code][/code] tags added.]

User avatar
mikeyww
Posts: 26856
Joined: 09 Sep 2014, 18:38

Re: i need help code

Post by mikeyww » 01 Oct 2022, 06:14

Code: Select all

OnExit("done")

#MaxThreadsPerHotkey 2
F3::
on := !on
SoundBeep, 1000 + 500 * on
While on {
 Send {a down}
 Loop, 20
  Sleep, 500 * on
 Send % "{a up}" (on ? "{Left down}" : "")
 Loop, 2
  Sleep, 500 * on
 Send {Left up}
}
Return

done(exitReason, exitCode) {
 Send {a up}{Left up}
 SoundBeep, 1900
}

juanll2002
Posts: 9
Joined: 29 Sep 2022, 03:49

Re: i need help code

Post by juanll2002 » 01 Oct 2022, 14:38

@mikeyww

friend without beep sound and activate with one key and deactivate with other as well as shipping Thank you

Code: Select all

#UseHook On

x::
KeyWait x
n := TRUE
While (n)
{
    Send a
    Sleep 50
}
Return

3:: n := FALSE
Last edited by joedf on 01 Oct 2022, 14:53, edited 1 time in total.
Reason: [code] tags

User avatar
mikeyww
Posts: 26856
Joined: 09 Sep 2014, 18:38

Re: i need help code

Post by mikeyww » 01 Oct 2022, 14:55

Hello,

You can use any hotkey to set the toggle variable (e.g., on) to False. An example is found in your script. You can remove the SoundBeep command if you wish. Enjoy!

In terms of shipping, if you post your mailing address, I will print the script and ship it to you.

Post Reply

Return to “Gaming Help (v1)”