###README file for Bass's Seen script, version 1.4.2  (2/2000).  
Welcome back gentle readers.  -- Bass

***Contact:  Bass is *!bass@*.psu.edu on Undernet (#eggdrop for eggdrop help), with email bass@shell.lazerlink.net.

***About:  
  This script maintains a database of *all* nicks seen online and in the partyline, not just those people who are in the userlist.  Simple flood protection is built-in.  Wildcard searches are supported.  MSG and DCC help routines are included.  Adjustsments are available on the database size, 'quiet' chans, log-only chans, flood protection, and SmartSearch.
  This script should *not* be used on "ultra-high load" channels.  This category of channel is ones where more than 25 join/part/split/kick/quits per minute are experienced on average over extended periods of time.  Using the script in such cases will cause the bot to use excessive system CPU, 30% or more.  This is due to the inherent nature of global binds.  Note that is it *not* the Tcl code causing the CPU load, but rather the global binds themselves.  The only solution is a localized binding scheme to exclude high-load channels, which would make this script more complicated than I want it to be at the current time.

***Installation:  Since you're reading this, you've already figured out how to unzip/tar the distribution file, so I'll skip that part.  
1) copy bseen1.4.2.tcl and bseen_updater1.4.2.tcl to your bot's scripts/ directory
2) add the following source line at the *end* of your bot.conf file:  
     source scripts/bseen1.4.2.tcl
3) make sure you are *not* loading the seen module in your bot.conf
4) Edit the header of the bseen1.4.2.tcl file as desired; the script it *highly* flexible.  It is distributed with 'typical' defaults, so you may not need to actually change anything.  (The bottom of this file contains a brief description of each variable and its purpose.)

The 'updater' script will only be loaded on demand by bseen as needed (typically only the first time you run it).  It updates the database record format from bseen 1.3.x to 1.4.x format.  

***Updates (if any more are ever made) should be available at:
  -- http://bseen.tclslave.net/     <-- includes my "ScriptFinder" search engine
  -- ftp://ftp.eggheads.org/pub/eggdrop/tcl.bass/

New/different in 1.4.2:
  -- added support of the modified PART bind in eggdrop1.5.2; part messages are now recorded
  -- the infamous eggdrop1.4.2 truncation bug has been fixed
  -- a Tcl bug was repaired that could cause very specific queries to freeze the bot

New/different in 1.4.1:  
  -- a possible problem with !lastspoke accuracy was addressed ([getchanidle] isn't always accurate)
  -- The nick-change tracking was partially removed from the last ver.  It could be annoying.  (There was also a bug.)  The useful part was retained.
  -- The .chanstats DCC command will now read your console setting if you don't supply a chan as an arg.
  -- "a" update:  set it so "bind away" is disabled in 1.1.5 bots (it doesn't exist)
  -- "b" update:  fixed a typo in bs_updater file that caused loops (forgot to update the version stamp)
  -- "c" update:  I forget.  :)
  -- "d" update:  Compensated for a bug in Tcl8+ where egg1.3.x users would get "invalid cmd: gethosts" errors.
			!lastspoke was also fixed; it gave -1sec responses from time to time.
			The var bs(path) was added.  You can use this to specify a path to save the database in.

New in 1.4.x:
  -- *faster* all around
  -- bs_add was made a *lot* faster, speeding up the bot's "idle" operation
  -- old records are now expired more efficiently
     Note: the new method will allow the database to 'overfill'.  Excess records are purged periodically.  eg:  '!seenstats' may report the database at 3011/3000 capacity.  Don't worry... that's allowed in the new design.
  -- lastspoke now responds more intelligently, taking into account the bot's join time


***Fixes since the initial public release:
  -- See http://mars.age.psu.edu/bseen_fixes.html for a list of fixes.

***Command/Query input:
Input is accepted from:
       pub:  !seen <query> [#chan]    (command char is variable)
       msg:  seen <query> [#chan]
   and dcc:  .seen <query> [#chan]

Queries can be in the following formats (public examples given):
    'regular' !seen lamer; !seen lamest 			| SmartSearch-enabled query
    'limited' !seennick lamer					| SmartSearch-bypassed query
    'masked'  !seen *l?mer*; !seen *.lame.com; !seen *.edu #mychan

If no match is found, the botnet is queried to see if any other bots have seen the user/mask.

***Extras
There are some 'extra' commands included with this script.

#!seenstats -- (DCC .seenstats also included) this returns a simple report of the current size of the database, the oldest entry in the database, and exactly how old that entry is.  It gives an idea of how the script is performing.  If the database is full and the oldest entry is only 2-3 days old, you may want to increase bs_limit.

#!chanstats [chan] -- (DCC .chanstats also included) this returns a report of the current size of a channel within the database.  It gives an idea of how much activity the channel gets in comparison to other logged channels (assuming it's a multichan bot).

#!lastspoke <nick|nickmask> -- This is a very simple command that returns the idle time of <nick> in the channel the command was entered.  Wildcard matching is supported; the first match is reported (handy for truncating long/difficult nicks).

#!seennick <nick> -- This is a one-time disable of the SmartSearch feature, forcing the recall of that nick's record.

#.unseen <chan> -- (DCC command only, +n) --  This *erradicates* all entries from the database that match 'chan'.  Warning:  there is no 'undo'.


***Parameters (set at the top of bseen1.4.2.tcl)
#bs(limit) -- This is the database record limit.  In testing, it was found that a size of 3-4000 for a bot in multiple active channels holds approximately 5 days of data.  For a bot in less active or fewer channels, a smaller number may still return good results.

#bs(cmdchar) -- This is the command char that the script uses to find seen queries.  The default is "!".  Setting it to "" is a valid option.

#bs(nicksize) -- This is the maximum nickname length (9 on Undernet).  It is used to ignore obviously false queries.

#bs(no_pub) -- This is a list of channels you *don't* want the bot to post public replies to (public queries ignored).  This is useful for channels where you simply don't want the bot replying to !seen because others would be offended, or because another bot is in charge of !seen queries.  MSG queries are still accepted.  Enter channels lower case, separated by spaces.  eg: set bs_no_pub "#lamer #lamest"  Or set to "" for a null list.

#bs(quiet_chan)  -- This is a list of channels you want to reply to request via notice to the person who made the query. (The bot doesn't post publicly.) (See comments on bs_no_pub for entry details.)

#bs(no_log) -- This is a list of channels you *don't* want the bot to log data on.  (See comments on bs_no_pub for entry details.)

#bs(log_only) -- This is a list of channels you *only* want the bot to log data on.  This is the opposite of bs_no_log.  Set it to "" if you want to log new channels the bot joins.  Enter chans in lower case.

#bs(flood) - This is used for flood protection, in the form x:y.  Any queries at or beyond 'x queries' in 'y seconds' is considered a flood and ignored (no reply is sent).  The nick optionally can be ignored by the bot.

#bs(ignore) - This is used as a switch for ignoring flooders (1=on)

#bs(ignore_time) - This is used to define the amount of time a flooder is ignored (minutes).  The variable is meaningless if bs_ignore is 0 (off).

#bs(smartsearch) is a master enable/disable for SmartSearch.  SmartSearch ensures that the most accurate and current results are returned for nick queries. (1=on)

#bs(path) is used to designate what path the database should be stored in.  Setting it to "" will save the data to the bot's main dir.  If not "", the string must end w/ a /.  eg: /blah/asdf/qwer/

All variables are set to 'reasonable' values as downloaded.  Minimal changes should be necessary (if any).
