 
   ______)\    __  /\    ________/(____
  /______  \  /  \/__\  //      /     \\
   /   _/  \\/   \\   \//  |___//   |  /
  //   \    \\     \  \\   |   \   ___/_
 /_____/     \\ ___/___/________\_______\
 :::: /________\ ::::: [alice.tcl] ::::::

 alice.tcl v1.2.0 - by strikelight ([sL] @ EFNet) (September 16, 2002)

 =-=-=-=-=
 Contents:
 =-=-=-=-=

 1....contact.................contact information
 2....description.............about alice.tcl
 3....requirements............minimum eggdrop requirements
 4....installation............how to install the script
 5....usage...................how to use the script
 6....history.................changes made to script
 7....variable settings.......variable configuration descriptions
 8....faq.....................frequently asked questions
 9....greetings...............greetings and salutations

 =-=-=-=-=-=
 1. Contact:
 =-=-=-=-=-=

 - E-Mail: strikelight@tclscript.com
 - WWW   : http://www.TCLScript.com
 - IRC   : #Scripting @ EFNet

 Note: DO NOT CONTACT ME IF YOU HAVE NOT READ THE ENTIRE
       CONTENTS OF THIS README FILE. ANY MAILS THAT ARE ANSWERED
       IN THIS FILE WILL BE IGNORED. BE WARNED. I DO NOT HAVE
       TOLERANCE FOR THE LAZY.


 =-=-=-=-=-=-=-=
 2. Description:
 =-=-=-=-=-=-=-=

 This is a TCL to turn your bot into an artificially intelligent
 chatterbot.

 This is done via communication with a web engine (which does all
 of the real work) which is located at http://www.alicebot.org
 (not just alicebot.org anymore, since 1.1.0, other alice-engines
  are now used as well, depending on user's choice.)

 There was a project by the name of "Hippie" which was based
 on the ALICE engine, which used a command line program to get
 it's results, but it was never maintained and fell behind,
 and thus is not AIML 1.0 compliant (AIML is the markup language
 the ALICE engine uses to "understand" things and "reply")
 I hope to one day convert/create an AIML 1.0 compliant parser totally
 with TCL, but until that day, here is a script that will interface
 with the ALICE web engine.


 =-=-=-=--=-=-=-=
 3. Requirements:
 =-=-=-=--=-=-=-=

 1) Eggdrop1.1.5-Eggdrop1.6.x
 2) egghttp.tcl v1.0.3 or higher (TO BE LOADED BEFORE THIS SCRIPT!!)
    -OR- bgexec.tcl v1.1 or higher if using Hippie command line interface

 =-=-=-=--=-=-=-=
 4. Installation:
 =-=-=-=--=-=-=-=

 Place script in your scripts directory
 Edit the Configuration options at the top of the script
 Add the line: source scripts/alice.tcl to your eggdrop config (See Note)
 Note: !! _AFTER_ THE LINE THAT LOADS EGGHTTP.TCL !!
 Done.


 =-=-=-=-=
 5. Usage:
 =-=-=-=-=

 1) Message the bot and start conversing with it ..or..
 2) Say the bot's name in a (defined) channel along with some text
    and converse away from there
 3) Depending on configuration, bot's name may or may not be
    required at all times to get a response from it in channel.
 4) To have the bot stop talking to you in channel, tell it to
    "be quiet", or "shut up", or something along those lines. (seriously)


 =-=-=-=-=-=
 6. History:
 =-=-=-=-=-=
 (9/16/02)/v1.2.0 - The Hippie (Program-C) Alice project has been brought
                    up to AIML 1.x specification, so this script now
                    allows you to use the hippie command line interpretter
                    instead of having to communicate over the web if you
                    don't wish to.. you can grab Hippie from
                    http://hippie.sourceforge.net
                    New variables related to usage of hippie command
                    line executable: alice_hippie_path , alice_hippie_inipath ,
                                     alice_hippie_logpath
                    There is an irc_alice.tcl that can be used with Hippie,
                    but it lacks the features that this alice.tcl provides.
                    Note: Usage of Hippie command line executable means that
                          alice.tcl does NOT require egghttp.tcl, however,
                          bgexec.tcl IS needed to communicate with the program
                          in non-blocking mode.  This can be obtained from
                          the same location as egghttp.tcl: www.TCLScript.com
                  - Added new channel flag for eggdrop versions 1.5.x and higher:
                    +/-alice, which means the bot will respond to people who
                    mention its name in +alice channels (.chanset #channel +alice
                    or .chanset #channel -alice to turn off)
                  - Added logging of conversations with bot:
                    New variables: alice_logging , alice_log_path
                  - Added neodave.civ.pl (Hippie) alice engine server
                  - Added a program E (Phillip) alice engine server
                  - Removed the harvard sofia alice engine
                  - Fixed communication with server 0 (alicebot.org)

 (7/24/02)/v1.1.4 - Changed egghttp version requirement to v1.0.3
                    as there was a problem if you specified your own
                    programD server and were using a TCL version 
                    higher than 8.0
                  - Updated FAQ a bit

 (7/7/02)/v1.1.3  - Fixed output replies from the Jaczone engine

 (7/1/02)/v1.1.2  - Strip mIRC codes before sending text to server
                    (Thanks to Wcc for the short regsub line to do so)

 (6/27/02)/v1.1.1 - Alice-Engine #0 (alicebot.org) should work
                    again (until they change something else anyways...)
                  - Added a small bit of text to the FAQ

 (6/18/02)/v1.1.0 - New features.. skipped releasing 1.0.4 to public
                  - Can now choose which site to use as its alice-engine
                  - Two new variable settings:
                    1) alice_respondwithnick -> whether or not to always
                         respond with a user's nick
                    2) alice_respondrequirenick -> whether or not bot's
                         nick is always required to be said for it to
                         respond to a user.
                  - Bit more documentation included now (FAQ)

 (6/14/02)/v1.0.4 - Ok, I lied, no new features this version...
                  - Let's ignore msg commands (ie. passwords)
                  - Bug fix.. rogue 'return' statement outside of proc

 (6/13/02)/v1.0.3 - Fixed up strip_html procedure
                    (Next release should include new features)

 (5/22/02)/v1.0.2 - Fixed problem with &amp; html code
                  - Fixed a caching cookie problem

 (5/14/02)/v1.0.1 - Fixed typo for required egghttp.tcl version (1.0.0)
                  - Let's not let the bot have a conversation with itself
                    or other bots for that matter
                  - Update a user's cookies timestamp so they won't
                    be expired for not being used

 (5/13/02)/v1.0.0 - Initial Release


 =-=-=-=-=-=-=-=-=-=-=
 7. Variable Settings:
 =-=-=-=-=-=-=-=-=-=-=

 alice_cookiesfile
 - File to save alice-engine web cookies to

 alice_cookiesexpire
 - Define the number of days of inactivity at which cookies will expire

 alice_respondpriv
 - Allows or disallows your bot from responding to private messages
   (0 = No, 1 = Yes)

 alice_respondchan
 - Allows or disallows your bot from responding to public channel messages
   when its nick is mentioned (0 = No, 1 = Yes)

 alice_respondrequirenick
 - If alice_respondchan is set to 1, this will require (or not require)
   that the bot's nick be mentioned in all lines of a conversation by a user
   after the initial conversation engagement. (0 = No, 1 = Yes)

 alice_respondwithnick
 - If alice_respondchan is set to 1, to prevent confusion, you may turn this
   feature on, to have the bot respond with the user's nick that it is
   speaking to. (0 = No, 1 = Yes)

 alice_channels
 - If alice_respondchan is set to 1, define the channels that the bot will
   engage conversations in. Separate multiple channels with a space, or
   use "*" for all channels.

 alice_timeoutchat
 - If alice_respondchan is set to 1, define the number of minutes that
   the bot will wait for user's text in a channel after the first
   contact has been made, before giving up on the conversation.

 alice_logging
 - If alice_logging is set to 1, logs will be kept of conversations
   with your bot in a location you specify in the next variable setting.

 alice_log_path
 - If alice_logging is set to 1, set this variable to the location of
   where you want to store the log files.  Note: The path must already
   exist.  Also, you must place the trailing / at the end.

 alice_engine
 - Define the engine to use to power the bot's responses
   This list is:
   0 = www.alicebot.org      (Alice)
   1 = www.agentruby.com     (Ruby)
   2 = program-E server      (Phillip)
   3 = www.jaczone.com       (Cyber-Ivar)
   4 = neodave.civ.pl        (Hippie)
   5 = Your own program-D Alice Server
   6 = Your own actual Hippie program-C Alice command line interface

   For #5, you may download the software for such a server from
   http://www.alicebot.org, and while it does provide an IRC client as
   well as the web server, the IRC client lacks many features of
   a typical eggdrop, thus not making it very useful.
   As for setting up the server if you choose #4, I leave that to
   you and the docs that come with the software you download. I
   did NOT write it, so do NOT contact me for help with that.

   For #6, you may download the software for the hippie command line
   engine from http://hippie.sourceforge.net, and while it may or may
   not come with a file called irc_alice.tcl to use with eggdrop,
   it lacks the features that this script provides.
   As for installing the software, read the documentation that comes
   with Hippie.  If you still have problems setting Hippie up,
   do NOT contact me, as I did not write the Hippie software.

 alice_url
 - If you choose #5 for the alice_engine, then enter the url
   to where you set it up, for this variable.

 alice_hippie_path
 - If you choose #6 for the alice_engine, then enter the path on your
   shell to where you have installed the Hippie command line program.

 alice_hippie_inipath
 - If you choose #6 for the alice_engine, then enter the path on your
   shell to where the alice.ini file is located after you have 
   installed Hippie.

 alice_hippie_logpath
 - If you choose #6 for the alice_engine, then enter the path on your
   shell to the location where the Hippie engine stores data on
   users it converses with. Note: You must enter the trailing / at the end.

 =-=-=-=
 8. FAQ:
 =-=-=-=

 1) Q: Where can I download egghttp.tcl?
    A: http://www.TCLScript.com -- in the projects section

 2) Q: Why don't I get any response from my bot when I message it?
    A: 1) You didn't load egghttp.tcl BEFORE loading alice.tcl in your
       eggdrop config file
       2) The alice-engine you are using may be down. Try choosing another
       engine to power your bot's responses. (variable setting: alice_engine)
       3) The box your bot is on may be behind a firewall or router.
       In which case, you might not be able to use alice.tcl with your bot, sorry.
       If your the box your bot is running on is behind a firewall/router, 
       DO NOT ASK ME FOR HELP WITH IT!
     
 3) Q: Why do I keep getting 'I am restarting. Just a minute' as a response?
    A: Problems with the website that powers the script. This is beyond
       my control, so deal with it.

 4) Q: How do I set up my own alice-engine web server?
    A: Go to http://www.alicebot.org and read everything there and
       download the software from there as well.  Beyond that,
       I can not help you.  Look at the contact information in the
       software you download from there if you need assistance.
       Do NOT email -me- asking to help you set it up.

 5) Q: I think I have found a bug that isn't addressed here, what should I do?
    A: First, check the website (www.TCLScript.com) for the latest version,
       and also check the news box on the main page.  If the problem still
       persists and you are positive it isn't addressed in any of the
       formentioned locations, then you may e-mail me.


 =-=-=-=-=-=-=
 9. Greetings:
 =-=-=-=-=-=-=

 - eRUPT, G0mp, mikee, MORA, oiad, prefect, raeky, Wcc


 WARNING: Again, DO NOT EMAIL ME IF YOU HAVE NOT READ THE ENTIRE
          README FILE. ANY QUESTIONS ASKED THAT ARE ANSWERED ABOVE WILL
          BE IGNORED.  I HAVE NO TOLERANCE FOR THE LAZY.  ENJOY.

