Need help with script that automatics clicks arrow-keys Topic is solved
Need help with script that automatics clicks arrow-keys Topic is solved
Hello,
I'm in search of a script that can automatic click arrow keys in order, it's for a game
The list of the arrow keys is listed as follow:
"1.downrightdown
4.downrightright
7.rightdownleft
10.uprightup
13.upupleft
16.downleftdown
19.rightdownleft
22.upupup
25.rightdownright
28.downleftleft
31.leftleftdown
34.downrightup
37.rightdownright
40.upupleft
and more..."
how can i make it that it automaticly click arrow keys from up to down, so in this case": down, right, down , down , right, right etc
Is it also possible to make a "random" amount of ms between the keyclicks?
Sorry for the confusing question.
I'm in search of a script that can automatic click arrow keys in order, it's for a game
The list of the arrow keys is listed as follow:
"1.downrightdown
4.downrightright
7.rightdownleft
10.uprightup
13.upupleft
16.downleftdown
19.rightdownleft
22.upupup
25.rightdownright
28.downleftleft
31.leftleftdown
34.downrightup
37.rightdownright
40.upupleft
and more..."
how can i make it that it automaticly click arrow keys from up to down, so in this case": down, right, down , down , right, right etc
Is it also possible to make a "random" amount of ms between the keyclicks?
Sorry for the confusing question.
Re: Need help with script that automatics clicks arrow-keys
Code: Select all
F3:: ; F3 = Trigger this subroutine
Send {Down}{Right}{Down}
Random, rand, 15, 150
Sleep, rand
Send {Down}{Right 2}
Return
Re: Need help with script that automatics clicks arrow-keys
Thank you!mikeyww wrote: ↑01 Apr 2022, 13:20Code: Select all
F3:: ; F3 = Trigger this subroutine Send {Down}{Right}{Down} Random, rand, 15, 150 Sleep, rand Send {Down}{Right 2} Return
Do you know how to add random delay to every button instead of adding "Random, rand, 15, 150" to each line?
So i can paste comething like this:
Code: Select all
{Left}{Left}{Down}
{Right}{Down}{Right}
{Up}{Left}{Down}
{Left}{Up}{Right}
{Right}{Down}{Left}
{Up}{Up}{Left}
{Down}{Down}{Right}
{Right}{Up}{Left}
{Down}{Left}{Up}
{Right}{Right}{Down}
{Left}{Down}{Right}
{Up}{Up}{Left}
{Down}{Right}
Re: Need help with script that automatics clicks arrow-keys
Code: Select all
str =
(
{Left}{Left}{Down}
{Right}{Down}{Right}
{Up}{Left}{Down}
{Left}{Up}{Right}
{Right}{Down}{Left}
{Up}{Up}{Left}
{Down}{Down}{Right}
{Right}{Up}{Left}
{Down}{Left}{Up}
{Right}{Right}{Down}
{Left}{Down}{Right}
{Up}{Up}{Left}
{Down}{Right}
)
For each, key in StrSplit(Trim(str, "{"), "{", "`n}") {
Random, rnd, 15, 150
Send {%key%}
Sleep, rnd
}
MsgBox, 64, Done, Done!
Re: Need help with script that automatics clicks arrow-keys
Thanks but i have no idea how i make that work with the script you postedmikeyww wrote: ↑16 May 2022, 14:52Code: Select all
str = ( {Left}{Left}{Down} {Right}{Down}{Right} {Up}{Left}{Down} {Left}{Up}{Right} {Right}{Down}{Left} {Up}{Up}{Left} {Down}{Down}{Right} {Right}{Up}{Left} {Down}{Left}{Up} {Right}{Right}{Down} {Left}{Down}{Right} {Up}{Up}{Left} {Down}{Right} ) For each, key in StrSplit(Trim(str, "{"), "{", "`n}") { Random, rnd, 15, 150 Send {%key%} Sleep, rnd } MsgBox, 64, Done, Done!
Re: Need help with script that automatics clicks arrow-keys
The way to make it work is to run the script!
Re: Need help with script that automatics clicks arrow-keys
Is there also a way to add random delay (between 80 ms and 130 for an example for each key)which how long a key is pressed? on https://blog.seethis.link/scan-rate-estimator/ it says 1ms what impossible is to do with a "real" keyboardmikeyww wrote: ↑16 May 2022, 14:52Code: Select all
str = ( {Left}{Left}{Down} {Right}{Down}{Right} {Up}{Left}{Down} {Left}{Up}{Right} {Right}{Down}{Left} {Up}{Up}{Left} {Down}{Down}{Right} {Right}{Up}{Left} {Down}{Left}{Up} {Right}{Right}{Down} {Left}{Down}{Right} {Up}{Up}{Left} {Down}{Right} ) For each, key in StrSplit(Trim(str, "{"), "{", "`n}") { Random, rnd, 15, 150 Send {%key%} Sleep, rnd } MsgBox, 64, Done, Done!
I really appreciate your help
Re: Need help with script that automatics clicks arrow-keys
Yes. See https://www.autohotkey.com/docs/commands/Send.htm#Repeating_or_Holding_Down_a_Key
You can then generate a new Random number and use it for a new Sleep. An alternative is SetKeyDelay.
You can then generate a new Random number and use it for a new Sleep. An alternative is SetKeyDelay.
Re: Need help with script that automatics clicks arrow-keys
I don't know how i can add that to the script, sorrymikeyww wrote: ↑25 May 2022, 13:58Yes. See https://www.autohotkey.com/docs/commands/Send.htm#Repeating_or_Holding_Down_a_Key
You can then generate a new Random number and use it for a new Sleep. An alternative is SetKeyDelay.
Re: Need help with script that automatics clicks arrow-keys
Code: Select all
For each, key in StrSplit(Trim(str, "{"), "{", "`n}") {
Random, pressDuration, 15, 150
Random, afterRelease , 15, 150
SetKeyDelay, afterRelease, pressDuration
Send {%key%}
}
Re: Need help with script that automatics clicks arrow-keys
Yes! Works great! Thanks again and have a nice daymikeyww wrote: ↑25 May 2022, 14:28Code: Select all
For each, key in StrSplit(Trim(str, "{"), "{", "`n}") { Random, pressDuration, 15, 150 Random, afterRelease , 15, 150 SetKeyDelay, afterRelease, pressDuration Send {%key%} }