This is the 0.01 beta of my AI::Rive module. So far, this module's features are very small... it only learns and repeats (similar to my Nexus brain but a little better at matching).
The code is quite confusing, so I put a lot of comments in (mostly next to all the variables so you know what they are, because a lot of them have similar names, like $prevmsg, $past, and $past_p ).
A quick overview of the POD:
Quote:
NAME
AI::Rive - Rendering Intelligence Very Easily
SYNOPSIS
Code:
use AI::Rive;<br /><br /> # Create a new Rive.<br /> my $rive = new AI::Rive (<br /> debug => 1,<br /> name => "Casey Rive",<br /> sex => "male",<br /> path => "./my rive",<br /> );<br /><br /> $rive->process (1);
DESCRIPTION
The RIVE project was created by AiChaos, Inc. as our first major attempt at Artificial Intelligence--at least to the point of simulating a human mind.
METHODS
new Creates a new RIVE object. Include variables in a hash format (see synopsis). See below for a list of the variables. Any module variables can be defined at this point. Highly recommended fields are "name" and "path" - name is the entity's name (defaults to Casey Rive), and path is where it will store all its data (defaults to "./rive"). If the path doesn't exist, it will be created as well as filled with default files and data.
Code:
my $rive = new AI::Rive (<br /> debug => 1,<br /> name => 'Casey Rive',<br /> sex => 'male',<br /> path => './my rive',<br /> );
process Starts a never-ending loop of processing (would be best used if your entire application was to let this bot live and thrive by itself). You can also pass the optional parameter of "1" and the application will prompt you for your input, to chat with your entity. If you can't chat with your entity, it won't live the happiest life in the world, since it will be isolated from all conversation.
Code:
$rive->process (1);
processOnce The module will go on a single process loop and then return, allowing your application to do multiple things in the background. This is the best option, especially for use with other looping interfaces (i.e. an MSN or AIM robot).
not listed here, download and check "doc.html" if you want to know what the internal methods are. these methods are all called by the module itself, you shouldn't have to worry about them
TO DO - Message connotations and all the things that come with it (mood and relationship changes, ability to create its own lists of positive and negative words, etc.) - Many other things. Right now this thing just learns and repeats. =P
If you were to apply this to a bot, you would probably have code like this:
Code:
# Create a new Rive<br />our $rive = new AI::Rive (.....);<br /><br /># Create MSN objects?<br />my $msn = new MSN (....);<br /><br />#################<br /><br /># reply getting sub<br />my ($code,$reply) = $rive->processOnce (nick => $user, message => $msg);
processOnce returns a number code. So far the codes are 1 (success) or 2 (system error/message). To avoid confusing your users, you might use two different colors, one color for messages that come from the bot itself, another for system messages generated by the module (in my first Rive bot beta, I used skyblue and orange).
The reason I'm releasing this module is for anybody who wants to test it, and report bugs or suggestions here.
Suggestions: • I have an idea of a way for the bot to create its own list of "bad" words, but I need your ideas on how the bot could create lists of "good" words, first through third person types of words (so it would learn peoples' names instead of just taking their message as a new reply, for example). • If you have any suggestions on a better name space than AI::Rive, you can post your ideas here too. • Post any other suggestions or ideas about A.I. and how the module could be improved.
As I make additional betas, I'll post them under this topic. _________________ Current Site (2008) http://www.cuvou.com/