Turn off lights after x time


#1

1) Give a description of the problem
I have a few lights that i want to turn off after x time if it’s turned on. I’m now doing this by using 2 pistons for each set of lights i want to turn off. But i was wondering if there is a way to put them in 1 piston.

2) What is the expected behavior?
Independent timers for different lights to turn them off after x time in one piston.


#2

combine them and set TSP to allow multiple on all the wait statements.


#3

I combined them and set the wait statements like this:


#4

looks good. so long as both the wait groups are set to allow multiple it will work.

also, you can drag the wait task into the same with block as turning the light off. no need for a separate with.


#5

Well i’ve tested it and it’s not working, it’s only turning off the last light that was turned on. I want to be able to have a timer running for one set of lights and if it happens that during this time a other set of lights turn on, i want a new timer to run for only those lights.


#6

also set TCP to never on both with.


#7

Thats it! Thanks for the help :wink:


#8


#9

Thanks for the example, got it working now!