Hey there i'm trying to understand why does this script not work

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Maor_S
Posts: 3
Joined: 22 Apr 2018, 06:30

Hey there i'm trying to understand why does this script not work

22 Apr 2018, 06:34

::F2
{
While(1==1)
{
{SPACE down}{A down}
Sleep , 500

{SPACE up}{A up}


{SPACE down}{D down}
Sleep , 500

{SPACE up}{D up}



}


}


Cheers would appreciate if you would fix it :)
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

Re: Hey there i'm trying to understand why does this script not work

22 Apr 2018, 07:26

::F2 - you reverted it, should be F2::.
{SPACE down}{A down} - this is invalid. See Send.
While(1==1) - this will cause infinite loop after pressing the hotkey for first time. You may want to do some kind of toggle.
Ps. true instead of 1==1 is more elegant.
Use

Code: Select all

[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.
Maor_S
Posts: 3
Joined: 22 Apr 2018, 06:30

Re: Hey there i'm trying to understand why does this script not work

22 Apr 2018, 08:07

SirRFI wrote:::F2 - you reverted it, should be F2::.
{SPACE down}{A down} - this is invalid. See Send.
While(1==1) - this will cause infinite loop after pressing the hotkey for first time. You may want to do some kind of toggle.
Ps. true instead of 1==1 is more elegant.
Thanks alot mate Cheers :D
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

Re: Hey there i'm trying to understand why does this script not work

22 Apr 2018, 09:46

Looks like UTF-8 BOM is appending to your Hotkey. Run the script using Unicode version, such as U32. Moving the hotkey out from first line may be in help too.
Use

Code: Select all

[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 247 guests