{{ define "title" }}RiveScript{{ end }} {{ define "content" }}
In short, it's a scripting language used to match a response to a message provided by the human.
In its simplest form, RiveScript code might look like this:
+ hello bot - Hello, human!And can get into some more complicated things like this:
+ my name is * * <get name> == undefined => <set name=<formal>>Nice to meet you, <get name>>! * <get name> == <formal> => I know, you've told me your name before. * <get name> == <bot name> => <set name=<formal>>Wow, we have the same name! * <get name> != <formal> => <set name=<formal>>Did you get a name change?
For my Perl RiveScript library, the latest version can always be downloaded from CPAN:
http://search.cpan.org/perldoc?RiveScript
Due to RunABot's restrictions and the fact that free bot accounts would suffer anytime there was a server problem, I found my way to the website of the ALICE A.I. Foundation, the home of AIML and the chatterbot that made it famous: Alice. I downloaded AliceBot Program D, a Java-based AIML robot that worked on AIM and IRC. Immediately it was much more responsive and fast than RunABot, but at a price: it had no built-in rate limit circumvention. The bot I ran from Program D wasn't popular enough that it would violate its rate limits by sending its messages instantly to its users, but it was a concern of mine. Also, it had no way of defending itself against the infamous Warning system that AIM has.
I learned a lot about Perl just by tinkering with these bot templates. After I got a good handle on the language, I started releasing my own bot templates based on the WiredBots code, before rewriting some of my own templates from scratch. The one thing I missed about my past bot adventures that I couldn't get from Perl: the AIML language of Alice bots.
Ultimately giving up with Program V's code, and failing numerous times with XML parsers trying to create my own, I had little other choice than to create something new. Something easier for Perl to parse. I made a couple of my own XML-based languages, which failed. A couple other attempts later, and I ended up with a rather simple concept: creating a text-based language driven by command characters and lines of text. The basic idea was that the language should look like this:
+ hello bot - Hello human!A plus for the trigger to match against the human's message, and a minus for the bot's response. Following that format I added a few more commands to enable it to handle conditionals, redirections, topics, and a lot of the other cool things that AIML can do.
After working on Chatbot::Alpha for a while, it grew to be more powerful than the simple idea that started it, however it wasn't being programmed very efficiently. It wasn't as powerful as AIML yet, and the logic of the program didn't allow for complicated things that would rival the <that> tag from AIML.
<!-- This is an example of the <that> tag in AIML --> <category> <pattern>ASK ME A QUESTION</pattern> <template> <random> <li>Do you have a dog?</li> <li>What's your favorite color?</li> </random> </template> </category> <category> <pattern>YES</pattern> <that>DO YOU HAVE A DOG</that> <template> What is its name? </template> </category>
Thus, I lost interest in furthering the development of RiveScript. That was in 2005. Now, three years later, somebody in a different forum posted a thread about wanting to learn Perl. I asked why (for CGI or for offline programming) so I could link him to the appropriate tutorial, and he said he wanted to learn it because he heard he could program bots with it. That inspired me to dust off the old RiveScript module and fix it up.
Development of a RiveScript 2.00-compliant module is still in development, but it's getting close to completion. I'm trying to learn C++ with the goal of eventually making a RiveScript interpreter in that, which could be compiled into a DLL or Shared Object that other programs could utilize, or provide the source code to allow it to be directly compiled in with other programs. {{ end }}