[alicebot-general] J-ALICE news
mehri
foreverlinux at yahoo.com
Sun Sep 3 21:02:34 PDT 2006
Good evening,
If anyone remebers from this thread a few weeks ago:
http://www.nabble.com/J-Alice-0.5---security-risk-by-learning-system-calls-t2042020.html
there was some discussion over the old J-ALICE in which it was said that Java had a really good IRC API library (pircbot which programD uses) and C++ has none:
> Java seems to have the PircBot API (http://jibble.org/pircbot.php). I can't really help with C++
and I responded with:
> I do believe it might....Just might be....time to convert one of those into C++ and do a posting on sourceforge.
Well, I did what I said I was going to do and I converted pircbot into pircbotcpp, the C++ version (tada!):
http://pircbotcpp.sourceforge.net/
What this means is that the first part of reviving J-ALICE is over. The second part is going to be writing the J-ALICE compatiblity layer using RebeccaAIML's framework. The new XML tags, though, will go beyond what J-ALICE's <xml> tag did. The new XML tags will have all the irc commands as XML tags integrated with AIML. Also callbacks into the AIML code from IRC will be possible too.
Here is a taste of some of the designs for the IRC call back mechanism:
Here is a method callback from pircbot whenever a IRC user sends a message:
* @param channel The channel to which the message was sent.
* @param sender The nick of the person who sent the message.
* @param login The login of the person who sent the message.
* @param hostname The hostname of the person who sent the message.
* @param message The actual message sent to the channel.
virtual void onMessage(const char * const channel,
const char * const sender,
const char * const login,
const char * const hostname,
const char * const message)
The "const char * const" are just strings by the way.
Here is how you would write AIML to recieve this callback:
<category>
<pattern>[J-ALICE onMessage] * * * * *</pattern>
<template>
Channel: <star index="1"/>
Sender: <star index="2"/>
Login: <star index="3"/>
HostName: <star index="4"/>
Message:<star index="4"/>
</template>
</category>
Every IRC onXXXXX method will have the form [J-ALICE onXXXXX] followed by stars for each numerical or string that's in the callback. Obviously not all IRC onXXXXX methods can be trapped this way but the good majority which will be needed to write effective AIML bots on IRC will be.
Here is one last example that shows how to trap all the remaining J-ALICE onXXXXX's methods which you did not implement but don't want your default star catching.
<category>
<pattern>[J-ALICE * </pattern>
<template>
</template>
</category>
Isn't AIML beautiful? :-)
More information about the alicebot-general
mailing list