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")
  waitfor($AutoPositionStatus = 0)

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

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

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


  SayEZBWait("Who are you?")


Any help with the error is greatly appreciated.


Upgrade to ARC Pro

ARC Pro is more than a tool; it's a creative playground for robot enthusiasts, where you can turn your wildest ideas into reality.


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"


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:

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


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:

User-inserted image


This post is certainly educating me. Thanks!


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


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