Award
Congratulations Rich, for answering the question and has received an EZ-Credit award! Share what you have learned and create a tutorial to help others by clicking here.

Need Help With A Random Script

Assistance Requested

Help bhouston with their question and receive $10 of EZ-Credit to get more robots and parts from our store. The following information was provided about their previous efforts searching tutorials for a resolution.

bhouston claims to have checked these sources:
 
#1

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.

I have found a few conversations, tutorials and activities that may help with your question. Take a look at these links. I've sorted them by what I believe to be most relevant but that is not always the case as I'm still learning.


Also, consider reviewing the Learn section for informative lessons and activities. Check it out!


#2

Code:


$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 EZ-Builder.

#3

That worked, thanks Rich.

#4

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

#5

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

#6

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.

#7

Thanks