[OpenSourceProject] Talk2Me Bot

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    :-) s-p-n is offline
    DeveloperRank
    Jun 2007 Join Date
    Next DoorLocation
    2,098Posts

    [OpenSourceProject] Talk2Me Bot

    Special Thanks to HotelUnderSeige for this idea!

    Talk2Me Bot is an engine powered by PHP & MySQL with the soul purpose of creating a totally interactive, seemingly human "Talking Bot" system!

    I signed up a trial account at http://www.awardspace.com

    I made an SQL Database named Talk2MeBot_main
    I then made a table named robot_1 with 3 fields, (entryID, tag, response).

    tag is a '|' separated list with terms that will trigger this response.
    response is a '|' separated list with responses displayed at random for a tag

    Now to the PHP file, I'm going to use my new Notepad++ for this part ;)

    I made a page called index.php, folder called includes, file inside includes called functions.php

    I made a sub-domain called http://talk2mebot.awardspace.com


    • View the file source by using the FTP details below

    Try out the "Add New" link.

    At the moment it looks for a tag match and finds a list of responses that go with that tag. Then it picks a random response from the list and echoes it.

    It would be cool if it took spaces out of the user's response, and separated each word as a value, then looked through those values for a tag match.. But I just briefly made the code for it to work.

    If you want to go ahead start development, I need these things done:

    • Delete whole entries.
    • Add single Tags/Responses.
    • Edit single Tags/Responses.
    • Delete single Tags/responses.
    • Error Message Displayed if user input doesn't match tag.
    • Anything else you can think of!

    It's open source, so you can post updates here at the moment, for sake of getting started fast.

    Private Message me if you're interested in being a part of the Administrative team.

    All members of the Administrative team get the FTP details, MySQL (PhpMyAdmin) details, and they get to basically, do everything I can do.

    Due to possible security flaus, I can't give you the password to my actual hosting service.

    Please be aware that I only have a trial, so I need to find another free host that covers mysql & PHP, or I need to find someone who can host it for me..

    Anyway, Have fun creating more conditions for this little engine!

    Go there now! Everything you can possibly think of saying will have a response! On top of that, it can grow a little every day!


    EDIT: (11:36 PM OCT 9, 2008 [24 min till my b-day =D]) Now you can upload to the new Open Source Section via FTP!
    Help the effort by creating a stylesheet, template, or even a functional update!
    Test how it will work and behave by viewing this link:
    http://talk2mebot.awardspace.com/opensource/index.php

    Open Source FTP:
    Host: talk2mebot.awardspace.com
    Username: talk2mebot_open
    Password: opsrc1234
    Last edited by s-p-n; 10-10-08 at 06:15 PM. Reason: took out source since it's in the FTP account


  2. #2
    Account Upgraded | Title Enabled! Hidden is offline
    MemberRank
    Apr 2008 Join Date
    .Location
    367Posts

    Re: [OpenSourceProject] Talk2Me Bot

    Try to code this in flash :)
    then the page won't refresh when you talk to it, which makes it way more realistic

  3. #3
    Vous Pas Reel HotelUnderSeige is offline
    MemberRank
    Nov 2007 Join Date
    ColoradoSpringsLocation
    1,290Posts

    Re: [OpenSourceProject] Talk2Me Bot

    omg dont i feel specaill lol 100% better then mine good job mate

  4. #4
    :-) s-p-n is offline
    DeveloperRank
    Jun 2007 Join Date
    Next DoorLocation
    2,098Posts

    Re: [OpenSourceProject] Talk2Me Bot

    Quote Originally Posted by HotelUnderSeige View Post
    omg dont i feel specaill lol 100% better then mine good job mate
    Hahaha.. The good part is you get to help with development :wink_5:

  5. #5
    Gamma Daevius is offline
    MemberRank
    Jun 2007 Join Date
    NetherlandsLocation
    3,252Posts

    Re: [OpenSourceProject] Talk2Me Bot

    Ask FragFrog, he did some AI in PHP as well (he calls it FAI). His bot actually learns how to respond, pretty fun concept to play with.

    Also, what is this supposed to do?
    FA^iZXA
    VUULaGSDVDUU]ZCYl:EC[>U@CaY_R
    o_W[YCYl:EC[>aCACba02627a@Z=8AF
    =QFWPVA
    FV
    S]WT]C>aY :kok=8VUA_A]KEC[>^SQCI@ECCZm_
    oGEWECNAEC[>aCAAT[S"
    \V\XB_\XWTLC ;8^J@VTlhhT[S
    ATPlhV_N
    oAS^R>TP
    oVWFVUSKH=8;SI|YSaaRSEW
    UQBWSO@H?<[QICUFi_VoCC]C>WBUHokK?<E=&ufaQKi_VJF]KEC[>Q^iWDUmEFEh&'5 ?=ABEobyacA_AQ@DSN>a@_N
    o@SS[>SSFWhY\QAF>`}efZBl:h"-.{{s
    ABSOmZaI_OAF
    =USZmRa@WiACW>!.ywZokM?<W[l:I:kBAiur5BSD@V=QBD@AZSD h&'5 ?=ABAmf}d5B\SD@V=QBD@AZSD h1-2d
    :kBAiqx.)(uVaIm[SGIED@_BD
    XWEAF>s}yy~$KZ=8E=&ufaQKi_VJF]KEC[>Q^iWDUmEFEh&'5 ?=ABAmf}d5BSD@V=QBZmDWV
    =CQWBR>B[XUMBEobyacHYA=8E="}}{rA_AQ@DSN>a@_N
    o@SS[>SSFWhY\QAF>s}yy~$KZ=8K

  6. #6
     Meth0d is offline
    MemberRank
    Feb 2007 Join Date
    The NetherlandsLocation
    1,450Posts

    Re: [OpenSourceProject] Talk2Me Bot

    It's encrypted/scrambled from the looks of it.

  7. #7
    :-) s-p-n is offline
    DeveloperRank
    Jun 2007 Join Date
    Next DoorLocation
    2,098Posts

    Re: [OpenSourceProject] Talk2Me Bot

    Quote Originally Posted by Daevius View Post
    Ask FragFrog, he did some AI in PHP as well (he calls it FAI). His bot actually learns how to respond, pretty fun concept to play with.

    Also, what is this supposed to do?
    I tried to encrypt the connection lol.. At first I uploaded and refreshed, thought it worked.. Then after a few more refreshes, I got an error and took it out. Then I decided to include it from the part of the site nobody can see.

    You'll notice in the FTP account there is no connect folder. It includes that file from the main includes file.

    I made a new function last night.

    While updating/creating a new list,
    If you type :NEG: in the response field, it will bring up those answers when there are no pairs to match. That way, no matter what you'll get a response.

    I want to make more commands lke :PRIORITY:1: counts this response twice when it's randum and :PRIORITY:2: would count it 3 times.

    I also need some restrictions while adding/updating the list.

    I already saw someone added a new "hello" list, when you could've just added that response to the existing list.. and should have for that matter.

    But a self-building engine with no restrictions is a faulty one at that.

    Anyone wanna make a user function so I don't feel as hesitant to make a delete button??

    Lol

    Edit: Smilies got in the way.. haha..

    I meant, with ':' instead of ';'

    ;PRIORITY;1; ;PRIORITY;2;
    Last edited by s-p-n; 10-10-08 at 06:32 PM. Reason: smilies got in the way

  8. #8
    Member G_NETWORK is offline
    MemberRank
    Aug 2007 Join Date
    In a box :PLocation
    87Posts

    Re: [OpenSourceProject] Talk2Me Bot

    Please for fuck sake use htmlentities...
    <noscript> and <plaintext> got added already...
    Just use:
    echo htmlentities($response)
    Just as base protection..

  9. #9
    :-) s-p-n is offline
    DeveloperRank
    Jun 2007 Join Date
    Next DoorLocation
    2,098Posts

    Re: [OpenSourceProject] Talk2Me Bot

    Quote Originally Posted by G_NETWORK View Post
    Please for fuck sake use htmlentities...
    <noscript> and <plaintext> got added already...
    Just use:
    echo htmlentities($response)
    Just as base protection..
    There was no point to add those :/

    htmlentities for $response are already in use

    PHP Code:
    VALUES("'.$tag.'","'.htmlentities($response).'"
    It's put into htmlentites before it's databased. No need to put it through htmlentites again when I echo it to the edit form.. When it's sent as a message, it gets put through html_entity_decode() of corse.


    On to other news, I setup a little bit of regex to make it a little bit better.

    One thing gets to me though..

    It brings up the first match it finds in the database, while the database is loaded in a random order.

    So if you say "hi, you suck" it might bring up a friendly greeting (hi), or it might insult you back (suck).

    So when I said, "what's up you piece of shit!?"
    First it said "Your grandma eats bite-size little pieces of shit for breakfast!" - (piece of shit)
    Then I tried again and it said "Life is not good.." - (what's up)
    It's coming along great I think..

    But I think it needs a human in the back-end to pick and choose the right answers for the right questions.. Can anyone make me a human in PHP?

  10. #10
    Proficient Member AngryCat is offline
    MemberRank
    Jun 2007 Join Date
    *care*Location
    196Posts

    Re: [OpenSourceProject] Talk2Me Bot

    cool :D
    I think I'll help out with something,, just not quite sure about what yet,,

  11. #11
    Account Upgraded | Title Enabled! ushpen is offline
    MemberRank
    Jul 2007 Join Date
    PhilippinesLocation
    628Posts

    Re: [OpenSourceProject] Talk2Me Bot

    Nice, i love it.

  12. #12
    Member G_NETWORK is offline
    MemberRank
    Aug 2007 Join Date
    In a box :PLocation
    87Posts

    Re: [OpenSourceProject] Talk2Me Bot

    Quote Originally Posted by s-p-n View Post
    But I think it needs a human in the back-end to pick and choose the right answers for the right questions.. Can anyone make me a human in PHP?
    PHP Code:
    Function Human($name,$sex,$age) {
    "Add your lifeline here"
    }
    New 
    human => human(Bob,male,18

  13. #13
    :-) s-p-n is offline
    DeveloperRank
    Jun 2007 Join Date
    Next DoorLocation
    2,098Posts

    Re: [OpenSourceProject] Talk2Me Bot

    Quote Originally Posted by G_NETWORK View Post
    PHP Code:
    Function Human($name,$sex,$age) {
    "Add your lifeline here"
    }
    New 
    human => human(Bob,male,18
    Haha.. something can be done with that..

    PHP Code:
     Function human($name,$sex,$age) {
    list(
    $a_name['first'],$a_name['mid'],$a_name['last']) = split(' ',$name);
    echo 
    '<h3><i>About Me..</i></h3>';
    echo 
    '<p>My name is '.$name.', you can call me '.$a_name['first'].' for short.';
    echo 
    '<br>';
    echo 
    'I am '.$age.' years old.';
    echo 
    '<br>';
    echo 
    'You probably already know due to my name, but I happen to be a '.$sex.'.</p>';
    }

    function 
    updateHuman($name,$sex,$age) {
    echo 
    '<form action="index.php" method="post">';
    echo 
    'Name: <input name="name" value="'.$name.'" type="text" /> <small><i>(first, middle, last)</i></small>';
    echo 
    '<br>';
    echo 
    'Age: <input name="age" value="'.$age.'" type="text" />' ;
    echo 
    '<br>';
    echo 
    'Gender: <input name="sex" value="'.$sex.'" type="text" />';
    echo 
    '<br>';
    echo 
    '<input type="submit" name="create" value="Update Human!" />';
    echo 
    '</form>';
    }

    $name $_POST['name'];
    $sex $_POST['sex'];
    $age $_POST['age'];

    updateHuman($name,$sex,$age);

    if(
    strlen($age)>&& strlen($sex)>&& strlen($name)>0) {
    human($name,$sex,$age);
    } else {
    human(Bob,guy,18);

    lol.. I dunno..

  14. #14
    The Gamma..? EliteGM is offline
    MemberRank
    Jul 2006 Join Date
    NandolandLocation
    4,078Posts

    Re: [OpenSourceProject] Talk2Me Bot

    Started playing around with a class for it and came with this!

    PHP Code:
       <?php
    class Human
    {
        var 
    $First;
        var 
    $Name;
        var 
    $Middle;
        var 
    $Last;
        var 
    $Sex;
        var 
    $Age;
            
        function 
    Human($first$middle$last$sex$age)
        {
            
    $this->Name   $first;
            
    $this->First  $first;
            
    $this->Middle $middle;
            
    $this->Last   $last;
            
    $this->Sex    $sex;
            
    $this->Age    $age;
        }
        
        function 
    Human_fullName()
        {
            if (empty(
    $this->Middle))
            {
                
    $fullName $this->First .' '$this->Last;
            } else {
                
    $fullName $this->First .' '$this->Middle .' '$this->Last;
            }
            return 
    $fullName;
        }
        
        function 
    Human_show($name$sex$age)
        {
            
    $fullName $this->Human_fullName();
            echo 
    '<h3><i>About Me..</i></h3>';
            echo 
    '<p>My name is '.$fullName.', you can call me '.$name.' for short.';
            echo 
    '<br>';
            echo 
    'I am '.$age.' years old.';
            echo 
    '<br>';
            echo 
    'You probably already know due to my name, but I happen to be a '.$sex.'.</p>';
        }
        
        function 
    Human_update_show($first$middle$last$sex$age
        {
            echo 
    '<form action="'.$_SERVER['PHP_SELF'].'" method="post">';
                echo 
    '<table border="0">';
                echo 
    '<td>First Name: </td><td><input name="name" value="'.$first.'" type="text" /></td></tr>';
                echo 
    '<tr><td>Middle Name: </td><td><input name="mname" value="'.$middle.'" type="text" /></td></tr>';
                echo 
    '<tr><td>Last Name: </td><td><input name="lname" value="'.$last.'" type="text" /></td></tr>';
                echo 
    '<tr><td>Age: </td><td><input name="age" value="'.$age.'" type="text" /></td></tr>';
                echo 
    '<tr><td>Gender: </td>';
                echo 
    '<td><select name="sex" selected="'.$sex.'">';
                echo 
    '<optgroup label="Gender">';
                echo 
    '<option value="Male">Male</option>';
                echo 
    '<option value="Female">Female</option>';
                echo 
    '</optgroup>';
                echo 
    '</select>';
                echo 
    '</td></tr>';
                echo 
    '<tr><td></td><td><input type="submit" name="create" value="Update Human!" /></td></tr>';
                echo 
    '</table>';
            echo 
    '</form>';
        }
    }

    if (
    $_POST['create'])
    {
        
    $Human = new Human($_POST['name'], $_POST['mname'], $_POST['lname'], $_POST['sex'], $_POST['age']);
    } else {
        
    $Human = new Human('Bob''''Bobkinsons''Male'22);
    }

    $Human->Human_show($Human->Name$Human->Sex$Human->Age);
    $Human->Human_update_show($Human->First$Human->Middle$Human->Last$Human->Sex$Human->Age);

    ?>
    Last edited by EliteGM; 19-10-08 at 02:04 PM.

  15. #15
    Member G_NETWORK is offline
    MemberRank
    Aug 2007 Join Date
    In a box :PLocation
    87Posts

    Re: [OpenSourceProject] Talk2Me Bot

    Lets make a opensource human thread to post al you humans! XD



Page 1 of 2 12 LastLast

Advertisement