Talk Servo V2 icon Talk Servo V2 — Animate servos to simulate jaw/mouth with ARC text-to-speech; configurable vowel/consonant timing, start sync, multi-servo control, pause/stop. Try it →
Canada
YouTube
Asked — Edited
Resolved Resolved by Rich!

Need Help With A Random Script

I am trying to get the following script to repeat 5 times;

get a response value

$response = GetRandom(0,5) If($response = 0) Sayezb("What should i say") ElseIf($response = 1) Sayezb("i really should say something") ElseIf($response = 2) Sayezb("Ok i think i have said enough") ElseIf($response = 3) Sayezb("something") ElseIf($response = 4) Sayezb("What's up") EndIf

Not sure what to add.


ARC Pro

Upgrade to ARC Pro

Stay at the forefront of robot programming innovation with ARC Pro, ensuring your robot is always equipped with the latest advancements.

Author Avatar
United Kingdom
LinkedIn Twitter Google+ YouTube
#1  

$x = 0
RepeatWhile($x < 5)
$x++

# get a response value
$response = GetRandom(0,5)
If($response = 0)
Sayezb("What should i say")
ElseIf($response = 1)
Sayezb("i really should say something")
ElseIf($response = 2)
Sayezb("Ok i think i have said enough")
ElseIf($response = 3)
Sayezb("something")
ElseIf($response = 4)
Sayezb("What's up")
EndIf

EndRepeatWhile

Try that however check syntax etc. as that was from memory not from ARC.

#2  

That worked, thanks Rich.

#3  

Say Rich, I sent you a couple of emails last week, did you see them?

#4  

@bhouston... Rich has been busy feeding the poor and bottle feeding stray kittens.... ;)

Author Avatar
United Kingdom
LinkedIn Twitter Google+ YouTube
#5  

Yeah I got them but haven't had chance to read them yet, been busy lately (those darn kittens). Will read them when I can dude.