I'm making a learning chat bot and I need help with how it responds. The way I have it is you can choose to talk to it or to teach it. When you teach it, it will say "what should I say" after anything you say. Whatever you say after it says "what should I say" is what it remembers. So when you choose talk then if you say something you taught it then it will respond with whatever you told it to say. The problem is it only says the one thing you taught it to say and you can't reteach it. I want it to pick from different things to say. So for example if I choose talk and I say "Hi" I want it to pick randomly from different responses like "Hi" or "Hello" or "Hey" Instead of just saying one thing forever. Also I don't want it to pick a random word or phrase either, like if I say "hi" I don't want it to say something like "banana" or some other random response.
Offline
What you could do is create a list for everything that the user inputs and then have all of the possibilities to respond with in that list. For example, you would have a list named "Hi" and that list would contain "Hi", "Hello", and "Hey." Then when the program responds, you would have it pick a random value from one to the length of the list and that is what it would say.
Offline
dankill51 wrote:
I thought of that but I would have to program it with everything the user could possibly input.. Unless I could have a script that makes a list but I don't think that's possible.
that's not possible but you could make it so that if it says somthing it dosn't recognise it could say somthing random.
Offline
Offline
No. It depends on what its learns (or to be more exact, what you teach it). If you say random things, yes it will.
Are you sure you looked at the script properly?
Offline
I think the topic and project notes describes it.
Offline