Here's how I get random answers to questions and/or statements in EZ Builder. It's a simple way that can be expanded on as needed.
For example if I say - Goodbye
The program responds with a statement from this code;
$response = getrandomunique(0,3)
Sayezb("have a good day")
elseif($response = 2)
Sayezb("see you later, don't forget to turn me off")
You could have an unlimited number of responses if you wish.
I have several Speech Recognition statements that are setup this way, like;
Tell me a joke
Who am I ?
Who are you ?
or if I say "InMoov" it will answer with one of several statements
All of these are setup with the above code.
It's no AI but it does randomize the answers.
I also use this type of code in my Rock, Paper, Scissors program and some math scripts.