Welcome to Synthiam!

The easiest way to program the most powerful robots. Use technologies by leading industry experts. ARC is a free-to-use robot programming software that makes servo automation, computer vision, autonomous navigation, and artificial intelligence easy.

Get Started
Germany
Asked — Edited

Wait Until Time

Hello,
i have a Problem with a script which at certain times something can be said the robot.
It has worked, maybe coincidence:

Code:


WaitUntilTime( 21, 45 )
$z=1
SayWait("Sven, es ist Zeit für einen Joghurt")
$z=0
ControlCommand("Leben", PauseOn)
WaitUntilTime( 22, 30 )
$z=1
SayWait("Jetzt ist Zeit ins Bett zu gehen")
$z=0
ControlCommand("Leben", PauseOn)
Sleep( 100 )
ControlCommand("Speech Recognition", PauseOn)


Now I have him so changed that he is not alone completed and added more hours and he only works the first time from 9:00, then he says nothing.

Code:


:start

WaitUntilTime( 09, 00)
$z=1
SayWait("schlaft ihr noch")
$z=0
ControlCommand("Leben", PauseOn)
Sleep(100)
ControlCommand("Speech Recognition", PauseOn)

WaitUntilTime( 11, 45)
$z=1
SayWait("Jetzt ist Mittagszeit")
$z=0
ControlCommand("Leben", PauseOn)
Sleep(100)
ControlCommand("Speech Recognition", PauseOn)

WaitUntilTime( 18, 30)
$z=1
SayWait("Liz, jetzt ist es Zeit zum Zähneputzen")
$z=0
ControlCommand("Leben", PauseOn)
Sleep(100)
ControlCommand("Speech Recognition", PauseOn)

WaitUntilTime( 19, 00)
$z=1
SayWait("Liz, jetzt ist es Zeit zum schlafen")
$z=0
ControlCommand("Leben", PauseOn)
Sleep(100)
ControlCommand("Speech Recognition", PauseOn)

WaitUntilTime( 19, 30)
$z=1
SayWait("Liz, hast Du Dir schon die Zähne geputzt?")
$z=0
ControlCommand("Leben", PauseOn)
Sleep(100)
ControlCommand("Speech Recognition", PauseOn)

WaitUntilTime( 20, 00)
$z=1
SayWait("Liz,es ist Schlafenszeit")
$z=0
ControlCommand("Leben", PauseOn)
Sleep(100)
ControlCommand("Speech Recognition", PauseOn)

WaitUntilTime( 21, 40)
$z=1
SayWait("Sven, es ist Zeit für einen Joghurt")
$z=0
ControlCommand("Leben", PauseOn)
Sleep(100)
ControlCommand("Speech Recognition", PauseOn)

WaitUntilTime( 22, 30)
$z=1
SayWait("Jetzt ist Zeit ins Bett zu gehen")
$z=0
ControlCommand("Leben", PauseOn)
Sleep(100)
ControlCommand("Speech Recognition", PauseOn)

GoTo(start)


I think it lacks any command between the times a "or" there is?

Many Thanks for your Help


ARC Pro

Upgrade to ARC Pro

Harnessing the power of ARC Pro, your robot can be more than just a simple automated machine.

PRO
Synthiam
#1  
WaitUntilTime will wait until the time hits. In your example, the script would need to be executed before 09:00.
PRO
Synthiam
#2  
Use this...

Code:


:loop

IF ($hour = 14 and $minute = 8)

print("Do something")

# wait for the minute to pass
sleep(59000)

ELSEIF ($hour = 18 and $minute = 30)

print("Do something else")

# wait for the minute to pass
sleep(59000)

ELSEIF ($hour = 21 and $minute = 45)

print("Do something else")

# wait for the minute to pass
sleep(59000)

ELSE

# nothing happened, so just wait a second and continue
sleep(1000)

ENDIF

goto(loop)
Germany
#3  
Thank you very much, i will test tomorrow.
Germany
#4  
Hello DJ, Thank you very much, this Script works fine.