  MANUAL.TXT                                                   Page 1 of 9





                   ******************************************
                   *                                        *
                   *               AICHAT.EXE               *
                   *                                        *
                   * Created 23/7/90 by Avatar (Andrew Pam) *
|                  *         Cosysop of Gummi Glen          *
                   *                                        *
|                  *       Ver 2.50 written 20/11/26        *
|                  *   (c) 1990-2026 Serious Cybernetics    *
|                  *  Free software under the GNU GPL v3+   *
                   *                                        *
                   ******************************************





                             Table of Contents
                             ~~~~~~~~~~~~~~~~~

           Table of Contents  . . . . . . . . . . . . . . . . . 1

           Legal Notice . . . . . . . . . . . . . . . . . . . . 2

           Vertical Bars  . . . . . . . . . . . . . . . . . . . 2

           Introduction . . . . . . . . . . . . . . . . . . . . 2

           Installation . . . . . . . . . . . . . . . . . . . . 3

           Status Line  . . . . . . . . . . . . . . . . . . . . 5

           Local Commands . . . . . . . . . . . . . . . . . . . 5

           Control Characters . . . . . . . . . . . . . . . . . 5

           Entering AIchat  . . . . . . . . . . . . . . . . . . 6

           Sysop Hours  . . . . . . . . . . . . . . . . . . . . 6

           Exiting AIchat . . . . . . . . . . . . . . . . . . . 6

           Customising AIchat . . . . . . . . . . . . . . . . . 7

           The AI algorithm . . . . . . . . . . . . . . . . . . 8

           Colours  . . . . . . . . . . . . . . . . . . . . . . 9

           Technical Notes  . . . . . . . . . . . . . . . . . . 9

           Future Enhancements  . . . . . . . . . . . . . . . . 9


  MANUAL.TXT                                                   Page 2 of 9

  Legal Notice
  ~~~~~~~~~~~~

| AIchat is free software: you can redistribute it and/or modify it under
| the terms of the GNU General Public License as published by the Free
| Software Foundation, either version 3 of the License, or (at your
| option) any later version.  The full terms are in the file COPYING.

| As an additional permission under section 7 of the GPL, you may link
| AIchat with TurboPower Object Professional and the Borland Turbo Pascal
| run-time library, and distribute the result.  See README.md and the
| notice at the head of each source file for the exact wording.

| AIchat is distributed in the hope that it will be useful, but WITHOUT
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
| FITNESS FOR A PARTICULAR PURPOSE.  Earlier versions were Shareware;
| registration is no longer needed.




  Vertical Bars
  ~~~~~~~~~~~~~

| Lines in this document with a vertical bar "|" in the left margin have
| been added or modified since the previous version 2.40 release.



  Introduction
  ~~~~~~~~~~~~

  AIchat came about because I was unimpressed by the existing "robot
  sysops", most of which appeared to be based on Eliza.  Joseph Weizenbaum
  wrote Eliza to simulate a Rogerian psychologist, not a sysop, and unless
  you know any sysops who believe in practising Rogerian psychology on
  their users, I don't find it a very convincing simulation.  I decided to
  set about writing a program that would be more interesting to chat to.

  The underlying paradigm of AIchat is that it simulates a sysop, who has
  a "train of thought" (or CURRENT TOPIC) at any given time and will
  endeavour to involve the user in a discussion.  However, if the user
  changes topics or mentions something upon which AIchat can make a witty
  remark, it will happily do so.  After somewhere between 2 and 12 minutes
  or when it can no longer find any topics of interest to discuss with the
  user, it will "get bored" and make an excuse to leave.

  AIchat is programmed to make a few typing mistakes from time to time in
  order to simulate a human typist.  There is a 50:1 chance on any given
  phrase that it will forget to use the shift key and type everything in
  lowercase.  There is also a 50:1 chance on any given character that it
  will accidentally make a typo, either by typing the wrong character
  altogether or by getting two adjacent characters reversed, and a 10:1
  chance that it won't notice and will fail to correct the mistake.

  MANUAL.TXT                                                   Page 3 of 9

  Installation
  ~~~~~~~~~~~~

  AIchat is designed to work with all bulletin board software.  It does
  not require access to any files maintained by the BBS, but it is capable
  of reading RBBS style DOORINFO.DEF or DORINFOn.DEF files (also used by
  Remote Access, SuperBBS and QuickBBS), WWIV style CHAIN.TXT files,
  Wildcat style CALLINFO.BBS files and GAP style DOOR.SYS files.
  Multi-user operation is now fully supported.

  For a summary of the command line parameters, run AICHAT.  This will
  produce the following usage guide:

  Usage:   AICHAT {options...} {username} {options...}

  Options: /<baud>  where <baud> = 0 for local
           /<port>  where <port> = 1 to 4
           /G<ANSI> where <ANSI> = 0 to 3
           /L<rows> where <rows> = length of user's screen (12 to 60)
           /N<line> where <line> = BBS line number (1 to 99)
           /W<name> where <name> = filename of WWIV style chain file

           /A => auto AI chat (no yell)
           /C => sysop initiated chat
           /D => read GAP style DOOR.SYS file
           /R => read RBBS style DORINFOn.DEF file
           /W => read Wildcat style CALLINFO.BBS file

  To test AIchat locally, the only parameter required is your name, since
  AIchat defaults to local operation with ANSI colour enabled.  A baud
  rate other than zero will enable remote operation using the specified
  communications port.  It is a fatal error to specify a non-initialised,
  disconnected or otherwise invalid port since AIchat assumes that a user
  is already online and makes no attempt to check that the port is
  operational.

  MANUAL.TXT                                                   Page 4 of 9

  The /A parameter indicates that AIchat was invoked by the user as an AI
  program and not to chat to the sysop, and will start the program in AI
  mode.  The /C parameter indicates that AIchat was invoked by the sysop
  as a normal chat program and not by the user, and will start the program
| in chat mode.  /C will also skip displaying the credits when AIchat is
| executed.  If either of these parameters is used AIchat will not attempt
| to attract the sysop's attention, so ensure you never allow the /C
| parameter to be invoked by users.

  The /D, /R and /W parameters will automatically determine the user's
  name, baud rate, port, ANSI capability and time remaining, so no other
  parameters are required when they are is used; this is therefore the
  recommended option where possible.  However, the other options will
  override these settings if placed later on the command line.  The /G,
  /G0 and /G2 options will disable ANSI facilities and use only standard
  ASCII text.

  The /D parameter will automatically set the BBS line number as specified
  in the DOOR.SYS file.  The /R parameter will read a DORINFOn.DEF file
  depending on the BBS line number selected by any previous /N parameter.
  If no /N parameter precedes the /R it will default to DORINFO1.DEF for a
  single line BBS, but with /R0 will read a DOORINFO.DEF file and with
  /R<line> will read a DORINFOn.DEF file for a multi-line BBS, thus
  combining the functions of the /R and /N parameters.

  The /N parameter, when used without a line number, will attempt to
  auto-determine one from either the current task number if running under
  a multitasker or the current serial port number if not.  If you use this
  method, you should not use the /N<line> parameter in any tasks since the
  manual and auto-determined task numbers may conflict.

  The use of a FOSSIL (Fido-Opus-Seadog Standard Interface Layer)
  communications driver such as David Nugent's BNU or Ray Gwinn's X00 is
  highly recommended when using AIchat remotely, especially at speeds of
  2400 BPS and higher.  Characters are unlikely to be lost at normal
  typing speeds, but if macros are used at the higher speeds they are very
  likely to lose characters if a FOSSIL is not used.  AIchat will
  automatically detect the presence of a FOSSIL.

  MANUAL.TXT                                                   Page 5 of 9

  Status Line
  ~~~~~~~~~~~

  While AIchat is running a status line will be displayed on the bottom
  line of the screen in reverse video.  From left to right, the status
  line gives the following information:

  * The version number of this release of AIchat
  * LOCAL or the current communication port and baud rate
  * The current user's full name (if known)
  * THINK if AIchat is currently "thinking aloud"
  * LOG if AIchat is currently logging the chat to AICHAT.LOG
  * The time left until AIchat "gets bored", [CHATTING], or [YELLING]



  Local Commands
  ~~~~~~~~~~~~~~

  The following local commands are currently provided by AIchat:

  Alt-A   AI mode
  Alt-C   Chat mode
  Alt-J   Jump to DOS
  Alt-L   Logging toggle
  Alt-T   "Thinking aloud" toggle
  PageUp  Add one minute to AI chat time
  PageDn  Subtract one minute from AI chat time
  Escape  Terminate chat and exit program.

  Using Alt-A and Alt-C to change modes is totally invisible to the user,
  so you can break into AIchat either to converse with a user yourself or
  just long enough to insert your own witty remarks!



  Control Characters
  ~~~~~~~~~~~~~~~~~~

  The following control characters are currently supported by AIchat:

  Crtl-G  Bell            (does not ring at local console
                           if typed by remote user in AI mode)
  Ctrl-H  Backspace       (will not backspace beyond first column)
  Ctrl-I  Tab             (uses standard 8 character tab stops)
  Ctrl-J  Line Feed       (scrolls at bottom of screen)
  Ctrl-K  Reverse LF      (will not move beyond top of screen)
  Ctrl-L  Clear Screen
  Ctrl-M  Carriage Return
  Ctrl-N  Home Cursor     (moves cursor to top left corner)
  Ctrl-O  Cursor to EOL   (moves cursor to end of current line)
  Ctrl-R  Redraw Screen   (only if entered by remote user)
  Ctrl-U  Cursor Forward  (will not move beyond last column)
  Ctrl-X  Cancel          (deletes the entire line)

  All escape sequences from the user except ANSI/VT100 cursor movements
  are currently ignored.  The "arrow" cursor keys are fully supported and
  the Home, Ctrl-Home and End keys perform Ctrl-N, Ctrl-L and Ctrl-O
  respectively.

  MANUAL.TXT                                                   Page 6 of 9

  Entering AIchat
  ~~~~~~~~~~~~~~~

  When AIchat is invoked, unless the /A or /C parameters were used, you
  will be greeted by the copyright notice and the following message:

  Yelling at Sysop...
  Press ALT-C to chat, ESC to abort

  If AIchat is running under Desqview(tm) or a SPK: device driver (such as
  Chris Dunford's SPKR.SYS) is installed, and a valid PAGE.RA file is in
  the current directory or (with DOS 3.0 and later) the same directory as
  AICHAT.EXE, a tune will be played during Sysop hours.  If not, the
  normal PC "bell" will be rung continuously instead.  A PAGE.RA file may
  consist of lines beginning with: "TONE" followed by the desired pitch in
  hertz and duration in hundredths of a second, "WAIT" followed by the
  duration in hundredths of a second, or anything else (which will be
  ignored).  Some versions of Desqview may be a little erratic in the
  timing of the notes, so a SPK: device driver may still be preferred.

  At this point you can press Alt-C to enter chat mode, Escape to cancel
  the chat with the message "Sysop is not currently available", or any
  other key to proceed immediately to AI mode (useful if you don't intend
  to enter chat mode and want the sysop-summoning sounds stopped swiftly!)
  Alternatively, you can do nothing, in which case after a few seconds the
  program will automatically enter AI mode.

  If the current user was using AIchat less than 5 minutes earlier, it
  will cancel the chat as if Escape had been pressed instead of proceeding
  to AI mode.  This prevents users from getting carried away and hogging
  the board (since chatting doesn't use up logon time) and lends some
  badly needed credibility to the program's excuses.



  Sysop Hours
  ~~~~~~~~~~~

  The sysop is currently assumed to be available between the hours of 10am
  and 10pm.  This means that outside these hours, AIchat will not make
  sounds to attract the sysop's attention when the user requests a chat.
  The sysop may of course choose to answer the chat anyway if they are
  present, and AIchat will currently never tell the user "Sysop is not
  currently available" except in the circumstances outlined above.
  These hours are not currently customisable.



  Exiting AIchat
  ~~~~~~~~~~~~~~

  When AIchat is in AI mode, any phrase containing the letters "BYE",
  "CIAO" or "ADIOS" will cause the program to say goodbye and exit.  These
  keywords are not currently customisable.  Some users have expressed
  difficulty with this, trying words like "quit" and "exit", but at this
  stage I find it more logical to support human ways of ending a
  conversation rather than computer ones.  In chat mode, the only way to
  exit is for the sysop to press Escape on the local keyboard.

  MANUAL.TXT                                                   Page 7 of 9

  Customising AIchat
  ~~~~~~~~~~~~~~~~~~

  AIchat uses a file called AICHAT.AI to control AI mode.  If this file is
  not present or readable when AIchat is run, it will exit with the "Sysop
  is not currently available" message unless run with the /C parameter, in
  which case it will function in chat mode only.  This file is an ASCII
  text file and can be edited with any text editor of your choice in order
  to customise the way in which AI mode responds to user input.  If the
  file is too long for AIchat to process, it will use as much of it as
  possible and will log an error message showing the last topic or keyword
  it was able to read.

  AICHAT.AI is structured as a list of TOPICS, each optionally containing
  a list of PHRASES and/or a list of groups of KEYWORDS, each optionally
  containing its own list of PHRASES.  A phrase may currently be up to 255
  characters long, while a topic or keyword is not case sensitive and may
  be any length, although currently only the first 10 characters are
  significant.  Underscores "_" in the topic or keyword will be treated as
  spaces, since actual spaces may be removed by some text editors,
  especially at the end of a line.

  A topic is signified by one or more blank lines followed by the name of
  the topic.  Every group of blank lines in the file therefore signifies
  the start of a new topic.  A group of keywords consists of one or more
  keywords on the same line separated by vertical bars "|".  A phrase
  consists of a line of text starting with a digit and a space.  The digit
  indicates the chance of using this phrase relative to any of the other
  phrases in this group.  A zero will result in the phrase being ignored
  by AIchat and may be used to temporarily disable an unwanted phrase.

  A line may also start with a plus sign "+" to indicate that it is a
  continuation of the phrase on the previous line.  A phrase may be
  continued on any number of successive lines, but any portion after the
  first 255 characters will be ignored.  Topics and keywords may not be
  continued in this fashion, so invalid continuation lines not part of a
  phrase will also be ignored.

  The first topic in the file is the default topic, and has no name.  This
  topic remains in effect until the first blank line in the file, which of
  course signifies the start of the next topic.  All phrases in the
  default topic will be used as random non-sequiturs when AIchat isn't
  discussing any particular topic and has no idea what the user is talking
  about.  All keywords in the default topic will not change the current
  topic under discussion when used.

  Topics and keywords will normally only match complete words or phrases.
  However, if the first or last character of a topic or keyword is an
  asterisk "*" it will also match any word or phrase beginning and/or
  ending in the specified topic or keyword.  For example, the keyword
  "eat" will not match the word "great", but the keyword "*eat" will.
  Neither keyword will match the word "greater", but the keywords "great*"
  and "*eat*" will.  The keyword "***" will match any asterisk!

  MANUAL.TXT                                                   Page 8 of 9

  The AI algorithm
  ~~~~~~~~~~~~~~~~

  When AIchat processes user input, if there is a topic currently under
  discussion, it will first search for a keyword in that topic.  If not,
  or if no keyword is found, it will search all the topics to see if any
  of them were mentioned explicitly.  If so, that topic will be treated as
  the current keyword found.

  If no keyword has been found yet or a topic explicitly mentioned has no
  unused phrases left, all keywords in AICHAT.AI with unused phrases left
  will be searched in order of occurence.  If a keyword with no unused
  phrases left belonging to a topic which does have unused phrases left is
  found, that topic will be noted as an alternative.  If no other keyword
  is found, this alternative topic will become the current topic,
  otherwise the topic of the keyword found will become the current topic.

  If no keyword was found, a phrase in the current topic will be selected.
  If there are no unused phrases left in the current topic, or on a 3:1
  chance, the current topic will be dropped.  If no keyword was found and
  there is no current topic, there is a 10:1 chance of each topic with
  unused phrases left being chosen as the new current topic.

  Finally, if no keyword was found and there was no current topic, one of
  the unused phrases in the default topic will be selected; if there are
  none left unused, the program will make an excuse and exit.  If a
  keyword with unused phrases WAS found, one of those will be selected.

  If the selected phrase ends in a question mark "?", there is a 20:1
  chance that the user's first name will be appended to the question.  For
  example, "What's up?" will become "What's up, Doc?" if Doc is the
  current user.  If the user's first name is "The", their second name will
  be used instead.

  MANUAL.TXT                                                   Page 9 of 9

  Colours
  ~~~~~~~

  The following colours are used by AIchat when ANSI is enabled:

  Light Grey      Default colour
  White           System messages
  Green           "Yelling at Sysop" message
  Cyan            Characters typed by user
  Yellow          Characters typed by sysop or AIchat
  Light Green     AIchat's internal "thoughts"
  Light Red       Fatal error messages

  These colours are not currently customisable.



  Technical Notes
  ~~~~~~~~~~~~~~~

  AIchat provides a wordwrap facility superior to the one in the Remote
  Access internal chat routines.  Although AIchat will read the BIOS row
  and column information and work correctly on any text resolution with at
  least 80 columns (I often use 132 columns by 60 rows) the wordwrap will
  always ensure that text is wrapped after column 79 to match user
  displays.  Words longer than 20 characters will not be wrapped.

  The Alt-J Jump to DOS facility will swap most of AIchat to EMS (if
  available) or disk, leaving only about 8K of RAM in use.

  All I/O is done strictly through DOS and BIOS calls without any direct
  hardware access whatsoever, so it should work with any PC system
  compatible at the BIOS level, which is just about everything these days.
  AIchat will also relinquish time slices to multitaskers when possible.



  Future Enhancements
  ~~~~~~~~~~~~~~~~~~~

| If you have any further suggestions or comments, feel free to
| E-mail me at Internet address avatar@sericyb.com.au.

  Share and enjoy!
