Sign in to follow this  
Followers 0
alinashul

Sleep () Help

20 posts in this topic

#1 ·  Posted (edited)

Hello ,

I whant to make something like , lets say a InputBox where user inputs a delay ( sleep) in SECONDS

Ex :

$delay = InputBox ( "Delay " , "Input your delay below , IN SECONDS")

This $delay will go into a Sleep ()

But as we all know Sleep() works with milliseconds , how do i transform those seconds in miliseconds ? and get those transformed milliseconds in the Sleep ()

Thank you

Edited by alinashul

Share this post


Link to post
Share on other sites



how would you do it on your calculator?

well i guess the seconds that that users inputs multiplicated with 1000 no ?

ex : 5*1000 = 5000 miliseconds ......

But i dont know how to write a code to do that :)

Share this post


Link to post
Share on other sites

Jos don't tease him :-)

$delay = InputBox ( "Delay " , "Input your delay below , IN SECONDS")

Sleep($delay * 1000)
OMG OMG , ok now im embarrassed , IT WAS SO EASY , i coul not think of this think not in a milion years :party:

thank you and sry for wasting your time :)

Share this post


Link to post
Share on other sites

Jos don't tease him :-)

I am not teasing, just trying to force people to think and try something themselves before posting questions like this.

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

#7 ·  Posted (edited)

I am not teasing, just trying to force people to think and try something themselves before posting questions like this.

Jos , sometimes the simplest things u cant do it .... that's the life , i was thinking about something like with the loop For...To...Step...Next xD Edited by alinashul

Share this post


Link to post
Share on other sites

Jos , sometimes the simplest things u cant do it .... that's the life , i was thinking about something like with the loop For...To...Step...Next xD

Sounds like you have spend some time on reading up on programming but skipped the basics pages? :)

I wasn't really trying to put you on the stop personally, just trigger the "grey cells" with my question.


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

Sounds like you have spend some time on reading up on programming but skipped the basics pages? :)

I wasn't really trying to put you on the stop personally, just trigger the "grey cells" with my question.

i know nothing about programming languages :party:) i just know a bit of autoit ( because its simple to learn :idea:) and the help file is GODLIKE )

and probably because i'm so tired :P) all day working on this program :P)

Share this post


Link to post
Share on other sites

in your shoes ..

i would have ended up doing something like

$delay = imput....

$delay = delay * 1000

sleep($delay)

but thats only coz im half asleep and my personal script is debugging so

the sleep function will not work .. meaning im gonna overlay tomorrow >.<


Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Share this post


Link to post
Share on other sites

$multiple = InputBox ( "Delay " , "Input your delay below , IN SECONDS")

for $i = 1 to $multiple

sleep(1000)

next

Share this post


Link to post
Share on other sites

send("{LWIN}")
Send("{UP}")
send("{ENTER}")
Send("{RIGHT}")
Send("{ENTER}")

Same here thanks alot thornhunt lol


Share this post


Link to post
Share on other sites
:) now why would anyone use that? :party: actually taht only works on WIN XP HOME....

Share this post


Link to post
Share on other sites

Jos , sometimes the simplest things u cant do it .... that's the life , i was thinking about something like with the loop For...To...Step...Next xD

I think you should have spent some time thinking about how to convert between seconds and miliseconds. I do believe (without looking) the helpfile even comments on converting...

Cheers,

Brett

Share this post


Link to post
Share on other sites

OMG OMG , ok now im embarrassed , IT WAS SO EASY , i coul not think of this think not in a milion years :idea:

thank you and sry for wasting your time :party:

If fact it was too easy. Therefor it's cheating and you are obliged to come up with an involuted solution immediately!! :)

Share this post


Link to post
Share on other sites

:party: now why would anyone use that? :idea: actually taht only works on WIN XP HOME....

Do you never know what you are ralking about? :) Windows XP Professional has the same shutdown dialog. The other versions probably has it too.

Share this post


Link to post
Share on other sites

this also give me an idea for a diferent script slightly i dont like working in miliseconds so this will help

$delay = InputBox ( "Delay " , "Input your delay below , IN SECONDS")

MsgBox(1,"mili",$delay * 1000)

Share this post


Link to post
Share on other sites

Do you never know what you are ralking about? :) Windows XP Professional has the same shutdown dialog. The other versions probably has it too.

actually.. i DO know what im talking about... and your probably right also but at my school we use XP pro and the shutdown dialog is different... the login is different... on the ones at my school the code would be

send("{LWIN}")
Send("{UP}")
send("{ENTER}")
; Send("{UP}") do this as many times until SHUTDOWN is highlighted IF THE default isn't set at Shutdown if it is like LOGOFF or something...
Send("{ENTER}")

thats for the Pro computers at my school.... but their setting may be different.. from other Pro ones... im not sure but that is why i said that wouldn't work on every PC

Share this post


Link to post
Share on other sites

The users profile signature has been changed by me.

This topic has been answered.

No sense in talking about non-relevant information any longer.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0