AI Zone Admin Forum Add your forum

Chatbot Conference London On Oct 3th Erwin will be moderating on the Chatbots conference in London. Why don't you meet him there? As a Chatbots.org visitor, you'll get a discount as well: Why don't we meet there? get a discount

We do experience some trouble with our forms and some details page. We'll fix this ASAP. Sorry for the inconvenience!
Multiple responses to statement
 
 

Hi Everyone
I want to make my chatbot be versatile, and be able to respond to completely random stuff.

t: Do you guys want to play a game
a: (~yes) awesome
a: (~no) why not
    a: (~list of phrases) respond with correct phrase
        b: (because *) That isn’t a good answer
a: (*) lets still play anyway

(~list of phrases) respond with correct phrase
So my list of random phrases can be like
u: (you are stupid) that is mean
u: (who is the president) Donald Trump
u:(what is your name) I told you my name, it is Harry

Anyone know how to do this?

Thank you

 

 
  [ # 1 ]

Hi Tashi

if i well understood,

you can invoke in you main topic, a second dedicated topic with

^respond(~list_of_phrases

containing all your “random stuff”:

topic: ~list_of_phrases []

u
: (you are stupidthat is mean
u: 
(who is the presidentDonald Trump
u:(what is your name
I told you my nameit is Harry 


BTW, there is no need to respond if you exploit the natural CS behaviour of automatic topic invocation, assigning keywords to topic

See how Harry demo bot manage quibbles topic…

topic: ~list_of_phrases ["Donald Trump" stupidity president etcetc.

 

 

 
  [ # 2 ]

Thank you, it worked for sometimes and sometimes it doesn’t. I will need to dig into the flow and logic of whats going on.

 

 
  [ # 3 ]

Hi everyone..you guys are great. I am making a lot of progress on my learning and bots thanks to you all.
So it works so if I have several files. introduction.top, list_of_phrases.top, topic1.top and topic2.top, topic3.top, topic4.top

Each time, my list_of_phrases.top gets called, it does not go back to the place that it was called from, instead it always goes to topic4.top. For example, say I am in my introduction.top and I say a phrase that calls a response from list_of_phrases.top, it goes to topic4.top after, it doesn’t come back to introduction.top.

Any way to fix this? Thanks

 

 
  [ # 4 ]

There is a function ^poptopic.  The Chatscript-system-functions-manual says:


ˆpoptopic( topicname )
Removes the named topic as a pending topic. The intent is not to automatically
return here in future conversation. If topicname is omitted, removes the current
topic AND makes the current topic fail execution at this point.

You can force a topic with:


ˆaddtopic( topicname )
adds the named topic as a pending topic at the head of the list. Typically you
don’t need to do this, because finding a reaction from a topic which is not a
system, disabled, or nostay topic will automatically add the topic to the pending
list. Never returns a fail code even if the topic name is bad.

Also there are topic control flags described in the chatscript-advanced-user-manual.

There is a “random” flag to randomly search the rules.
There is a “nostay” flag to not stay in the current topic which seems to be what you need.

sample:

topic: ~test random nostay ( test president stupidity stupid name )

u: (you are stupid) that is mean
u:(who is the president) Donald Trump
u:(what is your name) I told you my name, it is Harry


Also, Chatscript will not reuse the same rules once they have been used at least for awhile so if you are testing and it works the first time but not the second then that is why.

You can use “keep” and “repeat” on a topic if you want to test it repeatedly:

topic: ~test random nostay keep repeat ( test president stupidity )

 

 

 
  login or register to react