Jump to content
Sign in to follow this  
error471

Run Function between certain times at a certain day repeatedly

Recommended Posts

error471

Hello Folks,

 

I would like to run a function at certain times and on a certain day. But I cant figure out how. The script shall run repeatedly every 60 seconds. Here is my very best try:

 

#include <Date.au3>  ;  1 = Sun  2 = Mon  3 = Tue  4 = Wed  5 = Thu  6 = Fri  7 = Sat

$StartTime = "09:00"
$EndTime   = "19:00"
$CurrentTime = _NowTime(4)


Switch @WDAY
Case 1,2,3,4,5,6,7
    If $CurrentTime >= $StartTime AND $CurrentTime <= $EndTime Then
        While 1
            justdoit()
            Sleep(60000)
        WEnd
    EndIf
EndSwitch

 

Edited by error471

Share this post


Link to post
Share on other sites
error471

It works now, I made a quite noobish mistake.

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  

×