Sign in to follow this  
Followers 0
theguy0000

AIML Bot!

15 posts in this topic

#1 ·  Posted (edited)

hey I made a bot in autoit...you can talk to it and have conversations with it...

NOT very good conversations unless ur good with aiml and willing to make a good brain file

(they get long... :lmao: ).

heres the program:

aiml.au3

heres XML.au3 (written by erifash but i modified it alot ;) ):

XML.au3

and the forum will not allow me to attach .aiml files. so, here is brain.aiml

<?xml version="1.0" encoding="ISO-8859-1"?>

<aiml>
    <botinfo>
        <name>MyBot</name>
        <unknown>I'm Sorry. I did not understand what you said. Please try again.</unknown>
    </botinfo>
    
    <category>
        <pattern>hello</pattern>
        <template>Hi there!</template>
    </category>
    
    <category>
        <pattern>What is your name?</pattern>
        <template>I am &botname;. Who are you?</template>
    </category>
    
    <category>
        <pattern> I am *</pattern>
        <template>That's a nice name.</template>
    </category>
</aiml>

obviously, it is IMPOSSIBLE to have a good conversation when you are using a brain file with 3 categories :king:

---------------------------------------------

ok, now, how to create a brain file? well, its basically just xml. open your favorite text editor (notepad will do).

now, put this at the top:

<?xml version="1.0" encoding="ISO-8859-1"?>

to start the xml file.

put

<aiml>
to add the aiml.

then, make a bot info tag:

<botinfo>
<name>MyBot</name>
<unknown>I'm Sorry. I did not understand what you said. Please try again.</unknown>
</botinfo>

heres what the botinfo tag does:

name: defines what your bot will be known as. Obviously you can change it from MyBot to Joseph or whatever you want o:)

unknown: this is what your bot will say when somebody says something that the bot does not recognize (something that you do not have a category for)

then, you are ready to tell the bot what to say.

<category>
<pattern>hello</pattern>
<template>Hi there!</template>
</category>

every reply is inside a new category tag.

pattern tag: tells what the user will say to trigger the bot's reply.

NOTE: do not bother with capitolization or punctuation here. It will be removed anyway.

NOTE2: you can use wildcards (*) here.

template tag: tells what the bot will say when the user says whatever is inside <pattern>

NOTE: if you put &botname; in here, it will be replaced with the bot's name. For example, the following would work inside a template tag: Hi, I am &botname;! who are you?

The SRAI tag:

well, what happens if you want the bot to reply the same way to different patterns, but don't want to rewrite the template each time? that's what the srai tag is for! put <srai>pattern</srai> inside the template tag and the bot will react as if the user said "pattern" (or whatever you have inside the tag)

for example:

<category>
    <pattern>hello</pattern>
    <template>Hi there!</template>
</category>

<category>
    <pattern>hi</pattern>
    <template> <srai>hello</srai> </template>
</category>

one of the most useful parts of the srai tag is that it doesn't have to exactly match the pattern if you use wildcards. So, if you had <pattern>my name is *</pattern> and you used as one of your templates <srai>My name is Bob</srai>, it will still match as an srai.

-----

after you have all of your categories, end it with:

</aiml>
and run your bot!

---------------------------------------------

and a BIG THANKS to greenmachine for the __ArraySearchWithWildcards function and for spending so much time helping me to get this to work!

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites



@mikeytown2: heh no unfortunately...maybe later

---------

updated the first post with info on the brain file.

I hope to get some really good brain matter :o for this bot...


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@mikeytown2: heh no unfortunately...maybe later

Why not use

;; Sports scores possible method
$oIE = ObjCreate("Shell.Explorer.2")
$oIE.navigate($SPORTS-SCORES-WEBSITE)
$oDocument = $oIE.document
$odocument.getElementById($SPORTS-SCORES-TABLE-OR-DIV-ID).innerHTML
;; Then format and process the HTML here, using StringSplit, StringReplace, _ArraySort, _ArrayJoin, etc.

Could work, couldn't it? :o

Edited by Pa Callender

[size="4"]YOU SHALL NOT PARSE!![/size]

Share this post


Link to post
Share on other sites

yeah i guess that would work :o thanks


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

very cool as a proof of concept. I'm going to run this script into a generic gamebot and see what can happen :)

(awesome forums and program, btw.)

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

not sure if u have heard of A.L.I.C.E or not, but go here: they have the aiml source avaiblible:

http://www.alicebot.org/aiml/aaa/

now u can add alot more to ur bot.

this is awesome.. maybe add speech to the bot aswell.. :wink:

edit how can you randomize the sayings?? like respond different answers to the same questions, ect.

I thought it was.. but my mistake..

<category>
        <pattern>Hi</pattern>
        <template>
         <srai>Hello there!</srai>
         <srai>Hello</srai>
         <srai>What is up?</srai>
         <srai>How are you doing? I'm sherise</srai> 
        <srai>Hi There!</srai> 
         </template>
    </category>
Edited by slightly_abnormal

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

this is a very interesting concept, i think you should implement a feature that when a phrase is not understood, the bot asks what a good answer would be and then add it into brain.aiml.

Edit: I am making a 'brain' editor, hope it turns out good

PS: i am not sure what the <srai> tag does, your example retuns <srai>hello<\srai>

Right here is the first Brain Editor that works, it only adds a new Response but it's easier than notepad. I will soon add error checking etc

You need my Custom XML file

Brain_Editor.au3

Edited by RazerM

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

someone should convert this to use zerocools speech api so we could talk to our computers. If its been done plz pm me with the source.

Edited by PezoFaSho

50% of the time, it works all the time

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

* Removed, due to not working to post the whole data text *

Didn't work to post the full text so here you go to download it:

http://www.techknow.homedns.org/aiml/progr...ml/Default.aiml

Here you can get other AIML categories of brain files:

http://www.techknow.homedns.org/aiml/programe-v.09/aiml/

Rename the choice of your AIML file to brain.aiml and save it in the program folder.

Edited by Frettub

Share this post


Link to post
Share on other sites

i really want to see sapi embeded into this. Imagine talking to your computer instead of typing.


50% of the time, it works all the time

Share this post


Link to post
Share on other sites

I don't suppose you could write a script that would generate brain xmls...

Aside from the fact that no brain is necessary to emulate most online activity.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0