Problem with outputs and delays

Avatar
lord_blex
96 Posts
Posted Jun 16, 2013
So. Let's say I have a button, that controls a door. OnPressed opens the door with a 5 sec delay, OnUnPressed closes it. If I hop off the button before the delay ticks down, the door will close, then it will open and stay that way, which should not happen.
What's the "official" solution to this problem? It seems like something that would come up often, but I could not solve it..
Advertisement
Registered users don’t see ads! Register now!
Avatar
Lpfreaky90
2,842 Posts
Posted Jun 16, 2013
Replied 1 hour later
Onpressed: door_open_rl; trigger
OnUnpressed: door_close_rl; trigger

door_open_rl (logic_relay)
OnTrigger: door_close_rl; cancelpending; 0.00
OnTrigger: door; open; 5.00

door_close_rl (logic_relay)
OnTrigger: door_open_rl; cancelpending; 0.00
OnTrigger: door; close; 0.01

Avatar
lord_blex
96 Posts
Posted Jun 16, 2013
Replied 1 hour later
cool, I knew I was missing something :biggrin: