I am running a script in the macro scheduler... and need a daily time check

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
diamondrail
Newbie
Posts: 2
Joined: Wed Jul 31, 2019 9:38 am

I am running a script in the macro scheduler... and need a daily time check

Post by diamondrail » Fri Aug 16, 2019 12:13 am

If I am running a script, and once a day I need it to run another set of code within the script. How can I implement this? See attachment for the logic.

Thank you.
Attachments
script2.jpg
script2.jpg (26.72 KiB) Viewed 48 times

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 459
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: I am running a script in the macro scheduler... and need a daily time check

Post by Dorian (MJT support) » Fri Aug 16, 2019 12:44 pm

Hi Diamondrail,

There's lots of ways of doing this. This is just one of them. It works with 0935 or 935. Whichever you choose.

For anyone wanting to use this method after 12pm, it uses the 24hr clock, so simply use 1335, 1435, and so on.

I included a small wait to avoid a tight loop :

Code: Select all

Label>Start
Hour>TheHour
Min>TheMins

If>%TheHour%%TheMins%=935
  MessageModal>Action script goes here
Else
  Wait>1
  Goto>Start
Endif

Always accepting custom script commissions. Message me or go here

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 459
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: I am running a script in the macro scheduler... and need a daily time check

Post by Dorian (MJT support) » Fri Aug 16, 2019 12:45 pm

How many other ways can our regular users think of to achieve this?
Always accepting custom script commissions. Message me or go here

User avatar
Grovkillen
Automation Wizard
Posts: 350
Joined: Fri Aug 10, 2012 2:38 pm
Location: Hudiksvall, Sweden
Contact:

Re: I am running a script in the macro scheduler... and need a daily time check

Post by Grovkillen » Sat Aug 17, 2019 11:38 am

I do it like this:

Code: Select all

//Check loop
Label>StartOfLoop
Hour>HH
Min>MM
Sec>SS
GoSub>CheckClock,%HH%:%MM%:%SS%
Wait>0.25
Goto>StartOfLoop

SRT>CheckClock
If>CheckClock_Var_1=12:00:00
//Send to sub
Endif>

//Add more checks

END>CheckClock
Let>ME=%Script%

Running: MS14.5.4

Post Reply