Jump to content
Sign in to follow this  
Wabbit

Random timer?

Recommended Posts

Wabbit

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
Jos

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Wabbit

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
Xenobiologist

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
Valuater

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
Wabbit

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  

×