Is it too much to ask for a ongoing macro to survive a restart?

sevadro

New member
Hi,
I made a macro "Mute for 60 minutes", basically 3 commands (mute, wait, unmute) and I believe it didn't survive the restart while waiting for the next command so I ended up with the muted state one hour later. I suspect that it is too much to ask for a ongoing macro to survive, is it? So if I want it to be "atomic", I'd rather make something like a two-macro series, when the first one writes some deadline time and another one periodically reads this file for the end command to be performed. Other ideas? Actually, it's not a big deal, maybe more like a interesting challenge :)
 

MacroDroidDev

Administrator
Staff member
Sorry but MacroDroid is never going to be able to reinstate macros that are in progress after a reboot.

You can easily make your own mechanism hanging off the device boot trigger to do whatever checks and initialisation you want once the device has restarted.
 

Pseudocyclic

Well-known member
This macro speaks the time twice - first when it starts, and then again five minutes later. I just checked what happens if I turn off my phone for two minutes and then reboot immediately after the time is spoken the first time, and the time was spoken again exactly five minutes later.
 

Attachments

  • Screenshot_20210304-083613_MacroDroid.jpg
    Screenshot_20210304-083613_MacroDroid.jpg
    255.9 KB · Views: 11

sevadro

New member
Sorry but MacroDroid is never going to be able to reinstate macros that are in progress after a reboot.
Thanks for clarifying, I expected that. While seeing how many instruments MacroDroid offers, I have no doubts I will manage this. As a sidenote, probably MD might have something like persistent variables that reside not in the RAM but on the media. I'm not sure this is worth considering just for my issue, but there might be other applications to it. For example, constant counting of some events for statistics.
 

sevadro

New member
Just curious - why two macros instead of one?
Ok, I don't mind learning some MacroDroid zen knowledge )
In my case I had a button on the notification bar that muted the phone for the following 60 minutes. I thought that the easiest path is to have second macro with a "wait" trigger. What are my options in the case of one macro?
 

Pseudocyclic

Well-known member
T: trigger#1
T: trigger#2
A: if trigger fired = trigger#1
A: do some stuff
A: do some more stuff
A: else [if trigger fired = trigger #2]
A: do some other stuff
A: do some more other stuff
A: end if

In this example, the part [in square brackets] is optional.
 

sevadro

New member
T: trigger#1
T: trigger#2
A: if trigger fired = trigger#1
I see, thanks, I will keep this method for future use. I think both approaches will be prone to some confusion if I look at the "source code" of them some time later )
You method also have some pros for non-paying MD customers (one macro for the "price" of two). Fortunately, I payed and don't regret.
 
Top