Posted: Thu Aug 10, 2006 12:35 am Post subject: Rivescript and perl help pls
im using perl to run my mayabot, but have noticed that rivescript appears to be more beginner friendly to use to edit stuff? so iv downloaded that, but im sure i read somewhere(and can't find it) that i neeto do something to let perl know that i am using rivescript? can anyone help?
also my bot is crashing everytime i say "who are you" to it, or asking something it doesnt recognise, can anybody shed some simple light on this?
RiveScript is a response engine, not a bot. All you need to do to make Mayabot use it is make a few additions or changes to the code.
Firstly, near the top of the main bot code with all the use statements (eg use MSN;), you have to use RiveScript and initialize it to use your RiveScript brain.
Code:
use RiveScript;
our $rivescript = new RiveScript;
$rivescript->loadDirectory ("./brain"); # somewhere full of .rs files
$rivescript->sortReplies;
And then, where your bot has its Message handler for receiving messages for MSN, just send their name and message to the RiveScript object, and return the replies.
I'm not entirely familiar with Mayabot's code, but here's the basic gist of it:
Code:
sub Message {
my ($self,$user,$name,$msg) = @_;
# get a rivescript reply
my $reply = $rivescript->reply ($user,$msg, scalar => 1);
# send it back
&send ($user,$reply);
}
I'm not sure how Mayabot's &send sub calls are formatted, or what it named their sub for handling messages, or what they named the variables, or anything else... but that's how to do it, you should be able to figure it out from there. _________________ Current Site (2008) http://www.cuvou.com/
thanks cer, I'll give it a go. do you know if there are any other bots/bot templates out there that are easier to modify and build on than mayabot? I have been working on my mayabot(adele) template for a good 4-5days now, have been told several times when iv asked for help to "go learn perl" which i and am trying, proving to be quite difficult(well nothing is easy) am only just grasping the basics of learning to read it, let alone write! thanks foryou help i'll put it into some practise now
thanks cer, I'll give it a go. do you know if there are any other bots/bot templates out there that are easier to modify and build on than mayabot? I have been working on my mayabot(adele) template for a good 4-5days now, have been told several times when iv asked for help to "go learn perl" which i and am trying, proving to be quite difficult(well nothing is easy) am only just grasping the basics of learning to read it, let alone write! thanks foryou help i'll put it into some practise now
Posted: Tue Jan 16, 2007 6:07 pm Post subject: Mayabot 4
Dude, I've selected the link you gave at the top of the site, which ables you to download Mayabot 4, but it wrote, not found, can somebody help me please!!! HELP ME, IMPORTANT!!! Or maybe you can tell me another link to download Mayabot, I checked out the net and I've found nothing, Please HELP!