Jump to content

Run Function between certain times at a certain day repeatedly


error471
 Share

Recommended Posts

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
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...