Train Vision Object By Script icon Train Vision Object By Script Train camera vision objects via controlcommand(), attach camera, start learning, monitor progress, and return object name for scripts. Try it →
Germany
Google+ YouTube
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:


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.


: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

Subscribe to ARC Pro, and your robot will become a canvas for your imagination, limited only by your creativity.

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#1  

WaitUntilTime will wait until the time hits. In your example, the script would need to be executed before 09:00.

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#2  

Use this...


: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)
Author Avatar
Germany
Google+ YouTube
#3  

Thank you very much, i will test tomorrow.

Author Avatar
Germany
Google+ YouTube
#4  

Hello DJ, Thank you very much, this Script works fine.