Roman Posted June 20, 2006 Share Posted June 20, 2006 Hi I'm still quite new with AutoIt and i wonder how to script (most elegantly) this: I want to perform a job (a function or something else - dosen't matter) inside the script at exactly a specific time, e.g. every day at 11:00h. The script should always be running (sleeping?) and at this time do something once. Then the script again should wait for the next day 11:00h and so on... How do i script this "time-query" most elegantly? Thanks for all suggestions! Roman. Link to comment Share on other sites More sharing options...
Xenobiologist Posted June 20, 2006 Share Posted June 20, 2006 Hi, While 1 Sleep(30000) If @Hour = 11 And @Min = 00 Then ... Wend So long, Mega 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 Link to comment Share on other sites More sharing options...
Roman Posted June 20, 2006 Author Share Posted June 20, 2006 While 1Sleep(30000)If @Hour = 11 And @Min = 00 Then ...WendThanks. I did this already, but additional with "... AND If @SEC = 0", because it needs to be exactly on 11:00:00h. The problem now is that if the script does meanwhile something else, it could miss this one second for the query and do nothing.Probably my question was imprecisely.Thanks again.Roman. Link to comment Share on other sites More sharing options...
Don N Posted June 20, 2006 Share Posted June 20, 2006 Why not compile whatever you need to do into an exe and use Windows Scheduler to run it at precisely 11 or whatever time you need it run? _____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper Link to comment Share on other sites More sharing options...
jdickens Posted June 20, 2006 Share Posted June 20, 2006 $FinePrecision = 100 While 1 Sleep(30000) If @Hour = 10 And @Min = 59 And @Sec > 30 Then While @Sec <> 0 Sleep($FinePrecision) Wend PerformFn() EndIf Wend If I am too verbose, just say so. You don't need to run on and on. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now