Asked — Edited

Missing String Quotes

I've recently started working with Ez-robot and have been having some troubles with the following error:

 1: $Allowed = "name1", "name2"
Error on line 1: Missing String Quotes or Invalid Expression at index 7: , 

I'm trying to make it so JD recognises someones name, and with variables, and decide if that person should be admitted to where ever one's going.

 $Allowed = "name1", "name2"

$Blacklisted = "name3", "name4"

# Camera Tracking will not function without a Camera Control added to the project. Project->Add Control->Camera

# Wait For Face will not function without a Camera Control added to the project. Project->Add Control->Camera

SayEZBWait("who goes there")

if ((WaitForSpeech(10, "name1", "name2")) = $Allowed)

  SayEZBWait("Hello please enter my friend")

  ControlCommand("Auto Position", "AutoPositionAction", "Wave")
  sleep(500)
  waitfor($AutoPositionStatus = 0)


elseif ((WaitForSpeech(10, "name3", "name4")) = $Blacklisted)

  SayEZBWait("Get out you hooligan before I call the cops")

  ControlCommand("Auto Position", "AutoPositionAction", "Kick")
  sleep(500)
  waitfor($AutoPositionStatus = 0)


else

  SayEZBWait("Who are you?")


endif

Any help with the error is greatly appreciated.


ARC Pro

Upgrade to ARC Pro

Take control of your robot's destiny by subscribing to Synthiam ARC Pro, and watch it evolve into a versatile and responsive machine.

#1  

This is incorrect... Your syntax is wrong


$Allowed = "name1", "name2"

This will work. Variables can only hold one value at a time......


$Allowed = "name1"
$Allowed2 = "name2"

or you can use an array


$Allowed[0] = "name1"
$Allowed[1] = "name2"
$Allowed[2] = "name3"

or you can append two together


$Allowed = "name1" + "name2"

PRO
Synthiam
#2  

The learn section has a complete tutorial activity on how to do something like this using the robot program. Here is a link to the tutorial: https://synthiam.com/Tutorials/Lesson/106?courseId=1

You can also click the ? (question mark) on any control to view help, which includes relevant activities. For example, if you were to click the ? (question mark) on the Camera Control, you would see a link to that tutorial.

Find more information in the learn section to begin using your ez-robot.

ALSO - i highly recommend starting with Blockly and not diving directly into EZ-Script. Blockly makes programming a lot easier, and even i use it.

Maybe this is what you want to do? considering that you have objects trained for the faces of Jeremie and DJ Sures. You do not use face detection, you use Object detection. You can read about the differences - as face tracking doesn't know a single face, it only knows EVERY face.

User-inserted image

PRO
Synthiam
#3  

OTHERWISE if you want to prompt with audio and wait for a speech response...

... you can start along the lines you were beginning with. This example queries and waits for a response once the face is detected. See how the logic works? There is a good episode on The Robot Program that teaches how to use logic here: https://synthiam.com/Tutorials/Lesson/119?courseId=1

User-inserted image

Canada
#4  

This post is certainly educating me. Thanks!

PRO
Canada
#5  

I'm not sure if I like this code example. LOL

PRO
Synthiam
#6  

Hahahah jer! Was wondering when you'd see that!