Stop time

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
wilfredtr
Newbie
Posts: 16
Joined: Thu Aug 14, 2003 3:59 pm
Contact:

Stop time

Post by wilfredtr » Tue Oct 24, 2006 3:00 pm

Looking for how to create a script that would finish at 9:00PM each day no matter which time it began. Conceptually, I think I need to grab the system time and craft an if statement that would go to a STOP label but where do I start.

HELP!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 24, 2006 3:05 pm

I assume this is a looping script? If a repeating script you can set the time you want it to stop repeating in Run Now/Advanced.

If a looping script, add something like this at the end of the loop:

Code: Select all

Hour>hh
Min>mm
Let>numTime=%hh%%mm%
If>numTime>2100
  Goto>stop
Endif

//put this at very end of script
Label>stop
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Tue Oct 24, 2006 3:13 pm

The OP does say "no matter what time it began", could that be the previous day? If so that script would kill it immediately if it was started at 22:00 :)

wilfredtr
Newbie
Posts: 16
Joined: Thu Aug 14, 2003 3:59 pm
Contact:

Post by wilfredtr » Tue Oct 24, 2006 3:14 pm

Wow that was fast! Thanks!

This is the line, that I just coundt figure out how to do!!!!

Let>numTime=%hh%%mm%

wilfredtr
Newbie
Posts: 16
Joined: Thu Aug 14, 2003 3:59 pm
Contact:

Post by wilfredtr » Tue Oct 24, 2006 3:16 pm

Yes, that's OK. If the script started at 22:00, I would want it to STOP right away!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts