Variable not changing after wait


#1

I’ve got a piston that reminds me to take my medicine at night by checking to see if it’s 9:00PM and the medicine drawer hasn’t been opened within the last few hours. I do this by having a variable {medicine} which is initialized to False and if it is still False and time is 9:00PM it will send me a push notification every 5 minuted until I open my medicine drawer. When the medicine drawer is opened the expected behavior is to set the variable {medicine} to true, wait until midnight and then set it back to false for the next day.

Everything works up until the part where it’s supposed to set back to false. It just stays true. Any ideas?


#2

My guess is that the action is being canceled. You might see it in the logs when you close the drawer. Change the settings of the with statement in your second if statement to never cancel tasks.

Click the with statement. Click the cog icon in the bottom right. Find TCP (task cancellation policy) and set it to never cancel.


#3

Done. I’ll give it a try tonight and report back my findings. Thanks for the help. I still don’t have a firm grasp on Task Cancellation, Task Execution and Task Scheduling options.


#4

All three located in the wiki.

https://wiki.webcore.co/Task_Cancellation_Policy

https://wiki.webcore.co/Task_Scheduling_Policy

https://wiki.webcore.co/Execution_Method


#5

Checking in to let you know that the task was in fact being cancelled. Thanks for your help!