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

Get help with using AutoHotkey 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: 367
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=autohotkey] forum tag to share your code.
Click on (Accept this answer) 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
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, 09:07

swagfag wrote:https://autohotkey.com/docs/Hotkeys.htm#Intro

http://prntscr.com/j8kx2i
what should i do ?
SirRFI
Posts: 367
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=autohotkey] forum tag to share your code.
Click on (Accept this answer) on top-right part of the post if it has answered your question / solved your problem.

Return to “Ask For Help”

Who is online

Users browsing this forum: Gandalf_yayo and 39 guests