Jump to content

Why Sleep Function Max At 24 Days?


Recommended Posts

A better question might be why someone would want to use a sleep for anywhere near that long.

(Obviously I don't have a real answer to your question)

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

I'd have it check the time/date at a reasonable interval. That way you would have the option to kick a job off even if the system was off when it should have fired.

Also the app will not be frozen until the job fires.

Edited by SpookMeister

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

  • Moderators

I agree, I'd do the date and time... but just for the sake of arguement.. how long would this sleep?

Sleep(2147483647)
Sleep(2147483647)
... If you needed to go that route for whatever reason lol...

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.

Link to comment
Share on other sites

I was speculating heh. Hmmm, I suppose they could use the task scheduler for that.

Hm, that brings up another question: Is it possible to schedule tasks silently with command line? If so, how?

Edit: A very nice solution by SmOke_N, as usual :think:

Edited by forger
Link to comment
Share on other sites

I was speculating heh. Hmmm, I suppose they could use the task scheduler for that.

Hm, that brings up another question: Is it possible to schedule tasks silently with command line? If so, how?

Edit: A very nice solution by SmOke_N, as usual :think:

Unplug the pc speaker and its silent.

But scheduling things is easy in autoit

$sched1 = 0
while 1
    if (@hour == 12 AND @min == 50) AND $sched1 == 0 then 
        run("notepad.exe")
        $sched1 = 1
    endif
    sleep(15000)
wend

This would start notepad every day at 12:50 wich is checked every 15 seconds

you could add invinite schedules in the loop.

Ofcourse you could make it so it reads a ini file wich contains all schedules and tasks wich should be done

(and ofcourse you can add year and date checks)

Edited by MrSpacely
Link to comment
Share on other sites

I was speculating heh. Hmmm, I suppose they could use the task scheduler for that.

Hm, that brings up another question: Is it possible to schedule tasks silently with command line? If so, how?

Edit: A very nice solution by SmOke_N, as usual :think:

On Windows XP you can use SCHTASKS

On Windows NT you can use AT

On Windows 9x I'm pretty sure you have to use a 3rd party utility or library.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...