RiveScript::Tutorial is a beginner's guide to creating their first RiveScript brain.
This tutorial outlines the various capabilities of the RiveScript specification and offers some recommended pointers for creating a well-formed RiveScript brain. What you do with this knowledge is up to you; be creative!
Be sure to skim over the RiveScript manpage first, because this tutorial jumps right in to using the various RiveScript commands without always explaining what each of them do.
A Simple RiveScript Interpreter
Here is a simple Perl script for running a RiveScript interpreter. This assumes that the brain's RS files will be stored in a directory called "tutorial", local to the Perl script. You'd want to edit certain parameters in this code if you see fit.
#!/usr/bin/perl -w
use strict;
use warnings;
use RiveScript;
# Create the RiveScript interpreter.
my = new RiveScript();
# Load the RS tutorial brain.
("./tutorial");
# Sort them.
;
# Go into a chatting loop.
while (1) {
print "User> ";
my = ;
chomp ;
# Grab a reply.
my @reply = ('user',);
print " Bot> " foreach(@reply);
}
Requirements:
· Perl