I have a few pistons than fire both at a certain time, or if an event triggers them. Right now I have two identical code blocks; one for “On Events …” and one for “Every…”
Is there a way to combine (OR) the event trigger and timer?
I have a few pistons than fire both at a certain time, or if an event triggers them. Right now I have two identical code blocks; one for “On Events …” and one for “Every…”
Is there a way to combine (OR) the event trigger and timer?
What I’ve done for something in this scenario is to put both Triggers (the Timer and whatever else) in the same piston as different blocks to themselves. The piston only has the Triggers (and any conditions) in it, the pistons don’t actually do anything. But if the triggers and conditions are met then I have the piston call a different piston that actually does the task.
That way I’m not duplicating a bunch of code. I have one piston to change if I want to tweak something, and I can kick off the Task from multiple different vectors. In fact, you can even pass Args to the called piston so that you know how you got there. The Timer could have one set of args, and the (let’s say) switch going on could have a different set.
There’s no way that I’m aware of with WC to say something like:
Every day at 5PM OR if Switch 3 changes to ON.
But with my method you get the same effect (but w/o using the OR). They’re just two different triggers to the same called external piston.
Good one. If that’s what you were doing that would work fine. But that’s not a Timer.
If he wanted something like “Every 45 minutes Do” then that would be very cumbersome to create in that manner.