AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

is it possible to queue processes in AHK?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
ifckladyluck



Joined: 20 Jan 2009
Posts: 16

PostPosted: Sat Jan 24, 2009 9:30 pm    Post subject: is it possible to queue processes in AHK? Reply with quote

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
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Sat Jan 24, 2009 9:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
ifckladyluck



Joined: 20 Jan 2009
Posts: 16

PostPosted: Sat Jan 24, 2009 9:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
evan
Guest





PostPosted: Sat Jan 24, 2009 10:24 pm    Post subject: Reply with quote

?
Code:
loop
{
random, rand, 1,2
sleep %rand%
click
sleep 500
}
Back to top
evan
Guest





PostPosted: Sat Jan 24, 2009 10:25 pm    Post subject: Reply with quote

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

PostPosted: Sun Jan 25, 2009 12:41 am    Post subject: Reply with quote

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
View user's profile Send private message
n-l-i-d
Guest





PostPosted: Sun Jan 25, 2009 12:14 pm    Post subject: Reply with quote

Try using timers instead.

HTH
Back to top
evan
Guest





PostPosted: Sun Jan 25, 2009 3:55 pm    Post subject: Reply with quote

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
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group