                           xDCC Script
                           for EggDrop

                           by _Defiant_ 
                     (insolens@ix.netcom.com)

       This is my first public script. Hope people like it. Most of 
the things that you need to set are documented. You may be asking why 
I wrote this script. It was because I wanted something that had the 
look of the XDCC offers on the #excced channel on EFnet, yet for 
EggDrop. Since I could not find it, I wrote one that is at leaste 
similar. Only idea I stole for this script is the xdcc_echo, which is 
an idea I got from the only other XDCC Script I could find, one by 
Keyoke. The only code I borrowed for this script was a trickle down
process that I go from StephenC. Everything else here is original. I 
know that no matter what I say, some of you are going to *modify* 
this script, I say go at it, as long as you append to the Version 
History what you did, and your e-mail address. Don't take this script
and call it your own, because I will find you ;).

NOTE: YOU MIGHT HAVE TO RECOMPILE YOUR BOT! Some people experienced
overloading of their send queue to the server. This can be fixed if
you edit eggdrop.h. Look for the line that definds MAXQMSG, the default
value is 200. When running xDCC, I like to stick it at somewhere around
10000. ALSO... this is IMPORTANT! If your bot gets large numbers of 
requests, then it might crash! There is no way to add a queuing/slot
system for transfers in Egg 1.0. I think I will be able to do it in 1.1.
This is because in 1.0, there is NO WAY to monitor file transfers as they
are happening. If you send out too many files, Egg crashes with an error
of something like "Too many open file handles."


|---------------- Read this! It has changed since .16! --------------|

To Install:

1) Stick the help files in your help directory.

2) Stick the following script files in the script directory.

	xdcc.tcl

   These files *must* go in the directory in which EggDrop was started.
	xdcc.conf

3) Add this line to the end of your bot's config file if it has not
   alreay been added:

	source scripts/xdcc.tcl

4) Edit the xdcc.conf file. This is the initilization file for xDCC.
   Here you can specify almost any preference that you could possibly
   think of. There is a detailed description of what each setting does.

5) Rehash your bot, or if it is not started then start it.

6) You can do '.help xdcc' in DCC if you have installed all the help
   files in the correct directory. This will give you a list of all
   available commands, and you can get more help on each command.


----------------------------------------------------------------------

Version History:
 .01pre1
          First instance of script writen. Lots of slopy code and
          unused variables. No public release.
 .01pre2
          Cleaned up all of the code. Structure and names of some
          procedures changed. Also added a few comments. No public 
          release.
 .01pre3  Added xdcc commands to the file system. Changed the way
          some variables were initilized. Script now aborts adding
          a packet if all slots are filled. Added send rate
          calculating. Added "save" command to DCC and FIL command
          parsers. No Public Release
 .01pre4  Fixed all the bugs I have found so far. You can now
          specify packets by both description and index in packet
          manipulation commands. No Public Release.
 .01pre5  Added +count and -count. Changed the names of many
          functions. Added offer command. Added reload command. Added
          rehash command. Added help files. Fixed description problem
          (will compare in lower, but store as regular) No Public
          Release.
 .01pre6  Added way to offer only if bot is voiced. Added option to
          voice people if their nick matches a mask. No Public Release.
 .01pre7  Added on and off commands. Actually implimented the join
          proc, not just the binds <g>. No Public Release.
 .01pre8  Fixed packet incr and decr procs. Also fixed auto incr on
          d/l request. Changed auto-voice so it can now include
          multiple masks, and bind is a common one (not mask specific).
          Quotes no longer appear around the packet description (thank
          god). Also added something where people can message the
          xDCC owners (both peons and bot people with +m). Now 
          running  on #IRCOffer, but still No Public Release.
 .1       Time to increase the version number. Added ability to add
          a note on the end of the offer. Also added a status command.
          I took out the Max Send reporting, because it was not
          working properly. All the code is there, just needs to be
          fixed. Public Release! Woo hoo.
 .11      First release had a few major bugs. One incomplete script
          block, and a rehash of the xDCC system wiped out the root
          path. So I fixed those, and I am also adding an all option
          to the status command. Public Release (as soon as I know it
          works correctly).
 .12      xDCC on/off status is now saved in the info file. Trying to
          fix the file size, and transfer time indicators. Script also
          says when it was loaded, and how long ago. Fixed problem with
          listing just one packet, not all. No Public Release.
 .13      Removed a debug feature. Changed some things with the way 
          file size and transfer rate is calculated. Should work now.
          Also added the option to bind to CTCP's and send works the 
          same as get. Also added ctcp type to xdcc_echo. No Public 
          Release.
 .15      Fixed timer bug (was being killed), also fixed the thing
          where unbinding might cause exceptions and halt the loading
          of the script (uses catch now). Fixed bug where *false*, or
          completely empty packets were being loaded from the packet
          data file. No Public Release.
 .16      Forgot what I fixed here, just know I fixed something. Also,
          Public Release!
 .17      You can now tell the bot to offer via msg only to people who
          are on one of the offer channels. You can also tell the bot
          only to auto voice for people who are on one of the offer
          channels, not all of them. Fixed problem with + and - count.
          Thanx to ZAR for finding all those bugs and giving
          suggestions. Also thanks to kp1 of UCA, one of the original
          xDCC guinie pigs ;). Galahad, I owe you thanks in here
          somewhere too. No Public Release.
  .18     Fixed a bug in xdcc_findpacket. Thanx to NiKe^GuY for finding
          it. You cannow send descriptions and not only indexes. No
          Pulblic Release.
  .19     Added cycle options. You can now specify channels to cycle
          on if you do no thave voice. The owner field (the []'s) will
          not be displayed if the owner is null. I have made an attempt
          to get the packet info and comment to scroll on the same
          line. Not sure it will work, but it is worth a try. Max
          packet limit has been removed and is no longer used. I did
          a little format changing on the way it lists packets via
          dcc (now it makes sure that there three places when saying
          the index). I also tried to make the code a little more
          efficient (eliminated some unnecessary loops and variables).
          No Public Release.
  .20     I added the new way of defining channels. Cleared up a lot of
          stuff with cycle and auto voice. All configs are in a
          seperate file, so you should not have to re-edit xdcc.tcl
          everytime you upgrade. I removed the thing where the script
          was *modulized*. Asskick said it was stupid, and I have to
          say that I agree. Public Release (finally).
