Asked — Edited

Controlcommand(Scriptstart, ) Help

help guys.

im trying to figure out how to activate a script by voice control....

i go to script, type in

servo(d19, 30) servo(d19, 50)

i hit repeat and name it shoot

then in voice command or personality generator i type

controlcommand(startscript, "shoot")

ezb tells me shoot is not a valid wondows command.....

what am i missing, cuz i know its me and not the software.


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  

Do you have the scriptstart and "shoot" in the wrong order?

#2  

no, ive played around with the sequence and nothing...i tried moving the "" to scriptstart and nothing...

im literally following DJ Sures example letter by letter by letter and nothing. I think ControlCommand() is trying to do a windows function not a ezb software function....

not sure.

PRO
Synthiam
#3  

The manual is your friend - but long!:) It's on the right of every control that has a script interface. Look up the syntax for the control Window command, then look up the available commands for the window you are trying to control...

Hint: ControlCommand("shoot", scriptstart):)

Also, if you select "repeat", it will run for ever and ever and ever and ever. So maybe you don't wanna do that? The repeat option should be removed, actually. Because to properly repeat a script, you'd use GOTO() and :LABEL statements...

Example:


# pulses the eye leds from bright to dim

servo(d18, 1)
servo(d19, 1)

:goUp
servoUp(d18, 10)
servoUp(d19, 10)
sleep(250)

if (servo(d18) > 60)
goto(goDown)

goto(goUp)

:goDown
servoDown(d18, 10)
servoDown(d19, 10)
sleep(250)

if (servo(d18) < 11)
goto(goUp)

goto(goDown)

#4  

gotcha, ill check it out again after work...the thing is i do reference the side commands....

and i swear it states scriptcommand(scripstart, "shoot")

i thought i tried shoot first then scriptstart, but i guess not...ill do it tonight.

thanks for the example....

thats was actually the next command i was going to start messing with the "if" commands.....

the :label and goto(), seem a little trickie, but ill mess with them for a while and come back with some better questions.

thanks again for the quick answers...

#5  

DJ sures,

I just did my first repeat script based on the code you gave above.

tell me if i am doing this right (im getting the result i want so, yeah)

what i want is for the 2 PIR sensors on the left and right side of the wall-e to:

always scan, if its triggered (value at 100) then i want the head to move up, once its not triggered (value at 0) i want the head to go down

i want this to "always be on" and i didn't want to hit the repeat button

so i wrote the following script...

:goUp adc_wait(adc, higher, 100) servo(d15, 50)

if(servo(d15) = 50) goto(godown)

goto(goUp)

:godown adc_wait(adc5, lower, 100) servo(d15, 70)

if(servo(d15) = 70) goto(goUp)

goto(godown)

right?