|
Posted: May 5, 2014 |
[ # 16 ]
|
|
Member
Total posts: 26
Joined: Apr 10, 2013
|
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
Thanks !
|
|
|
|
|
Posted: May 5, 2014 |
[ # 17 ]
|
|
Administrator
Total posts: 2048
Joined: Jun 25, 2010
|
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/></set> is 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.
|
|
|
|
|
Posted: May 5, 2014 |
[ # 18 ]
|
|
Member
Total posts: 26
Joined: Apr 10, 2013
|
Thanks for th speedy response Steve
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….....
|
|
|
|
|
Posted: May 5, 2014 |
[ # 19 ]
|
|
Administrator
Total posts: 2048
Joined: Jun 25, 2010
|
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.
|
|
|
|
|
Posted: May 5, 2014 |
[ # 20 ]
|
|
Member
Total posts: 26
Joined: Apr 10, 2013
|
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 ?
|
|
|
|
|
Posted: May 5, 2014 |
[ # 21 ]
|
|
Administrator
Total posts: 2048
Joined: Jun 25, 2010
|
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.
|
|
|
|
|
Posted: May 5, 2014 |
[ # 22 ]
|
|
Member
Total posts: 26
Joined: Apr 10, 2013
|
Hmmmm I guess that could work I wouldn’t know how to implement that though? .....
I am using Pandorabots going through the Clownfish add on for Skype…....
|
|
|
|
|
Posted: May 5, 2014 |
[ # 23 ]
|
|
Guru
Total posts: 1297
Joined: Nov 3, 2009
|
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?)
|
|
|
|
|
Posted: May 5, 2014 |
[ # 24 ]
|
|
Administrator
Total posts: 2048
Joined: Jun 25, 2010
|
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.
|
|
|
|
|
Posted: May 5, 2014 |
[ # 25 ]
|
|
Member
Total posts: 26
Joined: Apr 10, 2013
|
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 Thanks so much Steve
|
|
|
|
|
Posted: May 5, 2014 |
[ # 26 ]
|
|
Administrator
Total posts: 2048
Joined: Jun 25, 2010
|
<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>
|
|
|
|
|
Posted: Jul 17, 2014 |
[ # 27 ]
|
|
Member
Total posts: 26
Joined: Apr 10, 2013
|
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
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
Thanks in advance !
|
|
|
|
|
Posted: Jul 17, 2014 |
[ # 28 ]
|
|
Member
Total posts: 26
Joined: Apr 10, 2013
|
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…..
|
|
|
|
|
Posted: Jul 17, 2014 |
[ # 29 ]
|
|
Administrator
Total posts: 3111
Joined: Jun 14, 2010
|
Hiya, Daniel!
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>
|
|
|
|
|
Posted: Jul 17, 2014 |
[ # 30 ]
|
|
Administrator
Total posts: 3111
Joined: Jun 14, 2010
|
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).
|
|
|
|