AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Need help using successor code…..Need to stop looping and give each response only ONCE to a user, not loop
 
 
  [ # 16 ]

Hi guys….

I am sorry to dig up this thread, but I just thought it would be appropriate considering my new problems!.....

Hopefully Steve will be around and be able to elaborate on this further….

With regards to the above project, please bear in mind there are literally set,predetermined sentences for this bot and its not your standard AIML bot…..All has been well with it and no major probs, but I would like to insert variables into the predetermined responses…...My reasoning for this is that it seems messages are not being delivered when too many users are talking to the bot and I feel that its because of the fact that the text is the SAME for every user…..
I have tested by changing one word manually on the fly and sure enough, message goes through….
So , are variables even a possibility with AIML ?  O.O   I just cant get my head around it and need help , Steve preferably smile  smile 


Thanks !

 

 
  [ # 17 ]

Yes you can use variables. You set them and retrieve them using “set” and “get”. Here is an example which sets a variable called “dog” and then retrieves it in a different category:

<category>
<
pattern>MY DOG IS CALLED *</pattern>
<
template><set name="dog"><star/></setis a cool name.</template>
</
category>

<
category>
<
pattern>WHO IS MY DOG</pattern>
<
template>Your dog is called <get name="dog"/>.</template>
</
category

In the category I gave you last time, we used a variable called “seqno” and queried its value.
Hope that helps but if not please post again.

 

 
  [ # 18 ]

Thanks for th speedy response Steve smile 

Ummmm, it’s real late here and my brain is really not working plus I am tired lol….

Is there any chance you could post the code ?  The code from the previous page when it was finalised last time PLUS the variables?  To give an example , my response 1 is “Thank you for contacting us, we will do our best to supply you with what you need”.....

I need a variable to be planted in each response , either an extra word or to substitute a word each time….....

 

 
  [ # 19 ]

You want me to cut and paste the code from page 1? I’m not sure I understand what you are wanting.
If you post the category you are having trouble with, I will help you if I can.

 

 
  [ # 20 ]

I’m just basically looking for a way to slightly vary each response and make it unique, although I know its a paradox because the responses are set and hard wired with each step/response….. Do you see what I mean ?

 

 
  [ # 21 ]

How do you keep track of user id? You could try putting that before each response.

Human: Hi
Bot: 37098 - Hello to you as well.

 

 
  [ # 22 ]

Hmmmm I guess that could work smile  I wouldn’t know how to implement that though? .....

I am using Pandorabots going through the Clownfish add on for Skype…....

 

 
  [ # 23 ]

For the sake of conversation only, isn’t this considered unique?

Bot: Your IP address is d-cument.wr-te (sGeobytesIpAddress+” “+sGeobytesCity+”, “+sGeobytesCountry);

Reference this link for full code listing:
http://knytetrypper.proboards.com/thread/3217/pandorabots-skype

(Perhaps not, if JavaScript document write is only on the client side?)

 

 
  [ # 24 ]

I don;t know anything about Clownfish but from the first page, it looks like you only use 1 category. If so, try using something like:

<id/> - 

before each response in the category.

 

 
  [ # 25 ]

Ok , but can you tell me exactly where that snippet will go ?  ....


<li value=“1”><think><set name=“seqno”>2</set></think>response 2</li>


If you could paste the exact code with it included that would be great smile  Thanks so much Steve

 

 
  [ # 26 ]
<category>
    <
pattern>SEQUENTIAL RESPONSES</pattern>
    <
template>
        <
condition name="seqno">
            <
li value="1"><think><set name="seqno">2</set></think><id/> - Response 2</li>
            <
li value="2"><think><set name="seqno">3</set></think><id/> - Response 3</li>
            <
li value="3"><think><set name="seqno">4</set></think><id/> - Response 4</li>
             <
li value="4"><think><id/> - blank response</think></li>  
            <
li><think><set name="seqno">1</set></think><id/> - Response 1</li>
        </
condition>
    </
template>
</
category
 

 
  [ # 27 ]

Hi Steve/Everyone!

I was just wondering if you could help me out a little further regarding this ongoing project /topic….

Is it possible to tweak this code further to kick/ban any user who says a particular keyword?  The main reason for this is to weed out international users who are not of value, so by asking them their country via the bot, if they come back and say a blacklisted keyword ie.Brazil, Latvia, etc then can the sequence be halted for them and not continue ?  If you see what I mean :/  .... Hopefully you do smile 

Also, is it possible to add normal AIML responses to the code so that as to not “stop” the sequence , but to just reply normally , as a one off “as well as” the sequential response ..... I do understand that that could possibly be rather complicated but thought I would ask smile

Thanks in advance !

 

 
  [ # 28 ]

OK, I just saw Daves’ profanity code on a post from a year ago , so presumably I could implement that ?  I would need help with the structure of everything though because I wouldnt want it interfering with the main sequence…..

 

 
  [ # 29 ]

Hiya, Daniel! smile

Actually, there is, so long as your chatbot uses a standard web interface (e.g. a web browser), and it’s not all that hard to do. If you navigate your favorite browser to my downloads page at Geek Cave Creations, you’ll see a link for Profanity.aiml, which I wrote for my bot, Morti, to do exactly what you’re looking for (kick someone from your bot’s interface) when they have been warned too many times for cursing (or using other unacceptable speech). The idea is actually simple, in that you have your chatbot output a <script> tag that tells the browser to go to a certain URL and to replace the browser history for the current window/tab with only that URL, like this:


<script>location.replace(“URL OF YOUR CHOICE”);</script>

 

 
  [ # 30 ]

Looks like I was too slow, lol

Yes, you can use that, or something similar to boot someone from your chatbot, and use the client property KICKED to keep them from returning for an arbitrary length of time (or “forever” if they don’t clear their cookies).

 

 < 1 2 3 > 
2 of 3
 
  login or register to react