Cynthia™
Program E



-1. If you have a previous version of Program E delete all of its files and wipe its database.

0. Prerequisites: PHP (4.0.4+) compiled --with-mysql and --with-xml and a recent version of MySQL 3.23.xx and Apache. PHP version 4.2.2 recommended.

1. Create a new directory (i.e. "/programe/") in the root of your web server. Download Program E and unzip all the files into this directory or unzip them first to your hard drive and then upload using an FTP program such as FileZilla.

2. Create a database for the program to use in MySQL. Alternatively, you can also use an existing database, such as the one your website is running on.

3. Create the tables in the database using db.sql which is in the sql directory (/sql/mysql/db.sql). If you have phpMyAdmin you can navigate to this file with the Browse button under the SQL tab (if you unzipped the files to your hard drive) or you can paste the script in the SQL query box.

4. By default, AIML files and startup.xml are in the aiml directory. Always use the startup.xml file included in the distribution. Download an AIML set that works well with program E, such as Alice AIML 2.0. Unzip and upload all the files to the aiml directory. Delete "std-pickup.aiml" and "std-65percent.aiml".

5. Open startup.xml in the aiml directory and replace the values of the property names to match your bot's personality.

6. Edit dbprefs.php (/src/admin/dbprefs.php) with your database information and aiml directory information. Fill out values for $DB_HOST, $DB_UNAME, $DB_PWORD and $DB_DB. Use the Absolute Path to the AIML directory for $rootdir (and don't forget the trailing slash "/"). If it turns out wrong in step 7, come back here with (part of) the path botloader.php includes in its error message. For Windows, use c:/htdocs/alfredo/aiml.

    Example:

    $rootdir="/home/username/public_html/programe/aiml/";
    $DB_HOST="localhost";
    $DB_UNAME="username";
    $DB_PWORD="password";
    $DB_DB="username_cynthia";

7. The src/admin directory (http://www.yoursite.com/programe/src/admin) must be writable by the web server because botloader.php will attempt to create a file subs.inc. Or you can also create an empty subs.inc file and make it writable.

8. From your web browser, access botloader.php (http://www.yoursite.com/programe/src/admin/botloader.php) to load the AIML into the database. This might take a few seconds. IMPORTANT NOTE: Whenever botloader.php is loaded it deletes all the existing patterns/templates in the database and then loads them from the AIML file(s).

9. Access talk.php (http://www.yoursite.com/programe/src/talk.php) from your web browser and say something to the TestBot. For Windows, use http://127.0.0.1/programe/src/talk.php or http://localhost.com/programe/src/talk.php.

10. Password protect your admin directory with a .htaccess file so no one can mess around with reloading your bot.

11. Replace the contents of flash.php (http://www.yoursite.com/programe/src/flash.php) with the following code:

<?php
include "respond.php";
$bottouse="TestBot";
$numselects=0;
session_start();
$myuniqueid=session_id(); $botresponse=replybotname($_POST['text'],$myuniqueid,$bottouse);
$output = str_replace("\n", " ", $botresponse->response);
$finalstring = "&bot_name=" . urlencode($bottouse) . "&alice_in=" . urlencode($_GET['text']) . "&alice_out=" . urlencode($output) . "&textLoaded=1";
print $finalstring;
?>