Search found 7 matches
- 30 Mar 2017, 11:10
- Forum: Ask for Help (v1)
- Topic: send not working inside a loop while another key is held down? Topic is solved
- Replies: 2
- Views: 723
Re: send not working inside a loop while another key is held down? Topic is solved
it works for me.... here's what I tested sleep 5000 ;gives me 5 seconds to click over to notepad or something to type in.... toggle = 1 Loop 10 { If ( toggle = 1 ) { send {Left down} Sleep 100 send {d down} Sleep 100 send {d up} ;more script } } generates 10 'd's with the cursor at the left. Weird....
- 30 Mar 2017, 00:42
- Forum: Ask for Help (v1)
- Topic: send not working inside a loop while another key is held down? Topic is solved
- Replies: 2
- Views: 723
send not working inside a loop while another key is held down? Topic is solved
Hello, In this script: Loop { If ( toggle = 1 ) { send {Left down} Sleep 100 send {d down} Sleep 100 send {d up} ;more script { } While the left key is being held down, it seems that it won't let me send other key strokes. In this case the d key just doesn't work. What's the workaround this issue? t...
- 21 Mar 2017, 07:39
- Forum: Ask for Help (v1)
- Topic: sleeping inside a function? Topic is solved
- Replies: 5
- Views: 1053
Re: sleeping inside a function? Topic is solved
My knowledge with AHK is pretty mediocre, and I'm just going on a hunch here. But randW and randF look like variables to me (at least I haven't heard of any AHK instructions named that way, with my current knowledge). In which case they need to be global variables in order for the function to read ...
- 21 Mar 2017, 07:34
- Forum: Ask for Help (v1)
- Topic: sleeping inside a function? Topic is solved
- Replies: 5
- Views: 1053
Re: sleeping inside a function? Topic is solved
It's declared at the beginning of the script like this;Albireo wrote:Where or what is the value of randW?
Code: Select all
Random, randW, 2723, 3233
Random, randF, 154, 533
- 21 Mar 2017, 07:14
- Forum: Ask for Help (v1)
- Topic: sleeping inside a function? Topic is solved
- Replies: 5
- Views: 1053
sleeping inside a function? Topic is solved
Hi, It seems that "sleep" for x doesn't work when i put it inside a function, it just infinitely spams both keys, like this: Loop { if ( toggle = 1 ) { buttonCycle() } } Return buttonCycle() { Send {Left down} sleep randW Send {Left up} sleep randF Send {Right down} sleep randW Send {Right up} } Ret...
- 20 Mar 2017, 12:17
- Forum: Ask for Help (v1)
- Topic: Execute a block of code multiple times in a single line? Topic is solved
- Replies: 2
- Views: 870
Re: Execute a block of code multiple times in a single line? Topic is solved
Thanks, i tried that before but i must have mistyped something. Your example helped me!A_AhkUser wrote:see https://autohotkey.com/docs/Functions.htmCode: Select all
MyFunc() { Send {a} Send {b} Send {c} } ; run % A_WinDir . "/notepad.exe" WinActivate, ahk_class Notepad MyFunc() sleep, 1000 MyFunc() sleep, 1000 MyFunc()
- 20 Mar 2017, 12:02
- Forum: Ask for Help (v1)
- Topic: Execute a block of code multiple times in a single line? Topic is solved
- Replies: 2
- Views: 870
Execute a block of code multiple times in a single line? Topic is solved
Hi, I'm sorry but i'm not sure what to call this in a specific word but i'll try to explain it as much as i simply can. So i have these lines of code for example: { Send {a} Send {b} Send {c} } And i want to be able to use it any time i want inside a single .ahk file without having to type it out ag...