| View previous topic :: View next topic |
| Author |
Message |
ifckladyluck
Joined: 20 Jan 2009 Posts: 16
|
Posted: Sat Jan 24, 2009 9:30 pm Post subject: is it possible to queue processes in AHK? |
|
|
i am trying to do somethign that is logically equivalent to the code below. is this possible with AHK?
| Code: | loop
{
randomNumber
click mouse button in RandomNumber seconds
sleep 500
} |
|
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Sat Jan 24, 2009 9:35 pm Post subject: |
|
|
| Code: | Loop {
Random, x, 1, %A_ScreenWidth%
Random, y, 1, %A_ScreenHeight%
Click %x% %y%
Sleep 500
} |
_________________ URLGet - Internet Explorer based Downloader |
|
| Back to top |
|
 |
ifckladyluck
Joined: 20 Jan 2009 Posts: 16
|
Posted: Sat Jan 24, 2009 9:48 pm Post subject: |
|
|
this just clicks in a random location every half second. what I am interested in is for it to somehow assign a mouseclick in RND amount of seconds with every loop.
so, for example:
first loop
random number = 2
will click mouse button in two seconds
sleep .5 seconds
second loop
random number = 1
will click mouse button in one second
sleep .5 seconds
so in this example the 2nd click will come before the 1st. is something like this possible with AHK, or maybe theres a better way to do it? |
|
| Back to top |
|
 |
evan Guest
|
Posted: Sat Jan 24, 2009 10:24 pm Post subject: |
|
|
?
| Code: | loop
{
random, rand, 1,2
sleep %rand%
click
sleep 500
} |
|
|
| Back to top |
|
 |
evan Guest
|
Posted: Sat Jan 24, 2009 10:25 pm Post subject: |
|
|
ops, missing *1000
correction:
| Code: | loop
{
random, rand, 1,2
rand := rand * 1000
sleep %rand%
click
sleep 500
} |
|
|
| Back to top |
|
 |
ifckladyluck
Joined: 20 Jan 2009 Posts: 16
|
Posted: Sun Jan 25, 2009 12:41 am Post subject: |
|
|
| thanks evan, sort of the idea im looking for but the problem with that code is that it is still linear, ie. 2nd loop click cant happen before 1st loop click |
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Sun Jan 25, 2009 12:14 pm Post subject: |
|
|
Try using timers instead.
HTH |
|
| Back to top |
|
 |
evan Guest
|
Posted: Sun Jan 25, 2009 3:55 pm Post subject: |
|
|
| Code: | settimer, aa, 500
settimer, bb, 500
return
aa:
random, rand1, 1,2
rand := rand * 1000
sleep %rand1%
click
return
bb:
random, rand, 1,2
rand := rand * 1000
sleep %rand%
click
return |
|
|
| Back to top |
|
 |
|