This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-06-30 00:56:11

dankill51
Scratcher
Registered: 2012-01-22
Posts: 85

Help with chat bot

I'm making a learning chat bot and I'm stuck on one part. The way I have it is it will respond with what you taught it to respond with. The problem is it will only say that one response. I want it to chose between multiple different responses so it won't just keep repeating itself. Can someone download what I have so far and try to help me with that? Thanks.

       link: http://scratch.mit.edu/projects/dankill51/2644822

Offline

 

#2 2012-06-30 01:26:35

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: Help with chat bot

You need a list, i'll check it out.


http://i47.tinypic.com/2iaa73k.png

Offline

 

#3 2012-06-30 01:29:39

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: Help with chat bot

hmm...I don't think it is possible with the way you script it.  I can show you a better way.


http://i47.tinypic.com/2iaa73k.png

Offline

 

#4 2012-06-30 03:21:59

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Help with chat bot

You could try multiple lists, or dynamic lists.

For each time the user teaches the bot something to say for the same input, add a new one in the lists, even if the "knowQuestions" is the same. Then, when the user says something, loop through the list, find out all the possible answers and add them to another list, then just use the block

item (any v) of [listhere v]
to pick a random response.

Last edited by fg123 (2012-06-30 03:22:24)


Hai.

Offline

 

#5 2012-06-30 10:20:21

dankill51
Scratcher
Registered: 2012-01-22
Posts: 85

Re: Help with chat bot

Thanks Fg123! But how would I loop through the list to find all the possible answers?
And sure Berberberber, that would be great!

Offline

 

#6 2012-06-30 10:41:15

Molybdenum
Scratcher
Registered: 2012-06-17
Posts: 1000+

Re: Help with chat bot

*sigh*
Stop overlooking my completed learning chatbot: http://scratch.mit.edu/forums/viewtopic.php?id=99417
It already has everything you need to make one (well, it is one), and you can modify the scripts (ex. chance to learn, add random delay).


"The Enrichment Center is required to remind you that you will be baked, and then there will be cake."
(|Balls and Platforms: Stay on!|) (|NaOS-H: An operating system... Or is it?|)

Offline

 

#7 2012-06-30 11:30:05

dankill51
Scratcher
Registered: 2012-01-22
Posts: 85

Re: Help with chat bot

I'm not overlooking it. I just wanted to try to make my own. Yours is really amazing and I looked at the scripts but I don't think they would work with the scripts I have.

Offline

 

#8 2012-06-30 11:34:40

Molybdenum
Scratcher
Registered: 2012-06-17
Posts: 1000+

Re: Help with chat bot

Try modifying them? It depends on what scripts you're using. Ex. A program like my Gibberish Generator V2 can't use scripts from my learning chatbot.


"The Enrichment Center is required to remind you that you will be baked, and then there will be cake."
(|Balls and Platforms: Stay on!|) (|NaOS-H: An operating system... Or is it?|)

Offline

 

#9 2012-06-30 13:30:39

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Help with chat bot

dankill51 wrote:

Thanks Fg123! But how would I loop through the list to find all the possible answers?
And sure Berberberber, that would be great!

To loop through the list, you would make a iterating variable, such as one called "i", then:

And a list called "possibleResponses"

http://img853.imageshack.us/img853/6353/knowanswer.gif

It basically adds all the possible answers into a list, then says a random one from that list.  smile

Last edited by fg123 (2012-06-30 13:31:14)


Hai.

Offline

 

#10 2012-06-30 15:36:12

dankill51
Scratcher
Registered: 2012-01-22
Posts: 85

Re: Help with chat bot

That's perfect! Thank you so much!  smile

Offline

 

Board footer