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 

Randomising the times a loop runs

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Tom
Guest





PostPosted: Thu Aug 28, 2008 7:29 pm    Post subject: Randomising the times a loop runs Reply with quote

Hi, im running a script that clicks, runs a loop a few times, runs another loop a few times, then loops the whole script over and over. All i'm left to do in modifying this is randomise the number of times each script runs, between 3 and 10. I'v tried to build a function but with no sucsess. Can anybody help me?
Back to top
[VxE]



Joined: 07 Oct 2006
Posts: 1496

PostPosted: Thu Aug 28, 2008 8:26 pm    Post subject: Reply with quote

Code:
Loop % Rand( 1, 5 )
   msgbox %A_Index% times.
return

Rand( l, h )
{
   Random, ov, %l%, %h%
   return ov
}

_________________
My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags !
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   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