Periodic actions in meta?

Unofficial support for the creating and editing of metas.
gr8b8m
Posts: 5

Periodic actions in meta?

Post #1 »

I'm looking for a way to do a periodic action in a meta, preferably while staying in a single state. I've tried using the new stopwatch functions and checking for conditions like stopwatchelapsedseconds%10, which works well but obviously only triggers the first time the condition is true. I can't re-enter my single state every time the condition is true since that would mess up my navigation (for example, reloading "Once" routes I might be taking.)

The context for my question is stuck detection in a macro using a single state. I wanted to do something simple like check if my landcell now is the same as the landcell I was in X seconds ago. I've seen Dmdtt's detection method but that relies on multiple states and my states are quite complicated, so I was looking at ways to avoid that. Does anyone know how I might accomplish this?

Dmdtt
Moderator
Posts: 271

Post #2 »

I'd suggest moving your routes to alternate states from the one you stay in most of the time for this exact reason you can't reset your state as you currently have it setup. One idea though which in theory could work for your current problem at hand. use /vt mexec setvar[Stopwatch, stopwatchcreate[]];stopwatchstart[getvar[Stopwatch]] at several intervals in your route, each time you reach a new point that sends this command in the route it will restart the time on the stopwatch. if it takes too long to get past a set number of points in your route then you know you are likely stuck.

gr8b8m
Posts: 5

Post #3 »

Forgot you could manipulate variables in routes. That's a good idea. Thanks.