Do Loop for an amount of time with a break loop it then statement


#1

How can I create
a do loop for a specific amount of time.

I want to have an if then statement, if true, then do loop for time, then continue to next statement in the then list.

but in the loop time, need to have an if statement that if true break the time loop,


#2

While waiting for the loop time to expire, the piston will have no awareness of any changes to your system unless another trigger fires off.

So either:
(A) You make another trigger for the break
or
(B) You’d have to put your check/verification at the beginning of the loop, and understand that it cannot switch gears until the time expires


#3

Ok so here is what I am trying to do

Since ST will not set off sirens if the “Intrusion Detected” is not clear, I was trying to take the control out of ST and into webcore and somehow add a 15 second delay before alarm goes off. and if during the 15 seconds the system gets disarmed then stop and restart piston for next time.

If the 15 seconds are up then trigger siren and strobes for 3 mins, but again fi the system is disarmed during the 3 mins stop and restart piston.

Sorry I am a newbe, I understand some just not sure how to accomplish this.

I have been working on this for like 4 hours now and just cant get it.
Here is what I have, but of course not working correctly. Siren never goes off…

(No sensitive in is included)


#4

I am a bit short of freetime the next 36 hours, but this stands out to me right off the bat:

  • Your trigger needs to be top level (far left) to initiate the piston, with conditions below that.

I think there is at least one thread here showcasing almost exactly what you are looking for. Maybe try searching for “SHM delay”?


#5

I have looked and tried some other thing with just their code and my original code, just cant seem to make it work. I will table this for a few day and work on other stuff until you have time (If willing to help.)

Thanks!


#6

I might encourage you… Instead of re-creating the wheel, why not try one of the pistons out there? If you have trouble with it, try asking on that particular thread. There are often many people using that piston who will see any posts that you make there.