syu
New Member
Posts: 6
|
Post by syu on Jun 22, 2021 8:27:35 GMT
Hi, so I basically has 2 sets of macro that runs at specific intervals for a program, and 1 macro that will relaunch the program when it crashes. The macro has different priority, Macro 1 (6 minutes) is more important than Macro 2 (1 minute). That's easy enough to do, I just do a window title check, if macro 1 is running, macro 2 will auto exit. But this isn't perfect because if macro 1 starts when macro 2 is in process, then it gets screwed up.
Now my issue is that, I want the restart Macro to be more important than Macro 1 and 2. But there's a risk of Macro 1 and 2 launching when it's in the restart process (which takes about 1 minute). The macro cannot be combined because it's dealing with time sensitive stuff that is not divisible by each other.
There must be a more elegant solution, but I am not able to see it. Doing a window title check is an imperfect solution. The behaviour I am looking for is: Restart macro > Macro 1 > Macro 2 So even if Macro 1 is in progress, when the program crashes, restart macro takes priority and macro 1 can just end its own task.
Is there some evaluation priority setting somewhere? Does anyone has a better solution?
|
|
|
Post by Steve on Jun 22, 2021 9:41:07 GMT
If you can't use Window Title to control your macro have you considered using variables passed between the running instances?
You say you can't do this with MMM because it's dealing with time sensitive stuff. Can you give me an example of what exactly it's trying to do? just a small snippet of how your working with the three macros together will help.
|
|
syu
New Member
Posts: 6
|
Post by syu on Jun 22, 2021 11:29:28 GMT
It's nothing complicated for the macro itself, everything is just mouse clicks and mouse movement for all the macros. I don't think you need to see snippets because it's all mouse movement and mouse left click down and release mostly. The slightly complicated part is just that macro 2 has to be performed every 8 minutes and will take 1 minute to finish. Macro 1 every 70 minutes and takes 6 minutes. Each macro does different actions, so if they run together they will move the mouse in different directions and clicking different things. The restart macro is also mostly mouse movement, clicks, with a little typing.
Hmm, I saw the input from file and I am thinking how to incorporate it with my macro. I am not seeing it yet.
|
|
|
Post by philranger on Jun 24, 2021 14:56:21 GMT
Hello
8x9=72 so you can’t mathematically run a 6 minutes macro at 70 minutes
On top of that, timing is not exact in MMM as it depends on extra time needed to run the commands themselves + whatever delays Windows adds.
What I would do is a macro that calls macro 1 seven times (7*(8+1) is roughly 64 minutes when counting additional delays) then wait 6 minutes, call macro 2, wait for it to end, then start again.
But I would put ir all in a single macro to avoid those kind of issues.
Your mileage may vary ;-)
|
|
syu
New Member
Posts: 6
|
Post by syu on Jun 25, 2021 7:01:50 GMT
Sorry I am a bit confused. Maybe there is a miscomm somewhere. Let me try to re-explain the problem.
Macro 1: 6 minutes running duration, activates every 70 minutes. So it only run once every 70th minute. Macro 2: 1 minute running duration, activates every 8.5 minutes. Only runs once every 8th minute and 30 seconds in. The 2 macro will run indefinitely.
Because they are indefinite, at one point macro 2 will clash with macro 1. That's why I want to have some sort of priority where Macro 1 will always be prioritized. So for example, when macro 1 is running, macro 2 will check window title when it starts and if it detects macro 1 window title, it will end its own task (macro 2 end task).
The small hiccup is when macro 2 is running and macro 1 starts. How do I make sure that macro 1 will always be prioritized? This is the crux of the issue for me. While I am typing this, I am wondering if it's possible to do a condition inside macro 1
(IF macro 2 window title exists, kill macro 2 window)
Maybe I will try it out.
I hope I explain it better now.
|
|
|
Post by Steve on Jun 25, 2021 9:52:11 GMT
How are you launching macro 1? I'm assuming your using windows task scheduler or something the like? How about forcibly killing off any current running minimousemacro.exe instances prior to calling macro 1: C:\Users\steve\minimousemacro>taskkill /F /IM minimousemacro.exe /T & MiniMouseMacro /m /e /d:2000 "d:\Macro Files\mymacro.mmmacro" Here's some info on command line switches taken from the FAQ page:
|
|
syu
New Member
Posts: 6
|
Post by syu on Jun 25, 2021 11:37:27 GMT
Yes, Task scheduler. Sounds like a solution! I'll try it out.
|
|