Oh dear, THAT thread. I’d have to correct a number of my comments in that thread as although I knew how things worked I’d got myself confused by the wake up behaviour after a period of not having been using webCoRE for a while.
The bottom line is that if you have a piston like:
if condition 1
then
if condition 2
then
with a light
wait 10 seconds
turn off
end with
endif
endif
If the piston runs and conditions 1 and 2 evaluate as true the piston would start a task (with
block) with a wait
for ten seconds. As it is over five seconds the piston would create a scheduled task for ten seconds time - the task being the one it hasn’t finished yet, which involves turning off the light and going on to the rest of the piston - and it would exit. This scheduled task only exists because conditions 1 and 2 were true.
If something else (anything at all) causes the piston to run during the ten second wait it is quite possible that conditions 1 and/or 2 are no longer true. But hang on, there is this scheduled task that is only there because they were true. What to do about it? The default Task Cancellation Policy says to cancel any scheduled tasks that were created when the conditions evaluated differently. If you don’t want that to happen you can specify the TCP as ‘never cancel’ on an individual task basis.
Now if the new piston does evaluate as true for conditions 1 and 2, that is a whole new story. That is where the Task Execution Policy and Task Scheduling Policy sometimes come into play.