Sign in to follow this  
Followers 0
Ashww

sleep in minutes?

45 posts in this topic

how can i make a script sleep in minutes?

Or make it read a input which the user puts in a minute (e.g. 1) how would i get a script to add the 3 zeros on the end.

Cheers

Ashww

X)


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Projects: Account Control Wii style gui Bingo Caller - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Want a website? Click here!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -I use my Blackberry Storm to browse the forum! Please be patient!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Share this post


Link to post
Share on other sites



how can i make a script sleep in minutes?

Or make it read a input which the user puts in a minute (e.g. 1) how would i get a script to add the 3 zeros on the end.

Cheers

Ashww

X)

Is this a serious question and if so did you even try anything ?

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                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

Sleep takes a parameter in milliseconds. There are 1000 milliseconds in a second. There are 60 seconds in a minute. I hope you can do math.

Share this post


Link to post
Share on other sites

lol manadar :P your supposed to let them figure it out for them selves and hopefully they will learn something..... and BTW... we know about your bad ass math skillz...

Share this post


Link to post
Share on other sites

...Really?

Share this post


Link to post
Share on other sites

I spoiled the surprise...

SleepMins(3)

Func _SleepMins($num)
    Sleep(Number($num)*60*1000)
EndFuncoÝ÷ Ûú®¢×j}ý¶»§Ú''«®ì¢÷«êÞjëh×6C:\Ny AutoIt v3 Script (4).au3(1,12) : ERROR: SleepMins(): undefined function.
SleepMins(3)
~~~~~~~~~~~^

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Really... again..?

Cmon guys.. he even took the time to write the code.

_SleepMins(3) instead of SleepMins(3)....

_SleepMins(3)

Func _SleepMins($num)
    Sleep(Number($num)*60*1000)
EndFunc
Edited by CrewXp

Share this post


Link to post
Share on other sites

Because, as you can see, the function is declared _SleepMins but you're calling some other function that isn't exist "SleepMins". Change either so both the function declaration and the caller are using the same name.

Share this post


Link to post
Share on other sites

I saw that when Manadar posted it. I bet it was on purpose.

Share this post


Link to post
Share on other sites

Hmm, I would vote to add add the function to the <Date.au3> UDF!

Your not actually trying to start something here are you?

I lol'd

The proper way to do this is like so:

_SleepMinutes(3)

Func _SleepMinutes($Mins)
For $i = 1 to $Mins*1000*60
Sleep(1)
Next
EndFunc

Share this post


Link to post
Share on other sites

I lol'd

The proper way to do this is like so:

_SleepMinutes(3)

Func _SleepMinutes($Mins)
For $i = 1 to $Mins*1000*60
Sleep(1)
Next
EndFunc
You do know that will run for 30 minutes? (or was that the point?) :P

Share this post


Link to post
Share on other sites

You do know that will run for 30 minutes? (or was that the point?) :P

xD No, it doesn't.

It runs for 3 minutes +- interpreter dependant time.

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

If you replace Sleep with ConsoleWrite and output the number the max is 180000. Sleep each incrementation, 1*18000 = 18000 and divide that... Think about this.

Edit: Yes, I have probably mixed this up majorly.

Edited by JamesBrooks

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

If you replace Sleep with ConsoleWrite and output the number the max is 180000. Sleep each incrementation, 1*18000 = 18000 and divide that... Think about this.

There is no Sleep(1). All values between 1-9 will be 10 so it will be 3*1000*60*10 and that equals 30 minutes!! Edited by AdmiralAlkex

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