Jump to content
Macro Express Forums

Complex timing schedule


Marva
 Share

Recommended Posts

Hi wizards of the macro's,

 

I m having difficulties accomplishing my goal...

 

I'ld like one macro to do different things at different times.

 

i have a five minute load ( calling upon a program )

a ten minute load and an hourly load.

 

so at 09.00 the macro should execute three things ( the hourly, the 10 minute and the 5 minute )

at 09.05 the macro should only execute the 5 minute program call.

at 09.10 the macro should call the 5 and the 10 minute action.

at 09.15 the macro should only execute the 5 minute 'call' again...

 

So in one hour the 5 minute is executed 12 times, the 10 minute is executed 6 times and the hourly is executed only once.

 

I am able to start the individual macro's at different time intervals i.e. the 5 minute @ 09.00 ; the 10 minute @ 09.01 and the hourly @ 09.02.

 

But this will keep my pc occupied all day if i expand on the idea hence the need to make it a neat little macro :-).

 

Hope my situation sketch is up tot standard!

 

any feedback is much appreciated.

 

thanks

 

Marc.

Link to comment
Share on other sites

First, it is not clear to me why you want one macro rather than three. For simplicity and flexibility, each of three could run on its own schedule independent of the other two. The alternative would be to run a single macro on a five-minute schedule, and put logic in the program either to check the time, or to keep track of iterations -- do your 5 minute function every time, your 10 minute function only when iteration count is evenly divisible by 2, your 15 minute function when the count is evenly divisible by 3. The counter is simpler than checking time, because MacroExpress usually won't schedule macros precisely at the times or intervals you desire. Just be sure to Save your counter variable before exiting the macro, and Restore it at the beginning of the macro.

 

As to keeping your PC occupied, it depends what the macros are doing. I have one that runs every 15 seconds but it simply exits unless a particular screen is running, so most of the time you would never know it is there. I have others that run and write files to disk, but don't have any windows to display at all, so again you would never know they were there except perhaps for a slight performance blip. If you want a program called that normally uses the screen, but you want it not to display its window, there is a Program Launch Run Hidden command that you can try, though postings by other forum members say it works with some programs but that others refuse to stay hidden.

 

Good luck. Post again if I have misinterpreted your questions.

Link to comment
Share on other sites

Thanks rberq for your swift responce.

 

Here is some info on the purpose of the macro.

I'm taking screendumps at set intervals ( so i guess the run hidden is a no can do ) that are stored thru ftp.

 

i use mouse directions and call upon a shortkey to take the screendump and send it over the net.

the screendumps differ @ different timeframes.

 

furthermore it does not take a minute to do this ( if i can perform the 3 tasks in one minute i would prefer this)

 

what i would like to know if it's possible to dissable mouse and keyboard while the macro is running... ( thus securing a good execution )

second would it be possible to define a time window i.e. : if time > 09.00 and < 09.04 then do .... task

thanks for your expertise.

 

Marc

Link to comment
Share on other sites

Macro Express 3 does not have commands to lock the keyboard or mouse during execution. You may be able to use a Text Box Display command to display a 'Do not use keyboard or mouse' warning. But, since you are capturing information from the screen, you will need to be careful about the placement of the Text Box Display.

 

You could try to create 3 scheduled macros, Macro_5, Macro_10 and Macro_Hr, and set their schedules accordingly.

 

Notes:

  1. If a scheduled macro is running when another scheduled macro tries to start, the second macro will run when the first is finished.
     
  2. To improve the accuracy of the scheduled macros change the 'Timer Interval' found in Options, Preferences, Scheduler to 'Check Every [ 1] seconds'.
     
  3. The 'Other' schedule allows you to set a schedule for every 1 or 5 minutes but the times start when Macro Express starts up. To synchronize these macros with the time, you may want to disable (Macro Disable) them and have your hourly macro enable (Macro Enable) them both at the same time.

Link to comment
Share on other sites

Well, Marc, I can see why you don't want screens popping up all day. Makes it kind of hard to do any other productive work. If your application is really important, it sounds like you need a second PC just to handle it.

 

Or, here's an idea, and I warn you I have not thought it through so it may be loony: How about one of those dual monitor setups? Maybe position a DOS session on the second monitor just to start a never-ending macro that does your screen dumps and calls (hidden) the ftp operations, then delays 5 minutes, does it again, and so on. You could do your regular work on the other monitor. You could even darken up the second monitor so it wouldn't be flashing at you all day.

Link to comment
Share on other sites

Thanks Kevin & rberq,

 

I didn't know the macro's could be setup at the same time (with Macro Express handling the priorities)

This does indeed make the complex timing schedule obsolete.

 

I think a second computer is indeed the only solution...

 

But i don't understand the last remark Kevin made.

If I setup the macro to run every 5 minutes between 09.00 and 22.00

another to do the same every hour ( between 09.00 and 22.00 )

 

 

Where can i go wrong then?

Isn't the computer's clock starting the macro's at the same time?

( I use the 'other' in the schedule menu enabling me to start a macro every day between a timeframe )

 

Do i need to have the hourly activate the 5 min?

 

 

kind regards

 

Marc

Link to comment
Share on other sites

If I setup the macro to run every 5 minutes between 09.00 and 22.00

another to do the same every hour ( between 09.00 and 22.00 )

 

Where can i go wrong then?

That is a good idea as long as Macro Express is already running at 9:00. But if Macro Express starts at 9:03 AM then the macro will run at 9:08, 9:13, 9:18, etc.

 

If you disable the 5 minute macro and have the hourly macro enable it then it will run at 9:05, 9:10, 9:15, etc.

Link to comment
Share on other sites

Thanks Kevin,

 

Macro Express is indeed running before 09.00 so thanks to you guys i can start publishing my screendumps :-)

even when i am not behind the computer.

 

Thanks for all the wisdom you share!

 

This forum has been added to my favorites!

 

Untill later...

 

Marc

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...