Sign in to follow this  
Followers 0
Wabbit

Random timer?

8 posts in this topic

Hello! I'm new to AutoIT and scripting in general, but I am really amazed at this product! I could use some help on this:

How can I make a random time monitor? Something that would pick a random amount of minutes, say between 30 and 90, wait that amount of time, then complete the program?

Thanks!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hello! I'm new to AutoIT and scripting in general, but I am really amazed at this product! I could use some help on this:

How can I make a random time monitor? Something that would pick a random amount of minutes, say between 30 and 90, wait that amount of time, then complete the program?

Thanks!

this will pause randomly 30 to 90 minutes ...

sleep(Random(30,90)*60*1000)
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

this will pause randomly 30 to 90 minutes ...

sleep(Random(30,90)*60*1000)
Hey, cool! What are the other entries (*60*1000)?

Thanks!

Share this post


Link to post
Share on other sites

HI,

sleep is millisec that way you get minutes.

So long,

Mega

PS: To get minutes without sec look at the 3 parameter of Random!


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

I suppose you have figured it out already but you know 1h=60min=60000ms

1h=60min=3600000

1min=60000

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Ah, I get it. The *60*1000 multiplies the value so you don't have to list in miliseconds. Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0