Making bot remember something

Help and bugs.

Making bot remember something

Postby voarsh » April 4th, 2012, 11:09 am

Hi. When a user says wrong answer

The bot asks for the correct way of saying it.

It then asks would you like me to remember that.

When remembers something or recalls what the user wants to be saved instead of spaces it puts +.

How can this be resolved?

Many thanks. :D
voarsh
Obsessed Member
 
Posts: 114
Joined: March 12th, 2012, 8:59 pm

Re: Making bot remember something

Postby programo » April 4th, 2012, 12:55 pm

do you have a link to your bot?
so that i can see what you mean?
:D
User avatar
programo
Site Admin
 
Posts: 306
Joined: April 4th, 2011, 4:46 pm
Location: Nottingham UK

Re: Making bot remember something

Postby voarsh » April 4th, 2012, 1:17 pm

www.astrizgamingstudios.com/bot2


=)
voarsh
Obsessed Member
 
Posts: 114
Joined: March 12th, 2012, 8:59 pm

Re: Making bot remember something

Postby programo » April 4th, 2012, 1:56 pm

hi there
the bad answer routine worked for me....
you have to follow this pattern when speaking to the bot to trigger it

You: hello
Bot: hi there!
You: bad answer
Bot: Would you like to teach me a new answer to " hello "?
You: yes
Bot: OK, what should I have said?
You: goodbye
Bot: Do you want me to remember that?
You: yes
Bot: Fine. I'll try to remember to respond, " goodbye " when you say, " hello "
You: hello
Bot: goodbye
User avatar
programo
Site Admin
 
Posts: 306
Joined: April 4th, 2011, 4:46 pm
Location: Nottingham UK

Re: Making bot remember something

Postby voarsh » April 4th, 2012, 1:58 pm

I think I saw you test my bot:

Conversation#1 2012-04-04

USER:hello
BOT: Hi there!
USER:bad answer
BOT: Would you like to teach me a new answer to " hello "?
USER:yes
BOT: OK, what should I have said?
USER:goodbye
BOT: Do you want me to remember that?
USER:yes
BOT: Fine. I'll try to remember to respond, " goodbye " when you say, " hello "
USER:hello
BOT: goodbye


the problem starts when you say something that has spaces: in your case "good bye".


This is what I got:

You: good bye
Bot: Do you want me to remember that?
You: yes
Bot: Fine. I'll try to remember to respond, " good+bye " when you say, " hello "


I tried it out:

You: hello
Bot: good+bye
voarsh
Obsessed Member
 
Posts: 114
Joined: March 12th, 2012, 8:59 pm

Re: Making bot remember something

Postby programo » April 4th, 2012, 2:58 pm

ahhhhh.... interesting ... that is a simple fix
you need to urldecode the output.....
which it should do
echo urldecode($botsay);
User avatar
programo
Site Admin
 
Posts: 306
Joined: April 4th, 2011, 4:46 pm
Location: Nottingham UK

Re: Making bot remember something

Postby programo » April 4th, 2012, 3:02 pm

I have made this an issue https://github.com/Program-O/Program-O/issues/4
User avatar
programo
Site Admin
 
Posts: 306
Joined: April 4th, 2011, 4:46 pm
Location: Nottingham UK

Re: Making bot remember something

Postby voarsh » April 4th, 2012, 4:08 pm

Thanks.


So will this be sorted in the next update?


Or can you tell me how to resolve this?

:D
voarsh
Obsessed Member
 
Posts: 114
Joined: March 12th, 2012, 8:59 pm

Re: Making bot remember something

Postby programo » April 4th, 2012, 4:28 pm

yes to both!
find the lines in index.php
Code: Select all
<?php echo $display;?>
      <form method="get" action="index.php">
         <p>
            <label>Say:</label>   
            <input type="text" name="say" id="say" />
            <input type="submit" name="submit" id="say" value="say" />
            <input type="hidden" name="convo_id" id="convo_id" value="<?php echo $convo_id;?>" />
            <input type="hidden" name="bot_id" id="bot_id" value="<?php echo $bot_id;?>" />
            <input type="hidden" name="format" id="format" value="<?php echo $format;?>" />
         </p>
      </form>
   </body>


and change the line
Code: Select all
<?php echo $display;?>


to
Code: Select all
<?php echo urldecode($display);?>


:D
User avatar
programo
Site Admin
 
Posts: 306
Joined: April 4th, 2011, 4:46 pm
Location: Nottingham UK

Re: Making bot remember something

Postby voarsh » April 4th, 2012, 8:36 pm

Sorry.

Which index.php file?


I looked at /bot2/index.php couldn't find it, I also looked in /bot2/bot/ - there was no index.php file.
voarsh
Obsessed Member
 
Posts: 114
Joined: March 12th, 2012, 8:59 pm

Re: Making bot remember something

Postby programo » April 5th, 2012, 9:49 am

i think it is in the gui folder
User avatar
programo
Site Admin
 
Posts: 306
Joined: April 4th, 2011, 4:46 pm
Location: Nottingham UK

Re: Making bot remember something

Postby GeekCaveCreations » April 6th, 2012, 2:59 am

For "fixing" the default bot page, look in your /bot2/ folder, and load index.php from there. Look for the following code:

Code: Select all
  $output = (isset ($convoArr['send_to_user'])) ? $convoArr['send_to_user'] . ' <br /> <a name="new" />' : "Hi there! Please tell me your name.";


and change it to:

Code: Select all
  $output = (isset ($convoArr['send_to_user'])) ? urldecode($convoArr['send_to_user']) . ' <br /> <a name="new" />' : "Hi there! Please tell me your name.";


The line of code should be at or near line #25, if you're still using the default bot page. :) In the meantime, I'll work on a more permanent fix for this bug.

Hope this helps.
Comforting the disturbed, and disturbing the comfortable
Chat with Morti
User avatar
GeekCaveCreations
Safe, Reliable Insanity, Since 1961
 
Posts: 1115
Joined: April 18th, 2011, 10:52 pm
Location: Nevada, USA

Re: Making bot remember something

Postby voarsh » April 6th, 2012, 6:12 pm

Have you lot forgotten that I am using V 1?

There's no GUI folder.

I also could not find that code in my index of /bot2/

People browse to that page to use the chat bot.
voarsh
Obsessed Member
 
Posts: 114
Joined: March 12th, 2012, 8:59 pm

Re: Making bot remember something

Postby GeekCaveCreations » April 6th, 2012, 6:58 pm

Oops? It seems that we have, but only because you originally posted in the support forums for version 2. I'll move the posts to the proper forum, and look for an answer. Silly us! :)
Comforting the disturbed, and disturbing the comfortable
Chat with Morti
User avatar
GeekCaveCreations
Safe, Reliable Insanity, Since 1961
 
Posts: 1115
Joined: April 18th, 2011, 10:52 pm
Location: Nevada, USA

Re: Making bot remember something

Postby GeekCaveCreations » April 6th, 2012, 7:37 pm

I'm afraid that my version 1 test bot does not have a category for "BAD ANSWER" in it's DB. If you can post that particular category that your bot is using, then I can add it, and test further.
Comforting the disturbed, and disturbing the comfortable
Chat with Morti
User avatar
GeekCaveCreations
Safe, Reliable Insanity, Since 1961
 
Posts: 1115
Joined: April 18th, 2011, 10:52 pm
Location: Nevada, USA


Return to Bugs and Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron