cafasaru
USA
Asked
— Edited
Has anyone made a script for a timer? My wife asked if I could make one using ARC . If someone has made one please let me know, if not, I will start on it tomorrow. Basically say "Set timer" the robot than asks how many minutes and will start the countdown based on the the response.
The wait until time command will help.
There are at least 2 ways to tackle this,
The first is done using WaitForTime The second is done using the $hour and $minute variables
I don't have time right now but I'll pop up some examples when I do have time.
Just thinking about it and it's going to be a lot of code to pick up times accurately. Basically a waitforspeech needs a phrase list, so;
Then the same for minutes but zero to 59.
Then convert the text to number, using IFs 72 IFs to be precise... That's a lot of ifs. This may be able to be removed if spoken variables with the phrases 1,2,3,4,5,6,7,8,9,10,11 & 12 are stored as numbers not strings... this I am not sure of as I have never used it.
Then the
or if you want to set it for x hours and x minutes time the phrase list could be huge, depending on how many hours time you want to be able to go up to. The same WaitForSpeech code up to the number of hours needed, then the IFs as above.
Then work out the time for the countdown, two ways to do this, either reduce the $reminderminute by 1 every minute or calculate the time it'll be and wait until then. Since waituntiltime is above I'll show the other way.
awesome! thanks for posting that quick, I will load this up and let you guys know how it went, now my wife will have a kitchen robot helper.