 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Tom Guest
|
Posted: Thu Aug 28, 2008 7:29 pm Post subject: Randomising the times a loop runs |
|
|
| 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
|
Posted: Thu Aug 28, 2008 8:26 pm Post subject: |
|
|
| 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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|