Reputation: 101
I have read previous similar article and tried as there adviced. But it doesn't work for me. Or I missing something? I tried many syntax variations.
keydelay := 1000
^z::
PlayQueue([1,2,3,"q","e"])
return
PlayQueue(queue)
{
global keydelay
for i, k in queue
Send, %k%
Sleep %keydelay%
}
Its just fires instantly without delays :/
Upvotes: 0
Views: 380
Reputation: 6489
You can only omit { }
if you have a single line statement.
Your for loop's body has two lines, so you'll need braces.
PlayQueue(queue)
{
global keydelay
for i, k in queue
{
Send, %k%
Sleep, %keydelay%
}
}
Upvotes: 1