eggdrop1.6.19/0000775000076400007640000000000011002271750012261 5ustar guppyguppyeggdrop1.6.19/NEWS0000664000076400007640000001754710755654146013020 0ustar guppyguppy$Id: NEWS,v 1.36 2008-02-16 21:40:54 guppy Exp $ News Last revised: April 16, 2003 _________________________________________________________________ News What's new? First, read the following documents: INSTALL README doc/BOTNET doc/UPDATES1.6 doc/tcl-commands.doc All of these documents combined will fill you in on the latest changes to Eggdrop in version 1.6.x. All files, with the exception of UPDATES1.6, are also available in html format in doc/html/. A lot of things have changed in this version, so at a minimum, read the UPDATES1.6 text file. UPDATES shows what's been added and fixed along the way. If you are upgrading from a pre-1.6 version of Eggdrop: 1. Before you start the bot for the first time, BACKUP your userfile. 2. DON'T USE YOUR OLD CONFIG FILE. MAKE A NEW ONE! _________________________________________________________________ Changes made to Eggdrop 1.6.x from Eggdrop1.4.x: !CHANNELS Support for IRCnet !channels was added to Eggdrop. This might still be a bit buggy. We appreciate bug reports! +/-NODESYNCH This new channel setting replaces the old 'allow-desync' config file setting. It is useful if you use some type of ChanServ or if you don't care about your channel being desynched. ASYNCHRONOUS DNS MODULE Eggdrop 1.6 is shipped with a new module, the dns module. It replaces those old dns-lookups performed by Eggdrop which could halt the whole bot during a timeout. We also added a new Tcl command, 'dnslookup', so scripts can now use DNS functions asynchronously, too. See doc/settings/mod.dns for more information. COMPRESS MODULE A new module called compress was introduced to Eggdrop. It provides gzip support to Eggdrop (via Tcl commands) and enables compressed userfile transfer. See doc/settings/mod.compress for more information. SHARE MODULE The share module has a new setting now (override-bots) which allows hub bots to override the leaf bots' bot settings (botaddress, telnet port, and password). Please note that this won't work with a version 1.4 or below bot. See doc/settings/mod.share for more information. TRANSFER / FILESYS MODULES The filesys and transfer modules have changed completely. Both can now handle unlimited filename lengths and description sizes. Incomplete downloads from the bot can also now be resumed. The db format of the filesys module was changed to remove the limits imposed by the old format. There's nothing special for you to do, as the old db is automatically converted to the new format when you first access it. You won't be able to downgrade to older versions after this, so you may want to make a backup first. See doc/settings/mod.transfer and doc/settings/mod.filesys for more information. UPTIME MODULE This module reports uptime statistics to http://uptime.eggheads.org. Go look and see what your uptime is! It takes about 9 hours to show up, so if your bot isn't listed, try again later. See doc/settings/mod.uptime for more information. DCC COMMANDS * ".nick" was renamed to ".handle". ".nick" will still be kept up to version 1.8. * ".chnick" was renamed to ".chhandle". ".chnick" will still be kept up to version 1.8. * ".binds" now supports wildcards. * ".halfop" and ".dehalfop" have been added. * The 'optimise' file system command was renamed to 'optimize'. The old command will still be kept up to version 1.8. * Eggdrop now counts all of the traffic which it generates and receives through IRC, the botnet, scripts, and dcc. You can access these statistics via the dcc command ".traffic". Please note that the counter gets reset every time a restart is done. * ".modules" now works locally as well as remotely. CHANNEL MODES Support for IRCnet negative limits and DALnet's +R, +M, and +c channel modes has been added. Eggdrop now also supports halfops (+h). DOCUMENTATION A lot has happened to the documentation; nearly every file was changed, so take a look at them. Also, we have discovered html, and full html documentation is available now in doc/html. Additionally, all possible settings for Eggdrop are documented in doc/settings. CONFIG FILES * To support longer nicknames, as some IRC servers do, a new 'nick-len' setting was added. * Eggdrop uses strftime now to support different logfile suffixes. The new config file setting is 'logfile-suffix'. * A new 'pidfile' setting was added to allow you to specify the name of Eggdrop's pid file. * The 'strict-servernames' setting was removed. PENALTY CALCULATION Eggdrop calculates penalty points on IRCnet now, so it won't flood itself off anymore. This feature also works on EFnet and Undernet, and should work on other networks as well. TCL COMMANDS * The 'chnick' command was renamed to 'chhandle'. The use of 'chnick' is deprecated. 'chnick' is still accessible if you load compat.tcl. * All three commands to add data to the queues (puthelp, putserv and putquick) now support the '-next' parameter which pushes data to the front of the queue. * A command to calculate md5 checksums, 'md5', was added. * To support the new asynch dns module, the command 'dnslookup' was added. * Four new commands regarding exempts/invites were added: stickexempt, unstickexempt, stickinvite, and unstickinvite. * A new 'wasop' command was added to check if a user had op before a mode change. * 'washalfop', 'ishalfop', and 'botishalfop' have been added. * Three new Tcl commands were added as part of the compress module: compressfile, uncompressfile, and iscompressed. * A new command to check whether the bot's nick is juped was added (isjuped). * The fileresend command was added to support mIRC's dcc resume feature. * A new bind type called 'NEED' was added which triggers when the bot needs op, unban, limit, key, or invite. * LOST and TOUT bind types were added. * Two new commands, 'channame2dname' and 'chandname2name', were added to allow scripts to support !channels. * A new evnt type, loaded, was added. * The 'setudef', 'renudef', and 'deludef' commands were added to allow for user-defined channel settings. * A 'traffic' command was added which returns a list of sublists containing information about the bot's traffic usage in bytes. * The CTCP bind type now supports wildcards. * A 'handlen' variable was added (set to the value of the HANDLEN define in eggdrop.h. 'nick-len' was also renamed to 'nicklen' (the old variable will remain until version 1.8. * The 'channel get' command was added to allow channel settings to be easily retrieved. * The 'server' variable now contains the server's realname instead of its serverlist entry regardless of the 'strict-servernames' setting. * The 'serveraddress' variable was added, which contains the server's serverlist address and port. * The 'onchan', 'botonchan', 'botisvoice', 'botisop', 'onchansplit', 'isop', 'isvoice', and 'handonchan' commands no longer require an argument. * Added a "stripcodes" command to remove control codes/etc from strings. For more information about changed or added Tcl commands, see doc/tcl-commands.doc. TRAFFIC ACCOUNTING Eggdrop now counts all of the traffic which it generates and receives through IRC, the botnet, scripts, and dcc. You can access these statistics via the dcc command '.traffic'. Please note that the counter gets reset every time a restart is done. ________________________________________________________________________ Copyright (C) 1997 Robey Pointer Copyright (C) 1999 - 2008 Eggheads Development Team eggdrop1.6.19/README0000664000076400007640000006076710755654146013203 0ustar guppyguppy$Id: README,v 1.46 2008-02-16 21:40:54 guppy Exp $ Readme Last revised: June 5, 2002 _________________________________________________________________ Readme Please at least SKIM this document before asking questions. In fact, READ IT if you've never successfully set up an Eggdrop bot before. PLEASE! READ IT! Contents 0. Important notice 1. What is Eggdrop? 2. How do I get Eggdrop? 2a. How to get the latest version of Eggdrop via CVS 3. Quick startup 4. Upgrading 4a. Upgrading from a pre-1.3 version to 1.6 4b. Upgrading from an older 1.3/1.4/1.5/1.6 version to a newer one 5. Command line 6. Frequently Asked Questions 6a. What do I do if I get the error "User file not found"? 6b. My Eggdrop won't run; It just says "Can't find your hostname!" 6c. What the Heck is Tcl? 6d. My bot dies and the last entry in the logfile is "Received terminate signal". What does that mean and can I prevent it? 6e. Someone else set up a bot I don't like. Are there any backdoors I can use to take their bot down? 6f. What are modules? 6g. Can I compile Eggdrop without dynamic modules? 6g1. Do I still need to "loadmodule" modules? 6h. Where can I get a pre-compiled Eggdrop for my computer? 6i. I get "Makefile:3 : invalid operator" or some such thing when I try to "make". 6j. When I "tclsh scripts/weed c" It barfs chunks at me and dies. 6k. I get "ld-elf.so.1: Shared object "libtcl80.so.1" not found" or "eggdrop: error in loading shared libraries / libtcl8.1.so: cannot open shared object file: No such file or directory" when I try to start my bot. 6l. I get a whole pile of "unresolved symbol 'Tcl_AppendResult'" (or some other symbol) when I try to load a module. 7. Setting up a crontab 7a. Setting up a crontab using autobotchk 8. Boring legal stuff 9. Mailing list 10. Documentation 11. Obtaining help _________________________________________________________________ (0) NOTICE Please read this file carefully before trying to set up Eggdrop. Also, make SURE that you select your +n (owner) users wisely! They have 100% access to your bot and account! ONLY GIVE THIS POWER TO SOMEONE YOU TRUST COMPLETELY!! (1) WHAT IS EGGDROP? Eggdrop is the World's most popular Internet Relay Chat (IRC) bot; it is freely distributable under the GNU General Public License (GPL). Eggdrop is a feature rich program designed to be easily used and expanded upon by both novice and advanced IRC users on a variety of hardware and software platforms. An IRC bot is a program that sits on an IRC channel and preforms automated tasks while looking just like a normal user on the channel. Some of these functions include protecting the channel from abuse, allowing privileged users to gain op or voice status, logging channel events, providing information, hosting games, etc. One of the features that makes Eggdrop stand out from other bots is module and Tcl scripting support. With scripts and modules, you can make the bot preform almost any task you want. They can do anything from preventing floods to greeting users and banning advertisers from channels. You can also link multiple Eggdrop bots together to form a botnet. This can allow bots to op each other securely, control floods efficiently, and even link channels across multiple IRC networks. It also allows the Eggdrops share user lists, ban lists, exempt/invite lists, and ignore lists with other bots if userfile sharing is enabled. This allows users to have the same access on every bot on your botnet. It also allows the bots to distribute tasks such as opping and banning users. See doc/BOTNET for information on setting up a botnet. Eggdrop is always being improved and adjusted because there are bugs to be fixed and features to be added (if the users demand them, and they make actually sense). In fact, it existed for several years as v0.7 - v0.9 before finally going 1.0. This version of Eggdrop is part of the 1.6 tree. A valiant effort has been made to chase down and destroy bugs. This README file contains information about how to get Eggdrop, command line options for Eggdrop, what you may need to do when upgrading from older versions, a list of frequently asked questions, how to set up a crontab, some boring legal stuff, info about the mailing list (a great place to ask questions, and a good place to report bugs, too), some basics about CVS usage, and some channels where you might get help with Eggdrop. (2) HOW TO GET EGGDROP Before you can compile Eggdrop, you need to have Tcl installed on your system. Most systems should have Tcl on them by now -- you can check by trying the command "tclsh". If it works, you will be given a "%" prompt, and you can type "exit" to exit the program. This means Tcl is installed on your system. If tclsh doesn't load, then Tcl probably isn't on your system, and you will need to install it. The best ftp site for Tcl is ftp://tcl.activestate.com/pub/tcl/. Tcl comes with the most distributions of Linux. HOWEVER, the one that comes on Slackware 3.0 is goofed up and you'll have to re-install it for yourself to get it working. Currently, the 1.6 tree of Eggdrop is developed at eggheads.org. You can get the latest version of Eggdrop from the following url: http://www.geteggdrop.com You might try www.eggheads.org for help and information. (2a) CVS USAGE You can obtain the VERY LATEST version of Eggdrop, that is still under development, by using CVS. CVS means 'Concurrent Versions System' and is a tool for developers to always keep source code up to date. Try 'man cvs' on your shell for more information about CVS. This is intended only for users that know a good bit about Eggdrop. Be aware that the versions of Eggdrop that you get via CVS are still being developed, and may be buggy. The Eggheads Development Team will in NO WAY take any responsibility for whatever might happen to you or your shell if you use a CVS version of Eggdrop. To obtain Eggdrop over CVS, do as follows: 1. Log into your shell. 2. Type: 'export CVSROOT=:pserver:anonymous@cvs.eggheads.org:/usr/local/cvsroot'. 3. Type 'cvs login'. 4. Press when prompted for a password. 5. In your home dir, type 'cvs checkout eggdrop1.6' 6. In ~/eggdrop1.6, you should have a copy of the latest CVS version of Eggdrop. Notes: o You can 'cvs logout', but you don't need to. o You don't need to go through this whole process every time. If you want to get a CVS version of Eggdrop at a later time, you can just 'cd ~/eggdrop1.6' and type 'cvs update -CdAP'. o If you experience errors when using 'export', you might be using tclsh as a shell. If so, try using the command 'setenv' instead of 'export': setenv CVSROOT :pserver:anonymous@cvs.eggheads.org:/usr/local/cvsroot (3) QUICK STARTUP Please see the 'INSTALL' file AFTER you finish reading this file. (4) UPGRADING (4a) UPGRADING FROM A PRE-1.3 VERSION TO 1.6 #### BACK UP YOUR USERFILE #### We can't stress this enough. If you are upgrading and you have even a slight possibility of downgrading again later, you will HAVE to back up your userfile, or you will lose it. v1.3 of Eggdrop radically changed a lot of things. There are many major changes between v0.9, v1.0, v1.1 and v1.6, so PAY ATTENTION to this part if you have a v0.9, 1.0 or 1.1 bot currently. If you're just starting out, you can skip this section. If you run share bots, you will need to upgrade them all at the same time because of the new userfile format. Older bots will be able to link in, but will not get or send a userfile. MAKE A NEW CONFIG FILE from the example; there are some radical changes. If you are upgrading from 0.9/1.0 to 1.6, just redo the whole thing. Absolutely everything has changed, including the userfile and config file formats. If you are upgrading from 1.1/1.2 to 1.6, you will likely want to redo the config file, as much as changed. BACK UP! You will need to run 'tclsh scripts/weed/ c' to convert your userfile from v3 (1.1/1.2) to v4 (1.3/1.4/1.5/1.6). (4b) UPGRADING FROM AN OLDER 1.3/1.4/1.5/1.6 VERSION TO A NEWER 1.6 VERSION If you followed the 'INSTALL' file and did a 'make install' (or 'make install DEST="path"') after 'make', this will be pretty easy. Just upload the new eggdrop1.6.x.tar.gz file to your home dir on your shell, gunzip and untar it, and type 'cd ~/eggdrop1.6.x'. Next, type './configure', 'make config' or 'make iconfig', then 'make'. Then, kill the bot ('.die' on the party line), and 'make install' to the same directory your bot is currently in. After that, you can just restart your bot. You may wish to delete the old Eggdrop executable and modules as well, especially if you have limited disk space. You should read through the new eggdrop.conf file for all of the new options in Eggdrop 1.6.x if you are upgrading from 1.3.x or 1.4.x. You can copy and paste any of these settings into you current conf file if you do not want to use the default settings. (5) COMMAND LINE Eggdrop has some command-line options -- not many, because most things should be defined through the config file. However, sometimes you may want to start up the bot in a different mode, and the command-line options let you do that. Basically, the command line for Eggdrop is: % eggdrop [options] [config-file] The options available are: -n: Don't background. Normally, Eggdrop will move itself into the background when you start it up, meaning you'll get another shell prompt, and you can do other things while the bot is running. With -n, you won't return to the shell prompt until the bot exits (which won't normally happen until it's killed). By default, -n will send all log entries to the console. -nt: Don't background, use terminal. This is just like -n, except that instead of seeing log entries, your console will simulate a DCC chat with the bot. -nc: Don't background, show channel info. This is just like -n, except that instead of seeing log entries, every 10 seconds your screen will clear and you will see the current channel status, sort of like "top". -m: Create userfile. If you don't have a userfile, this will make Eggdrop create one and give owner status to the first person that introduces himself or herself to it. You'll need to do this when you first set up your bot. -h: Show help. -v: Show version info, then quit. Most people never use any of the options except -m, and you usually only need to use that once. (6) FREQUENTLY ASKED QUESTIONS (or "Why doesn't this thing work?") 6a. WHAT DO I DO IF I GET THE ERROR "USER FILE NOT FOUND"? 1. Run Eggdrop with the "-m" option (i.e. "eggdrop -m eggdrop.conf"). 2. Go to IRC and send "hello" to your bot (i.e. "/msg mybot hello"). 3. You will become an owner on your bot. You can leave the bot running (nobody else will become an owner if they say "hello"), but in the future, don't use the "-m" option when running the bot. 6b. MY EGGDROP WON'T RUN; IT JUST SAYS "CAN'T FIND YOUR HOSTNAME!" Your machine is set up strangely, and Eggdrop can't figure out its network hostname. You can get around this by setting the my-ip setting in the config file correctly. 6c. WHAT THE HECK IS Tcl? Tcl is a scripting language written by John Ousterhout. It's much better than most "built-in" script languages (like the one in ircII) and is meant to be linked with anything needing a scripting language, so I linked it with Eggdrop. The file "tcl-commands.doc" in the doc directory contains a list of additional Tcl commands provided by Eggdrop. There are also several example scripts in the scripts/ directory, and one in the doc directory called first_script.txt. Hundreds of scripts floating around on the ftp/web sites if you like working by example (which is typically the best way). 6d. MY BOT DIES, AND THE LAST ENTRY IN THE LOGFILE IS "RECEIVED TERMINATE SIGNAL". WHAT DOES THAT MEAN, AND CAN I PREVENT IT? There's nothing you can do to prevent it. It means the system administrator is killing the Eggdrop process. Most of the time, it's an automatic thing that happens when the system is being rebooted, so it's harmless. If you have a crontab running, the bot will get restarted when the system is back online. Occasionally, the system administrator will kill the bot manually. For example, if he/she doesn't want bots running on the system. 6e. SOMEONE ELSE SET UP A BOT I DON'T LIKE. ARE THERE ANY BACKDOORS I CAN USE TO TAKE THEIR BOT DOWN? No, there have never been any backdoors and there never will be, so please stop asking. Every once in a while, someone finds a way to exploit a bug in Eggdrop, but we fix these bugs as soon as we find out about them. If you want to bring down someone else's bot, you will not have my/our help. 6f. WHAT ARE MODULES? Modules are a way of adding extra features to the bot, much like Tcl scripts, without requiring the bot to be recompiled. See doc/MODULES for more information. 6g. CAN I COMPILE EGGDROP WITHOUT DYNAMIC MODULES? Yes, you can. If the configure script detects that your system CAN'T run modules, it will setup 'make' to link the modules in statically for you. You can choose this option yourself by using 'make static'. You can also try to compile dynamic modules on a static-only system by using 'make eggdrop'. 6g1. DO I STILL NEED TO 'loadmodule' MODULES? YES, when you compile statically, all the modules are linked into the main executable. HOWEVER, they are not enabled until you use loadmodule to enable them, hence you get nearly the same functionality with static modules as with dynamic modules. 6h. WHERE CAN I GET A PRE-COMPILED EGGDROP FOR MY COMPUTER? It is HIGHLY recommended AGAINST using pre-compiled Eggdrops from un-trusted sources. Eggdrop has been a regular target for hacking and crashing. Distribution of pre-compiled (binary) versions of Eggdrop are the easiest way for hackers to provide you with the easiest (and most dangerous) way of gaining access to, not only your bot, but to your computer account directly. Don't advertise your pre-compiled Eggdrop binary sites on the Eggdrop list either. =P 6i. I GET 'Makefile:3 :invalid operator' OR SOME-SUCH-THING WHEN I TRY TO 'make'. Try 'gmake'. 6j. WHEN I 'tclsh scripts/weed c' IT BARFS CHUNKS AT ME AND DIES. :( Upgrade your Tcl. You are probably using Tcl 7.5 or earlier. Some of the commands in weed require Tcl7.6 to run, so either upgrade it or remove the offending lines from you userfile manually (those starting with '.' generally) and accept the loss of that data. 6k. I GET "ld-elf.so.1: Shared object "libtcl80.so.1" not found" or "eggdrop: error in loading shared libraries libtcl8.1.so: \ cannot open shared object file: No such file or directory" WHEN I TRY TO START MY BOT. './configure' is looking in the wrong place for Tcl; it looks like it compiled with one version of Tcl and tries to load another. Maybe your sysadmin upgraded Tcl and didn't tell you. In that case, you should just need to recompile your bot. Maybe, when upgrading, he didn't clean the old version of Tcl and './configure' is looking for the files in the wrong places, or trying to use different versions of tcl.h and libtcl*. Smack your admin and have him install Tcl properly. ;) You can also try: ./configure --with-tcllib= --with-tclinc= This will tell configure where to look for the Tcl files. Try looking for libtcl by: ls /usr/lib/libtcl* ls /usr/local/lib/libtcl* Try looking for tcl.h by: ls /usr/include/tcl.h ls /usr/local/include/tcl.h If everything else fails, try to install Tcl to your home dir ;) (Suggested by dw@Undernet, dw@lixom.nu) 6l. I GET A WHOLE PILE OF "Unresolved symbol 'Tcl_AppendResult'" (OR SOME OTHER SYMBOL) WHEN I TRY TO LOAD A MODULES. POSSIBILITY A: See section 6k. POSSIBILITY B: Some of the standard libraries have been compiled for static linking only on your machine, you have 3 options: 1. If it's your own machine, recompile Tcl using dynamic linking by using './configure --enable-shared' when you configure Tcl (not the bot) and then remake, and reinstall. 2. If it's not your machine, you may have to resort to 'make static' and 'make install DEST="path"' to make and install your bot. 3. If you are of a more aggressive sense of mind, go beat the stuffing out of your admin for having lame static libraries. :) (7) SETTING UP A CRONTAB Eggdrop has become more stable with time, thanks mostly to people reporting bug details and helping find places where it crashes. However, there are still a -few- places where things aren't perfect. Few, if any, things in life are. Also, most systems go down from time to time. These things cause your bot to disappear from IRC, and you have to restart it. Eggdrop comes with a shell script called 'botchk' that will help keep the bot online. It will make the machine check every ten minutes to make sure your bot is still running. To use it, you have to add a line to your crontab. First, edit 'botchk' and change the directory and command line parameters so that it will be able to start up your bot. Then, add this line to your crontab: 0,10,20,30,40,50 * * * * /home/mydir/botchk If you don't want to get e-mails from cron, use this: 0,10,20,30,40,50 * * * * /home/mydir/botchk >/dev/null 2>&1 Naturally, you need to change the path to the correct path for botchk. If you've never used crontab before, here is a simple way to add that line: 1. Create a new file called 'mycron' and put the above line into it. 2. From your shell prompt, type '% crontab mycron'. That will create a new crontab entry for you with a line that runs botchk every ten minutes. Botchk will then restart the bot when necessary (and send you email informing you). (7a) SETTING UP A CRONTAB USING AUTOBOTCHK Included with your Eggdrop is an Eggdrop utility called 'autobotchk'. Using autobotchk is probably the fastest way of creating your botchk and crontabbing it with just a few required steps: 1. Type 'cp scripts/autobotchk ..'. 2. Type './autobotchk '. This will hopefully crontab your bot using the default setup. If you want a list of autobotchk options, type './autobotchk'. An example with options would be: ./autobotchk -noemail -5 This would setup crontab to run the botchk every 5 minutes and also to not send you e-mail saying that it restarted your bot. (8) BORING LEGAL STUFF The Eggdrop bot is Copyright (C) by Robey Pointer. As of January, 1997, Eggdrop is distributed according to the GNU General Public License. There should be a copy of this license in the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. As of Eggdrop 1.3.28, all changes made by the Eggheads Development Team to the Eggdrop source code and any related files are Copyright (C) by Eggheads Development Team. The source code will still be distributed according to the GNU General Public License as Robey Pointer did in the past. Releases previous to 1.0m were made using a different licensing scheme. You may, at your option, use the GNU General Public License on those versions (instead of the license packaged with them) with my blessing. For any versions bearing a copyright date of 1997 or later, you have no choice -- you must use the GNU General Public License. The files "match.c", "net.c", and "blowfish.c" are exempt from the above restrictions. "match.c" is original code by Chris Fuller (email: crf@cfox.bchs.uh.edu) and has been placed by him into the public domain. "net.c" is by me, and I [Robey Pointer] also choose to place it in the public domain. "blowfish.c" is by various sources and is in the public domain as well. All 3 files contain useful functions that could easily be ported to other applications. Tcl is by John Ousterhout and is in no way affiliated with Eggdrop. It likely has its own set of copyrights and whatnots. There is no warranty, implied or whatever. You use this software at your own risk, no matter what purpose you put it to. (9) MAILING LIST There are currently a couple of mailing lists about Eggdrop. eggheads@eggheads.org is the one relevant for posts about Eggdrop 1.4 and up (suggestions, help, etc). To subscribe to the eggheads mailing list, send e-mail to eggheads-request@eggheads.org. In the body of the message, put "subscribe eggheads". You can also go to the following url: http://scrambled.eggheads.org/mailman/listinfo/eggheads ### DO NOT SEND ROBEY EMAIL ABOUT EGGDROP! ### Robey is no longer developing the Eggdrop code, so don't bother e-mailing him. If you have a serious problem, email the eggheads mailing list and it will get to the coders. Please, before posting to this list, see what things are like. When you do post, read over your post for readability, spelling, and grammar mistakes. Obviously, we're all human (or are we?) and we all make mistakes (heck, look at this document! ;). Open discussion and debate is integral to change and progress. Don't flame others over mere form (grammar and spelling), or even substantive issues for that matter. Please read and follow the mailing list rules. The eggheads@eggheads.org mailing list is not dedicated to those all too common questions we have all seen on other lists... For example: o "Why does my bot say this: Please edit your config file." o "How do I telnet my bot?" o "Where do I get Eggdrop for windows??????" Technical questions, your thoughts or suggestions on new features being added to Eggdrop, things that should be removed or fixed, amazing problems that even stump the guru's, etc. are what we want to see here. Bug reports should be sent to bugs@eggheads.org. Please read and fill out the BUG-REPORT file in the doc directory. DO NOT SEND HTML E-MAILS TO ANY OF THE EGGHEADS.ORG MAILING LISTS. ANYONE CAUGHT SENDING HTML E-MAILS TO ONE OF THESE LISTS WILL BE REMOVED IMMEDIATELY! (10) DOCUMENTATION We're trying to keep the documentation up to date. If you feel that anything is missing here or that anything should be added, etc, please e-mail bugs@eggheads.org about it. Thank you. (11) OBTAINING HELP You can obtain help with Eggdrop in the following IRC channels: Undernet - #eggdrop, #eggies EFnet - #egghelp, #eggfaq IRCnet - #eggdrop DALnet - #eggdrop, #botcentral FreeNode - #eggdrop, #egghelp QuakeNet - #eggdrop.support If you plan to ask questions in any of the above channels, you should be familiar with and follow IRC etiquette. o Don't type using CAPITAL letters, colors, or bold. o Don't use "!" and "?" excessively. o Don't /msg people without their permission. o Don't repeat or paste large amounts of text to the channel. If there are any other serious Eggdrop related channels that should be added to the above list, please let us know. ________________________________________________________________________ Copyright (C) 1997 Robey Pointer Copyright (C) 1999 - 2008 Eggheads Development Team eggdrop1.6.19/scripts/0000775000076400007640000000000011002272213013743 5ustar guppyguppyeggdrop1.6.19/scripts/notes2.tcl0000664000076400007640000001606707371410274015712 0ustar guppyguppy# # notes2.tcl - v2.1.1 - released by MHT # - a bind apart script from #TSF # - for eggdrop 1.3.15+ # # $Id: notes2.tcl,v 1.6 2001-11-05 04:08:28 guppy Exp $ # #### # # history: # -------- # 2.0.0 - first release for 1.3.14+mht series # (get notesat2.tcl for 1.1.5 series) # # 2.0.2 - Message bug corrected: "erased notes; left." is better. # - Corrected weird switch tcl syntax, bug found by Islandic. # It's so different from C (I hate tcl!). # - Desactivated message "I don't know you", boring me ! # - No more logs for notes-indexing on join :-) # # 2.0.3 - Corrected invalid idx bug, if user quits before receiving # his notes check. # # 2.1.0 - Improved protocol to avoid idx mistake for multiple connected users. # Backward compatibility is kept, but price is that idx mistake occurs # if a multiple connected user quits before receiving notes check. # Generally never happens, except in case of 'Chriphil's syndrome' ;-p # - Added missing 'You don't have that many messages.' # # 2.1.1 - fixed a couple of small bugs pertaining to $nick being used instead of # $botnet-nick (found by takeda, fixed by guppy) # #### # Check your notes on every shared bot of the hub. # # .notes [bot|all] index # .notes [bot|all] read <#|all> # .notes [bot|all] erase <#|all> # # # may be numbers and/or intervals separated by ; # ex: .notes erase 2-4;8;16- # .notes noBOTy read all # ######## unbind dcc - notes *dcc:notes bind dcc - notes *dcc:notes2 bind chon - * *chon:notes2 bind bot - notes2: *bot:notes2 bind bot - notes2reply: *bot:notes2reply ######## proc n2_notesindex {bot handle idx} { global nick botnet-nick switch "([notes $handle])" { "(-2)" { putbot $bot "notes2reply: $handle Notefile failure. $idx" } #"-1" { putbot $bot "notes2reply: $handle I don't know you. $idx" } "(-1)" { return 0 } "(0)" { putbot $bot "notes2reply: $handle You have no messages. $idx" } default { putbot $bot "notes2reply: $handle ### You have the following notes waiting: $idx" set index 0 foreach note [notes $handle "-"] { if {($note != 0)} { incr index set sender [lindex $note 0] set date [strftime "%b %d %H:%M" [lindex $note 1]] putbot $bot "notes2reply: $handle %$index. $sender ($date) $idx" } } putbot $bot "notes2reply: $handle ### Use '.notes ${botnet-nick} read' to read them. $idx" } } return 1 } ######## proc n2_notesread {bot handle idx numlist} { if {($numlist == "")} { set numlist "-" } switch "([notes $handle])" { "(-2)" { putbot $bot "notes2reply: $handle Notefile failure. $idx" } #"(-1)" { putbot $bot "notes2reply: $handle I don't know you. $idx" } "(-1)" { return 0 } "(0)" { putbot $bot "notes2reply: $handle You have no messages. $idx" } default { set count 0 set list [listnotes $handle $numlist] foreach note [notes $handle $numlist] { if {($note != 0)} { set index [lindex $list $count] set sender [lindex $note 0] set date [strftime "%b %d %H:%M" [lindex $note 1]] set msg [lrange $note 2 end] incr count putbot $bot "notes2reply: $handle $index. $sender ($date): $msg $idx" } else { putbot $bot "notes2reply: $handle You don't have that many messages. $idx" } } } } return 1 } ######## proc n2_noteserase {bot handle idx numlist} { switch [notes $handle] { "(-2)" { putbot $bot "notes2reply: $handle Notefile failure. $idx" } #"(-1)" { putbot $bot "notes2reply: $handle I don't know you. $idx" } "(-1)" { return 0 } "(0)" { putbot $bot "notes2reply: $handle You have no messages. $idx" } default { set erased [erasenotes $handle $numlist] set remaining [notes $handle] if {($remaining == 0) && ($erased == 0)} { putbot $bot "notes2reply: $handle You have no messages. $idx" } elseif {($remaining == 0)} { putbot $bot "notes2reply: $handle Erased all notes. $idx" } elseif {($erased == 0)} { putbot $bot "notes2reply: $handle You don't have that many messages. $idx" } elseif {($erased == 1)} { putbot $bot "notes2reply: $handle Erased 1 note, $remaining left. $idx" } else { putbot $bot "notes2reply: $handle Erased $erased notes, $remaining left. $idx" } } } return 1 } ######## proc *bot:notes2 {handle idx arg} { if {(![matchattr $handle s])} { return } set nick [lindex $arg 0] set cmd [lindex $arg 1] set num [lindex $arg 2] set idx [lindex $arg 3] if {($num == "") || ($num == "all")} { set num "-" } switch $cmd { "silentindex" { set ret 0; n2_notesindex $handle $nick $idx } "index" { set ret [n2_notesindex $handle $nick $idx] } "read" { set ret [n2_notesread $handle $nick $idx $num] } "erase" { set ret [n2_noteserase $handle $nick $idx $num] } default { set ret 0 } } if {($num == "-")} { set num "" } if {($ret == 1)} { putcmdlog "#$nick@$handle# notes $cmd $num" } } ######## proc *bot:notes2reply {handle idx arg} { # verify that idx is valid (older scripts do not provide idx) set idx [lindex $arg end] if {([valididx $idx]) && ([idx2hand $idx] == [lindex $arg 0])} { set reply [lrange $arg 1 [expr [llength $arg]-2]] } else { set idx [hand2idx [lindex $arg 0]] set reply [lrange $arg 1 end] } if {($idx == -1)} { return } if {([string range $reply 0 0] == "%")} { set reply " [string range $reply 1 end]" } putidx $idx "($handle) $reply" } ######## proc *chon:notes2 {handle idx} { putallbots "notes2: $handle silentindex $idx" return 0 } ######## proc *dcc:notes2 {handle idx arg} { global nick botnet-nick if {$arg == ""} { putidx $idx "Usage: notes \[bot|all\] index" putidx $idx " notes \[bot|all\] read <#|all>" putidx $idx " notes \[bot|all\] erase <#|all>" putidx $idx " # may be numbers and/or intervals separated by ;" putidx $idx " ex: notes erase 2-4;8;16-" putidx $idx " notes ${botnet-nick} read all" } else { set bot [string tolower [lindex $arg 0]] set cmd [string tolower [lindex $arg 1]] set numlog [string tolower [lindex $arg 2]] set num $numlog if {($num == "")} { set num "-" } if {($bot != "all") && ([lsearch [string tolower [bots]] $bot] < 0)} { if {($cmd != "index") && ($cmd != "read") && ($cmd != "erase")} { if {($bot == [string tolower $nick])} { return [*dcc:notes $handle $idx [lrange $arg 1 end]] } else { return [*dcc:notes $handle $idx $arg] } } else { putidx $idx "I don't know any bot by that name." return 0 } } elseif {($cmd != "index") && ($cmd != "read") && ($cmd != "erase")} { putdcc $idx "Function must be one of INDEX, READ, or ERASE." } elseif {$bot == "all"} { #*dcc:notes $handle $idx [lrange $arg 1 end] putallbots "notes2: $handle $cmd $num $idx" } else { putbot $bot "notes2: $handle $cmd $num $idx" } putcmdlog "#$handle# notes@$bot $cmd $numlog" } } ######## putlog "Notes 2.1.0 - Released by MHT " #### eggdrop1.6.19/scripts/help/0000775000076400007640000000000011002271500014671 5ustar guppyguppyeggdrop1.6.19/scripts/help/userinfo.help0000664000076400007640000001156310055242243017414 0ustar guppyguppy%{help=chemail}%{+m} ### %bchemail%b [email address] Sets the email address for a user. This info isn't really used by the bot for any reason except to display. If you don't specify an email address, the bot will show you the user's email address it currently has set for the user (if any). ### %bchemail%b none clears a user's email address. %{help=churl}%{+m} ### %bchurl%b [url address] Sets the url address for a user's web site. This info isn't really used by the bot for any reasons except to display. If you don't specify an url address, the bot will show you the user's url address it currently has set for the user (if any). ### %bchurl%b none clears a user's url address. %{help=chbf}%{+m} ### %bchbf%b [boyfriend] Sets the boyfriend for a user. This info isn't really used by the for any reasons except to display. If you don't specify a boyfriend, the bot will show you the user's boyfriend it currently has set for the user (if any). ### %bchbf%b none clears a user's boyfriend. %{help=chgf}%{+m} ### %bchgf%b [girlfriend] Sets the girlfriend for a user. This info isn't really used by the bot for any reasons except to display. If you don't specify a girlfriend, the bot will show you the user's girlfriend it currently has set for the user (if any). ### %bchgf%b none clears a user's girlfriend. %{help=chirl}%{+m} ### %bchirl%b [real life name] Sets the 'In Real Life' name for a user. This info isn't really used by the bot for any reasons except to display. If you don't specify an 'In Real Life' name, the bot will show you the user's 'In Real Life' name it currently has set for the user (if any). ### %bchirl%b none clears a user's 'In Real Life' name. %{help=chdob}%{+m} ### %bchdob%b [date of birth] Sets the date of birth for a user. This info isn't really used by the bot for any reasons except to display. If you don't specify the date of birth, the bot will show you the user's date of birth it currently has set for the user (if any). ### %bchdob%b none clears a user's date of birth. %{help=email} ### %bemail%b [email address] sets your email address. this data isn't really used by the bot, but it will show up if someone does a %b'whois'%b on you. if you don't specify an email address, the bot will show you the email address it currently has set for you (if any). ### %bemail none%b clears your email address. %{help=url} ### %burl%b [url site address] sets your url address. this data isn't really used by the bot, but it will show up if someone does a %b'whois'%b on you. if you don't specify an url address, the bot will show you the url address it currently has set for you (if any). ### %burl none%b clears your url address. %{help=bf} ### %bbf%b [boyfriend] sets your boyfriend. this data isn't really used by the bot, but it will show up if someone does a %b'whois'%b on you. it's also used by the seen script. if you don't specify a boyfriend, the bot will show you the boyfriend it currently has set for you (if any). ### %bbf none%b clears your boyfriend. %{help=gf} ### %bgf%b [girlfriend] sets your girlfriend. this data isn't really used by the bot, but it will show up if someone does a %b'whois'%b on you. it's also used by the seen script. if you don't specify a girlfriend, the bot will show you the girlfriend it currently has set for you (if any). ### %bgf none%b clears your girlfriend. %{help=irl} ### %birl%b [irl] sets your 'in real life' name. this data isn't really used by the bot, but it will show up if someone does a %b'whois'%b on you. if you don't specify a 'in real life' name, the bot will show you the 'in real life' name it currently has set for you (if any). ### %birl none%b clears your 'in real life' name. %{help=dob} ### %bdob%b [date of birth] sets your date of birth. this data isn't really used by the bot, but it will show up if someone does a %b'whois'%b on you. if you don't specify a date of birth, the bot will show you your date of birth it currently has set for you (if any). ### %bdob none%b clears your date of birth. (woah, no more showing ID ;) %{help=showfields}%{+m} ### %bshowfields%b shows currently loaded user info fields. %{help=userinfo}%{+m} ### %buserinfo script%b this nifty little script lets you define arbitrary strings for each user that they can set themselves or a master can set. the default script contains the entries URL, BF (boyfriend), GF (girlfriend), IRL (in real life name), EMAIL, and DOB (date of birth). each entry has a '.' command for users and a '.ch' command for masters, also there is a /msg command to change each one. for a complete list of currently loaded user info fields type '.showfields'. eggdrop1.6.19/scripts/help/cmd_resolve.help0000664000076400007640000000145007414537566020102 0ustar guppyguppy%{help=resolve} ### %bresolve%b Attempts to resolve a hostname or ipaddress using the dns module; however, in order for this command to work the best you should load the dns module. This command is completely asynchronous so it will not stop you from doing other things in the partyline while trying to resolve an address. see also: dns %{help=dns} ### %bdns%b Attempts to resolve a hostname or ipaddress using the dns module; however, in order for this command to work the best you should load the dns module. This command is completely asynchronous so it will not stop you from doing other things in the partyline while trying to resolve an address. see also: resolve %{help=all} ### %bcmd_resolve.tcl%b commands %b dns resolve%b %{-} eggdrop1.6.19/scripts/help/msg/0000775000076400007640000000000011002271500015457 5ustar guppyguppyeggdrop1.6.19/scripts/help/msg/userinfo.help0000664000076400007640000000337307371410274020212 0ustar guppyguppy%{help=email} %b/MSG%b %B %bEMAIL%b This will set your email address. It's shown when someone does a WHOIS on you (see HELP WHOIS). If you don't specify a email address, the bot will show you the email address it currently has set for you (if any). %b/MSG%b %B %bEMAIL%b none This clears your email address. %{help=url} %b/MSG%b %B %bURL%b This will set your url address. If you don't specify a url address, the bot will show you the url address it currently has set for you (if any). %b/MSG%b %B %bURL%b none This clears your url address. %{help=bf} %b/MSG%b %B %bBF%b This will set your boyfriend. some scripts (such as seen) use this information. If you don't specify a boyfriend, the bot will show you the boyfriend it currently has set for you (if any). %b/MSG%b %B %bBF%b none This clears your boyfriend. %{help=gf} %b/MSG%b %B %bGF%b This will set your girlfriend. some scripts (such as seen) use this information. If you don't specify a girlfriend, the bot will show you the girlfriend it currently has set for you (if any). %b/MSG%b %B %bGF%b none This clears your girlfriend. %{help=irl} %b/MSG%b %B %bIRL%b This will set your real name. just for the information of others :). If you don't specify a real name, the bot will show you the real name it currently has set for you (if any). %b/MSG%b %B %bIRL%b none This clears your real name. %{help=dob} %b/MSG%b %B %bDOB%b This will set your date of birth. now now, be honest :) If you don't specify a date of birth, the bot will show you the date of birth it currently has set for you (if any). %b/MSG%b %B %bDOB%b none This clears your date of birth. eggdrop1.6.19/scripts/action.fix.tcl0000664000076400007640000000146610755654156016550 0ustar guppyguppy# action.fix.tcl # # Copyright (C) 2002 - 2008 Eggheads Development Team # # Tothwolf 25May1999: cleanup # Tothwolf 04Oct1999: changed proc names slightly # poptix 07Dec2001: handle irssi (and some others) "correct" messages for DCC CTCP # # $Id: action.fix.tcl,v 1.11 2008-02-16 21:41:02 guppy Exp $ # Fix for mIRC dcc chat /me's: bind filt - "\001ACTION *\001" filt:dcc_action bind filt - "CTCP_MESSAGE \001ACTION *\001" filt:dcc_action2 proc filt:dcc_action {idx text} { return ".me [string trim [join [lrange [split $text] 1 end]] \001]" } proc filt:dcc_action2 {idx text} { return ".me [string trim [join [lrange [split $text] 2 end]] \001]" } # Fix for telnet session /me's: bind filt - "/me *" filt:telnet_action proc filt:telnet_action {idx text} { return ".me [join [lrange [split $text] 1 end]]" } eggdrop1.6.19/scripts/weed0000775000076400007640000005331207373557216014652 0ustar guppyguppy#! /bin/sh # This trick is borrowed from Tothwolf's Wolfpack \ # Search for tclsh[0-9].[0-9] in each valid dir in PATH \ for dir in $(echo $PATH | sed 's/:/ /g'); \ do \ if test -d $dir; \ then \ files=$(/bin/ls $dir | egrep '^tclsh[0-9]\.[0-9]$'); \ if test "$files" != ""; \ then \ versions="${versions:+$versions }$(echo $files | sed 's/tclsh//g')"; \ fi; \ fi; \ done; \ for ver in $versions; \ do \ tmpver=$(echo $ver | sed 's/\.//g'); \ if test "$lasttmpver" != ""; \ then \ if test "$tmpver" -gt "$lasttmpver"; \ then \ lastver=$ver; \ lasttmpver=$tmpver; \ fi; \ else \ lastver=$ver; \ lasttmpver=$tmpver; \ fi; \ done; \ exec tclsh$lastver "$0" "$@" # # $Id: weed,v 1.8 2001-11-11 20:24:46 guppy Exp $ # # weed out certain undesirables from an eggdrop userlist # try just typing 'tclsh weed' to find out the options # Robey Pointer, November 1994 # # : # I did a few bug fixes to the original weed script, things changed... # # when specifying other weed options they would unset the User() field and # a maxlast weed would try and weed again and cause the script to stop due # to User() being already unset (array nonexistant) # # when loadUserFile encountered an xtra field it would try and use the $info # variable, which was supposed to be $xtra (something overlooked when the # line was cut and pasted -- I hate it when that happens) # # changed the formatting of the saved weed file to match more closely to # eggdrop 0.9tp (so this may cause incompatibilities), but when a hostmask # field exactly matched 40 characters it would save it with no spaces after # it and eggdrop would reject the user record. I know I could have easily # changed one character, but I couldn't help myself. # 5 march 1996 # # : # upgrade for v2 userfiles # : # fixed xtra field from getting truncated # : # stopped it from mangling channel ban lists # : # upgrade for v3 userfiles # : # added an option to remove users from unwanted channels # : # upgrade for v4 userfiles, with v3 converter # : # fixed bug "list element in braces followed by X instead of space" # (the use of "lrange" where you aren't sure if it's a list is bad) # fixed --CONSOLE item not being included, creating "user" --CONSOLE # : # two more improper occurrences of "lrange" removed # : # removed ancient way of determining the current time. # : # [clock] isn't in all versions of Tcl... # : # borrowed code from Tothwolf's Wolfpack to find tclsh better # set exempt {*ban *ignore} set exemptops 0 ; set exemptmasters 0 ; set exemptfriends 0 set exemptparty 0 ; set exemptfile 0 ; set exemptchanm 0 set exemptbotm 0 ; set exemptchann 0 ; set exemptchanf 0 set exemptchano 0 set maxlast 0 ; set maxban 0 ; set maxignore 0 set weedops 0 ; set weedmasters 0 ; set weednopw 0 set stripops 0 ; set stripmasters 0 ; set weedlurkers 0 set chanrem {} set convert 0 if {![string compare "" [info commands clock]]} then { set fd [open "/tmp/egg.timer." w] close $fd set CURRENT [file atime "/tmp/egg.timer."] exec rm -f /tmp/egg.timer. } else { set CURRENT [clock seconds] } if {$argc < 1} { puts stdout "\nUsage: weed \[options\]" puts stdout " (weeds out users from an eggdrop userlist)" puts stdout "Output goes to .weed" puts stdout "Possible options:" puts stdout " - exempt this user from weeding" puts stdout " ^o ^m ^f exempt ops or masters or friends" puts stdout " ^co ^cm ^cf exempt chanops or chanmasters or chanfriends" puts stdout " ^cn exempt chanowner" puts stdout " ^p ^x exempt party-line or file-area users" puts stdout " ^b exempt botnet master" puts stdout " + weed: haven't been seen in N days" puts stdout " :n weed: haven't EVER been seen" puts stdout " :o :m weed: ops or masters with no password set" puts stdout " :a weed: anyone with no password set" puts stdout " o m unop/unmaster: ops or masters with no pass." puts stdout " b weed: bans not used in N days" puts stdout " i weed: ignores created over N days ago" puts stdout " = weed: channels no longer supported" puts stdout " c convert v3 eggdrop userfile" puts stdout "" exit } puts stdout "\nWEED 18jun97, robey\n" set filename [lindex $argv 0] for {set i 1} {$i < $argc} {incr i} { set carg [lindex $argv $i] if {$carg == ":n"} { set weedlurkers 1 } elseif {$carg == ":o"} { set weedops 1 ; set stripops 0 ; set weednopw 0 } elseif {$carg == ":m"} { set weedmasters 1 ; set stripmasters 0 ; set weednopw 0 } elseif {$carg == ":a"} { set weednopw 1 ; set weedops 0 ; set weedmasters 0 set stripops 0 ; set stripmasters 0 } elseif {$carg == "o"} { set stripops 1 ; set weedops 0 ; set weednopw 0 } elseif {$carg == "m"} { set stripmasters 1 ; set weedmasters 0 ; set weednopw 0 } elseif {$carg == "^m"} { set exemptmasters 1 } elseif {$carg == "^o"} { set exemptops 1 } elseif {$carg == "^f"} { set exemptfriends 1 } elseif {$carg == "^p"} { set exemptparty 1 } elseif {$carg == "^x"} { set exemptfile 1 } elseif {$carg == "^cf"} { set exemptchanf 1 } elseif {$carg == "^cm"} { set exemptchanm 1 } elseif {$carg == "^cn"} { set exemptchann 1 } elseif {$carg == "^b"} { set exemptbotm 1 } elseif {$carg == "^co"} { set exemptchano 1 } elseif {$carg == "c"} { set convert 1 } elseif {[string index $carg 0] == "-"} { lappend exempt [string range $carg 1 end] } elseif {[string index $carg 0] == "+"} { set maxlast [expr 60*60*24* [string range $carg 1 end]] } elseif {[string index $carg 0] == "b"} { set maxban [expr 60*60*24* [string range $carg 1 end]] } elseif {[string index $carg 0] == "i"} { set maxignore [expr 60*60*24* [string range $carg 1 end]] } elseif {[string index $carg 0] == "="} { lappend chanrem [string tolower [string range $carg 1 end]] } else { puts stderr "UNKNOWN OPTION: '$carg'\n" exit } } if {(!$weedlurkers) && (!$weedops) && (!$weedmasters) && (!$weednopw) && (!$stripops) && (!$stripmasters) && ($maxlast == 0) && ($convert == 0) && ($maxban == 0) && ($maxignore == 0) && ($chanrem == {})} { puts stderr "PROBLEM: You didn't specify anything to weed out.\n" exit } set weeding { } ; set strip { } ; set exempting { } if {$weedlurkers} { lappend weeding "lurkers" } if {$weedops} { lappend weeding "pwdless-ops" } if {$weedmasters} { lappend weeding "pwdless-masters" } if {$weednopw} { lappend weeding "pwdless-users" } if {$chanrem != {}} { lappend weeding "unwanted-channel" } if {$maxlast > 0} { lappend weeding ">[expr $maxlast /(60*60*24)]-days" } if {$maxban > 0} { lappend weeding "bans>[expr $maxban /(60*60*24)]-days" } if {$maxignore > 0} { lappend weeding "ign>[expr $maxignore /(60*60*24)]-days" } if {$weeding != { }} { puts stdout "Weeding:$weeding" } if {$stripops} { lappend strip "pwdless-ops" } if {$stripmasters} { lappend strip "pwdless-masters" } if {$strip != { }} { puts stdout "Stripping:$strip" } if {$exemptops} { lappend exempting "(ops)" } if {$exemptmasters} { lappend exempting "(masters)" } if {$exemptfriends} { lappend exempting "(friends)" } if {$exemptparty} { lappend exempting "(party-line)" } if {$exemptfile} { lappend exempting "(file-area)" } if {$exemptchann} { lappend exempting "(channel-owners)" } if {$exemptchanm} { lappend exempting "(channel-masters)" } if {$exemptchano} { lappend exempting "(channel-ops)" } if {$exemptchanf} { lappend exempting "(channel-friends)" } if {$exemptbotm} { lappend exempting "(botnet masters)" } if {[llength $exempt]>2} { lappend exempting "[lrange $exempt 2 end]" } if {$exempting != { }} { puts stdout "Exempt:$exempting" } puts stdout "\nReading $filename ..." proc convertUserFile {fname} { global User Hostmask Channel Botflag LastOn BotAddr Xtra convert puts stdout "\nRunning Converter on $fname" set oldhandle {} if {[catch {set fd [open $fname r]}] != 0} { return 0 } set line [string trim [gets $fd]] if {[string range $line 1 2] == "3v"} { set convert 1 } elseif {[string range $line 1 2] == "4v"} { return 0 } while {![eof $fd]} { set line [string trim [gets $fd]] if {([string index $line 0] != "#") && ([string length $line] > 0)} { scan $line "%s" handle if {$handle == "-"} { # hostmask set hmList [split [string range $line 2 end] ,] for {set i 0} {$i < [llength $hmList]} {incr i} { lappend Hostmask($oldhandle) [string trim [lindex $hmList $i]] } } elseif {$handle == "!"} { # channel set chList [string trim [string range $line 1 end]] lappend Channel($oldhandle) "[lrange $chList 0 1] [string trim [lindex $chList end] 0123456789]" } elseif {$handle == "*"} { # dccdir set dccdir [string trim [string range $line 2 end]] set User($oldhandle) [lreplace $User($oldhandle) 2 2 $dccdir] } elseif {$handle == "+"} { # email set email [string trim [string range $line 2 end]] set User($oldhandle) [lreplace $User($oldhandle) 3 3 $email] } elseif {$handle == "="} { # comment set comment [string trim [string range $line 2 end]] set User($oldhandle) [lreplace $User($oldhandle) 4 4 $comment] } elseif {$handle == ":"} { # user info line / bot addresses if {[lsearch [split [lindex $User($oldhandle) 0] ""] b] == -1} { set info [string trim [string range $line 1 end]] set User($oldhandle) [lreplace $User($oldhandle) 5 5 $info] } else { set BotAddr($oldhandle) [string trim [string range $line 1 end]] } } elseif {$handle == "."} { # xtra field start if {![info exists xtraList($oldhandle)]} { set xtraList($oldhandle) [string trim [string range $line 1 end]] } { set xtraList($oldhandle) "$xtraList($oldhandle) [string trim [string range $line 1 end]]" } } elseif {$handle == "!!"} { # laston set LastOn($oldhandle) [lindex $line 1] } else { # finish up xtra field first if {[info exists xtraList($oldhandle)]} { for {set i 0} {$i < [llength $xtraList($oldhandle)]} {incr i} { lappend Xtra($oldhandle) [string trim [lindex $xtraList($oldhandle) $i] \{] } } # begin of new user scan $line "%s %s %s %s" handle pass attr ts if {$convert == 1 && $attr != ""} { regsub -all {B} $attr {t} attr set botflags "s h a l r" ; set Botflag($handle) "" set nattr [split [string trim $attr 0123456789] ""] ; set attr "" foreach flag $botflags { if {[lsearch -exact $nattr $flag] != -1} {append Botflag($handle) $flag} } foreach flag $nattr { if {[lsearch -exact $botflags $flag] == -1} {append attr $flag} } } set User($handle) [list $attr $pass {} {} {} {}] set Hostmask($handle) {} set Channel($handle) {} set oldhandle $handle } } } return 1 } proc loadUserFile {fname} { global User Hostmask Channel Botflag LastOn BotAddr Xtra set oldhandle {} if {[catch {set fd [open $fname r]}] != 0} { return 0 } set line [string trim [gets $fd]] if {[string range $line 1 2] != "4v"} { if {[string range $line 1 2] == "3v"} { convertUserFile $fname return 1 } else { puts stderr "Unknown userfile version! (not v4)\n" exit } } while {![eof $fd]} { set line [string trim [gets $fd]] if {([string index $line 0] != "#") && ([string length $line] > 0)} { scan $line "%s" handle if {$handle == "--HOSTS"} { # hostmask set hmList [lindex $line 1] lappend Hostmask($oldhandle) [string trim $hmList] } elseif {$handle == "-"} { # hostmask set hmList [join [lrange $line 1 end]] lappend Hostmask($oldhandle) [string trim $hmList] } elseif {$handle == "!"} { # channel set chList [string trim [string range $line 1 end]] lappend Channel($oldhandle) $chList } elseif {$handle == "--BOTADDR"} { # botaddr set BotAddr($oldhandle) [lindex $line 1] } elseif {$handle == "--PASS"} { # pass set pass [string trim [string range $line [expr [string first " " $line] + 1] end]] set User($oldhandle) [lreplace $User($oldhandle) 1 1 $pass] } elseif {$handle == "--DCCDIR"} { # dccdir set first [string first " " $line] if {$first != -1} { set dccdir [string trim [string range $line [expr $first + 1] end]] } { set dccdir "" } set User($oldhandle) [lreplace $User($oldhandle) 2 2 $dccdir] } elseif {$handle == "--COMMENT"} { # comment set first [string first " " $line] if {$first != -1} { set comment [string trim [string range $line [expr $first + 1] end]] } { set comment "" } set User($oldhandle) [lreplace $User($oldhandle) 4 4 $comment] } elseif {$handle == "--INFO"} { # user info line set first [string first " " $line] if {$first != -1} { set info [string trim [string range $line [expr $first + 1] end]] } { set info "" } set User($oldhandle) [lreplace $User($oldhandle) 5 5 $info] } elseif {$handle == "--CONSOLE"} { # console set first [string first " " $line] if {$first != -1} { set console [string trim [string range $line [expr $first + 1] end]] } { set console "" } set User($oldhandle) [lreplace $User($oldhandle) 6 6 $console] } elseif {$handle == "--XTRA"} { # xtra field set first [string first " " $line] if {$first != -1} { set xtraList [string trim [string range $line [expr $first + 1] end]] } { set xtraList "" } lappend Xtra($oldhandle) $xtraList } elseif {$handle == "--LASTON"} { # laston set LastOn($oldhandle) [lindex $line 1] } elseif {$handle == "--BOTFL"} { # botflags set Botflag($oldhandle) [string trim [string range $line 1 end]] } else { # begin of new user scan $line "%s %s %s" handle dash attr set User($handle) [list $attr {} {} {} {} {} {}] set Hostmask($handle) {} set Channel($handle) {} set oldhandle $handle } } } return 1 } proc saveUserFile fname { global User Hostmask Channel Botflag LastOn BotAddr Xtra if {[catch {set fd [open $fname w]}] != 0} { return 0 } puts $fd "#4v: weed! now go away." foreach i [array names User] { set hmask "none" set hmloop 0 ; set chloop 0 ; set loloop 0 ; set xloop 0 ; set aloop 0 if {[lindex $User($i) 1] == "bans"} {set plug "bans"} {set plug "-"} set attr [lindex $User($i) 0] set ts [lindex $User($i) 2] puts $fd [format "%-9s %-20s %-24s" $i $plug $attr] for {} {$hmloop < [llength $Hostmask($i)]} {incr hmloop} { if {[string index $i 0] == "*" || [string range $i 0 1] == "::"} { set hmask [lindex $Hostmask($i) $hmloop] regsub -all {~} $hmask { } hmask puts $fd "- $hmask" } else { puts $fd "--HOSTS [lindex $Hostmask($i) $hmloop]" } } if {[info exists BotAddr($i)]} { puts $fd "--BOTADDR [lindex $BotAddr($i) 0]" } if {[info exists Xtra($i)]} { for {} {$xloop < [llength $Xtra($i)]} {incr xloop} { puts $fd "--XTRA [lindex $Xtra($i) $xloop]" } } if {[info exists Channel($i)]} { for {} {$chloop < [llength $Channel($i)]} {incr chloop} { puts $fd "! [lindex $Channel($i) $chloop]" } } if {[info exists Botflag($i)]} { if {$Botflag($i) != ""} { puts $fd "--BOTFL [lindex $Botflag($i) 0]" } } if {[string index $i 0] == "*" || [string range $i 0 1] == "::"} { set User($i) [lreplace $User($i) 1 1 {}] } if {[lindex $User($i) 1] != {}} { puts $fd "--PASS [lindex $User($i) 1]" } if {[lindex $User($i) 2] != {}} { puts $fd "--DCCDIR [lindex $User($i) 2]" } if {[lindex $User($i) 3] != {}} { puts $fd "--XTRA EMAIL [lindex $User($i) 3]" } if {[lindex $User($i) 4] != {}} { puts $fd "--COMMENT [lindex $User($i) 4]" } if {[lindex $User($i) 5] != {}} { puts $fd "--INFO [lindex $User($i) 5]" } if {[lindex $User($i) 6] != {}} { puts $fd "--CONSOLE [lindex $User($i) 6]" } if {[info exists LastOn($i)]} { puts $fd "--LASTON [lindex $LastOn($i) 0]" } } close $fd return 1 } if {![loadUserFile $filename]} { puts stdout "* Couldn't load userfile!\n" exit } if {$convert == 0} { puts stdout "Loaded. Weeding..." puts stdout "(pwd = no pass, -o/-m = removed op/master, lrk = never seen, exp = expired)" puts stdout "(uwc = unwanted channel)\n" } else { puts stdout "Loaded. Converting..." } set total 0 set weeded 0 foreach i [array names User] { incr total set attr [lindex $User($i) 0] set chanattr [lindex [lindex $Channel($i) 0] 2] if {([lsearch -exact $exempt $i] == -1) && ([string range $i 0 1] != "::") && ([string range $i 0 1] != "--") && (([string first o $attr] == -1) || (!$exemptops)) && (([string first m $attr] == -1) || (!$exemptmasters)) && (([string first f $attr] == -1) || (!$exemptfriends)) && (([string first p $attr] == -1) || (!$exemptparty)) && (([string first x $attr] == -1) || (!$exemptfile)) && (([string first t $attr] == -1) || (!$exemptbotm)) && (([string first f $chanattr] == -1) || (!$exemptchanf)) && (([string first m $chanattr] == -1) || (!$exemptchanm)) && (([string first n $chanattr] == -1) || (!$exemptchann)) && (([string first o $chanattr] == -1) || (!$exemptchano))} { set pass [lindex $User($i) 1] if {[info exists LastOn($i)]} { set ts [lindex $LastOn($i) 0] } { set ts 0 } if {([string compare $pass "-"] == 0) && ([string first b $attr] == -1)} { if {$weednopw == 1} { unset User($i) ; incr weeded puts -nonewline stdout "[format "pwd: %-10s " $i]" } elseif {([string first o $attr] != -1) && ($weedops == 1)} { unset User($i) ; incr weeded puts -nonewline stdout "[format "pwd: %-10s " $i]" } elseif {([string first m $attr] != -1) && ($weedmasters == 1)} { unset User($i) ; incr weeded puts -nonewline stdout "[format "pwd: %-10s " $i]" } if {([string first o $attr] != -1) && ($stripops == 1)} { set nattr {} for {set x 0} {$x < [string length $attr]} {incr x} { if {[string index $attr $x] != "o"} { set nattr [format "%s%s" $nattr [string index $attr $x]] } } if {$nattr == {}} { set nattr "-" } set User($i) [lreplace $User($i) 0 0 $nattr] puts -nonewline stdout "[format " -o: %-10s " $i]" } if {([string first m $attr] != -1) && ($stripmasters == 1)} { set nattr {} for {set x 0} {$x < [string length $attr]} {incr x} { if {[string index $attr $x] != "m"} { set nattr [format "%s%s" $nattr [string index $attr $x]] } } if {$nattr == {}} { set nattr "-" } set User($i) [lreplace $User($i) 0 0 $nattr] puts -nonewline stdout "[format " -m: %-10s " $i]" } } if {($ts==0) && ($weedlurkers==1) && ([string first b $attr] == -1) && [info exists User($i)]} { unset User($i) ; incr weeded puts -nonewline stdout "[format "lrk: %-10s " $i]" } if {($ts > 0) && ($maxlast > 0) && ($CURRENT-$ts > $maxlast && [info exists User($i)])} { unset User($i) ; incr weeded puts -nonewline stdout "[format "exp: %-10s " $i]" } if {$chanrem != {} && [info exists Channel($i)]} { foreach unchan $chanrem { set id [lsearch [string tolower $Channel($i)] *$unchan*] if {$id != -1} { set Channel($i) [lreplace $Channel($i) $id $id] ; incr weeded puts -nonewline stdout "[format "uwc: %-10s " $i]" } } } } flush stdout } if {$weeded == 0 && $convert == 0} { puts -nonewline stdout "uNF... Nothing to weed!" } puts stdout "\n" foreach i [array names User] { if {([string range $i 0 1] == "::") || ($i == "*ban")} { for {set j 0} {$j < [llength $Hostmask($i)]} {incr j} { set ban [split [lindex $Hostmask($i) $j] :] if {[string range [lindex $ban 2] 0 0] == "+"} { set lastused [lindex $ban 3] if {($maxban > 0) && ($CURRENT-$lastused > $maxban)} { if {$i == "*ban"} { puts stdout "Expired ban: [lindex $ban 0]" } { puts stdout "Expired ban on [string range $i 2 end]: [lindex $ban 0]" } set Hostmask($i) [lreplace $Hostmask($i) $j $j] incr j -1 } } } } if {$i == "*ignore"} { for {set j 0} {$j < [llength $Hostmask($i)]} {incr j} { set ign [split [lindex $Hostmask($i) $j] :] set lastused [lindex $ign 3] if {($maxignore > 0) && ($CURRENT-$lastused > $maxignore)} { puts stdout "Expired ignore: [lindex $ign 0]" set Hostmask($i) [lreplace $Hostmask($i) $j $j] incr j -1 } } } } puts stdout "\nFinished scan." puts stdout "Original total ($total), new total ([expr $total-$weeded]), zapped ($weeded)" if {![saveUserFile $filename.weed]} { puts stdout "* uNF... Couldn't save new userfile!\n" exit } puts stdout "Wrote $filename.weed" eggdrop1.6.19/scripts/sentinel.tcl0000664000076400007640000014733307463542124016324 0ustar guppyguppy# sentinel.tcl v2.70 (15 April 2002) # Copyright 1998-2002 by slennox # slennox's eggdrop page - http://www.egghelp.org/ # Flood protection system for eggdrop, with integrated BitchX CTCP # simulation. This script is designed to provide strong protection for your # bot and channels against large floodnets and proxy floods. # # Note that this script was developed on the eggdrop 1.3, 1.4, and 1.6 # series and may not work properly on other versions. # # v2.00 - New standalone release. Contains refinements and features from # the netbots.tcl version of sentinel.tcl. # v2.50 - Locktimes of less than 30 were erroneously allowed. # putquick -next is now supported (eggdrop 1.5+) for faster channel # lock. # - Ban mechanism now checks if flooders are coming from the same # domain or ident and performs wildcard bans instead of banning # each IP/host individually. # - Added tsunami detection to the avalanche flood detection system. # - Variables are now cleared after removing a channel. # - Removed unnecessary botonchan checks throughout components where # botisop already checks for that. # - Removed all unnecessary use of parentheses. # v2.60 - Modified putquick compatibility proc. # - Added sl_wideban option to make domain/ident bans optional. # - Fixed typos in various ban-related functions. # - Unused procs are now unloaded. # - Wildcard bans covering domains/idents were not doing proper # checks on join-part flooders. # v2.70 - Fixed "allbans" error which could occur when sl_wideban is # disabled. # - Added sl_masktype option, currently offering three different # ban/ignore mask types. # - Merged unsets in sl_unsetarray. # - Changed use of "split" in timers to the less ugly "list". # # sentinel.tcl is centered around its channel lock mechanism. It sets the # channel +mi (moderated and invite-only) whenever a substantial flood on # the channel is detected. This ensures channel stability when flooded, # allowing the bots to deal with the flood as smoothly as possible. # sentinel.tcl detects the following types of floods: # # * Channel CTCP floods. This is the most common type of flood, and will # often make users quit from the channel with 'Excess Flood'. A quick # channel lock can prevent this. # * Channel join-part floods. A common type of channel flood in which many # floodbots cycle the channel. # * Channel nick floods. Nick floods are unique in that they can occur even # after a channel is locked. sentinel has special mechanisms to deal with # this as effectively as possible. # * Channel avalanche/tsunami floods. While the avalanche flood is quite # uncommon these days, tsunami floods are often used to seriously lag # mIRC and other clients using control codes (colour, bold, underline, # etc.) # * Channel text floods. Not small text floods - but when hundreds of # messages are sent to the channel within a short period. Detected to # stop really aggressive text floods and reduce the possibility of the # bot crashing or consuming excessive CPU. # # sentinel also has additional protection features for the bot and channel: # # * Bogus username detection. Users with annoying bogus characters in their # ident are banned. A channel lock is applied if multiple join in a short # period. # * Full ban list detection. During a serious flood, the ban list may # become full. If this happens, the bots may start kick flooding since # they cannot ban. If the ban list is full, the channel will be set +i. # * Bot CTCP flood protection. Protects the bot if it is CTCP flooded. # * Bot MSG flood protection. Protects the bot if it's flooded with MSGs or # MSG commands. # * Automatic bans and ignores. During a flood, sentinel will compile a # list of the flooders, then kick-ban them after the channel has been # locked. # * BitchX simulation. This has been built-in mainly because you cannot use # a third-party BitchX simulator with sentinel (only one script at a time # can have control of CTCPs). sentinel provides accurate simulation of # BitchX 75p1+ and 75p3+ CTCP replies and AWAY mode. # * Public commands (lc and uc) and DCC commands (.lock and .unlock) for # locking/unlocking channels. # * DCC command .sentinel displays current settings. # # Important Notes: # - Make sure no bots are enforcing channel mode -i and/or -m. # - Bans are added to the bot's internal ban list, and expire after 24 # hours by default. If you have +dynamicbans set, the bans may be removed # from the channel much sooner than this, but the ban will remain in the # bot's internal ban list until it expires. # - For greater protection against large channel floods, I recommend you # also use a channel limiter script, such as chanlimit.tcl. # - There is a trade-off between convenience and security. The more # automation you enable, the more stress the bot will be under during a # flood and the more stuff it will be sending to the server. # - Where security is paramount, have one or two bots that aren't running # sentinel.tcl. Since sentinel.tcl is a complex script with many # automated and convenience features, there is a potential for # vulnerabilities. # The following flood settings are in number:seconds format, 0:0 to # disable. # Bot CTCP flood. set sl_bcflood 5:30 # Bot MSG flood. set sl_bmflood 6:20 # Channel CTCP flood. set sl_ccflood 5:20 # Channel avalanche/tsunami flood. set sl_avflood 6:20 # Channel text flood. set sl_txflood 80:30 # Channel bogus username join flood. set sl_boflood 4:20 # Channel join-part flood. set sl_jflood 6:20 # Channel nick flood. set sl_nkflood 6:20 # Flood setting notes: # - Don't fiddle too much with the seconds field in the flood settings, as # it can reduce the effectiveness of the script. The seconds field should # set in the 20-60 seconds range. # - Avalanche/tsunmami flood detection may be CPU intensive on a busy # channel, although I don't think it's a big deal on most systems. If # you're concerned about CPU usage you may wish to disable it, perhaps # leaving it enabled on one bot. Disabling text flood protection can # further reduce CPU usage. # - On bots with avalanche/tsunami flood detection enabled, it's # recommended that you also enable text flood detection to cap CPU usage # during a flood. # - If you enable nick flood detection, it's strongly recommended that it # be enabled on all bots that have sentinel.tcl loaded. This is required # for effective nick flood handling. # Specify the number of control characters that must be in a line before # it's counted by the tsunami flood detector. For efficiency reasons, # tsunami detection is implemented with avalanche detection, so sl_avflood # must be enabled for tsunami detection to be active. Setting this to 0 # will disable tsunami detection. set sl_tsunami 10 # Valid settings: 0 to disable, otherwise 1 or higher. # Length of time in minutes to ban channel flooders. This makes the bot # perform kicks and bans on flooders after the channel lock. Because of the # reactive nature of automatic bans, you should disable this on at least # one bot for the most effective protection. set sl_ban 1440 # Valid settings: 0 to disable, otherwise 1 or higher. # Length of time in minutes of on-join bans for bogus usernames. For the # most effective protection, you should disable this on at least one bot. set sl_boban 1440 # Valid settings: 0 to disable, otherwise 1 or higher. # Set global bans on channel flooders and bogus usernames? set sl_globalban 0 # Valid settings: 1 for global bans, 0 for channel-specific bans. # When processing a list of flooders, sentinel.tcl compares the hosts to # see if multiple flooders are coming from a particular domain/IP or using # the same ident (e.g. different vhosts on a single user account). If # multiple flooders come from the same domain/IP, or if multiple flooders # have the same ident, then the whole domain/IP (i.e. *!*@*.domain.com or # *!*@555.555.555.*) or ident (i.e. *!*username@*) is banned. If you # disable this option, all bans will be in *!*@machine.domain.com and # *!*@555.555.555.555 format. set sl_wideban 1 # Valid settings: 1 to enable, 0 to disable. # Maximum number of bans allowed in the bot's ban list before sentinel will # stop adding new bans. This prevents the bot from adding hundreds of bans # on really large floods. Note that this has nothing to do with the channel # ban list. set sl_banmax 100 # Valid settings: 1 or higher. # Length of time in minutes to ignore bot flooders. On bots with sl_ban # active, channel flooders are also added to the ignore list. set sl_igtime 240 # Valid settings: 1 or higher. # Select the type of hostmask to use when banning and/or ignoring flooders. # There are three to choose from: # 0 - *!*@machine.domain.com / *!*@555.555.555.555 # 1 - *!*ident@machine.domain.com / *!*ident@555.555.555.555 # 2 - *!*ident@*.domain.com / *!*ident@555.555.555.* # The default option, 0, is strongly recommended for most situations, and # provides the best level of protection. The other two options are provided # mainly for special cases. set sl_masktype 0 # Valid settings: 0, 1, or 2, depending on the hostmask type you wish to use. # Length of time in seconds to set channel +i if flooded. If set to 0, +i # will not be removed automatically. set sl_ilocktime 120 # Valid settings: 0 to prevent +i being removed automatically, otherwise 30 # or higher. # Length of time in seconds to set channel +m if flooded. If set to 0, +m # will not be removed automatically. set sl_mlocktime 60 # Valid settings: 0 to prevent +m being removed automatically, otherwise 30 # or higher. # On small floods (two flooders or less), remove the +mi shortly after bans # have been set, instead of waiting for the locktimes to expire? This # prevents unnecessary extended locks on small floods. This setting is only # used by bots with sl_ban enabled. set sl_shortlock 0 # Valid settings: 0 to disable, 1 to enable. # Number of bans to allow in the channel ban list before setting the # channel +i. If enabled, this should preferably be set to just below the # maximum number of bans allowed. set sl_bfmaxbans 19 # Valid settings: 0 to disable +i on full ban list, otherwise 1 or higher. # List of users to send a note to when channel is flooded, bot is flooded, # or ban list becomes full. set sl_note "YourNick" # Valid settings: one user like "Tom", a list of users like # "Tom Dick Harry", or "" to specify that no notes are sent. # Notice to send to channel when locked due to flood. set sl_cfnotice "Channel locked temporarily due to flood, sorry for any inconvenience this may cause :-)" # Valid settings: a text string, or set it to "" to disable. # Notice to send to channel when locked due to full ban list. set sl_bfnotice "Channel locked temporarily due to full ban list, sorry for any inconvenience this may cause :-)" # Valid settings: a text string, or set it to "" to disable. # Enable 'lc' and 'uc' public commands for locking/unlocking channel? set sl_lockcmds 2 # Valid settings: 0 to disable, 1 to enable, 2 to require user to be opped # on the channel to use the command. # Users with these flags are allowed to use lc/uc public commands, and # .lock/.unlock DCC commands. set sl_lockflags "o" # Valid settings: one flag like "n", or a list of flags like "fo" (means # 'f OR o'). # Enable BitchX CTCP and AWAY simulation? set sl_bxsimul 0 # Valid settings: 1 to enable, 0 to disable. # Don't edit below unless you know what you're doing. if {$numversion < 1032400} { proc botonchan {chan} { global botnick if {![validchan $chan]} { error "illegal channel: $chan" } elseif {![onchan $botnick $chan]} { return 0 } return 1 } proc putquick {text args} { putserv $text } } proc sl_ctcp {nick uhost hand dest key arg} { global botnet-nick botnick realname sl_ban sl_bflooded sl_bcflood sl_bcqueue sl_bxjointime sl_bxmachine sl_bxonestack sl_bxsimul sl_bxsystem sl_bxversion sl_bxwhoami sl_ccbanhost sl_ccbannick sl_ccflood sl_ccqueue sl_flooded sl_locked sl_note set chan [string tolower $dest] if {[lsearch -exact $sl_ccflood 0] == -1 && [validchan $chan] && ![isop $nick $chan]} { if {$nick == $botnick} {return 0} if {$sl_ban && !$sl_locked($chan) && ![matchattr $hand f|f $chan]} { lappend sl_ccbannick($chan) $nick ; lappend sl_ccbanhost($chan) [string tolower $uhost] utimer [lindex $sl_ccflood 1] [list sl_ccbanqueue $chan] } if {$sl_flooded($chan)} {return 1} incr sl_ccqueue($chan) utimer [lindex $sl_ccflood 1] [list sl_ccqueuereset $chan] if {$sl_ccqueue($chan) >= [lindex $sl_ccflood 0]} { sl_lock $chan "CTCP flood" ${botnet-nick} ; return 1 } if {$sl_bflooded} {return 1} } elseif {[lindex $sl_bcflood 0] && $dest == $botnick} { if {$sl_bflooded} { sl_ignore [string tolower $uhost] $hand "CTCP flooder" ; return 1 } incr sl_bcqueue utimer [lindex $sl_bcflood 1] {incr sl_bcqueue -1} if {$sl_bcqueue >= [lindex $sl_bcflood 0]} { putlog "sentinel: CTCP flood detected on me! Stopped answering CTCPs temporarily." set sl_bflooded 1 utimer [lindex $sl_bcflood 1] {set sl_bflooded 0} if {[info commands sendnote] != ""} { foreach recipient $sl_note { if {[validuser $recipient]} { sendnote SENTINEL $recipient "Bot was CTCP flooded." } } } return 1 } } if {!$sl_bxsimul} {return 0} if {$sl_bxonestack} {return 1} set sl_bxonestack 1 ; utimer 2 {set sl_bxonestack 0} switch -exact -- $key { "CLIENTINFO" { set bxcmd [string toupper $arg] switch -exact -- $bxcmd { "" {putserv "NOTICE $nick :\001CLIENTINFO SED UTC ACTION DCC CDCC BDCC XDCC VERSION CLIENTINFO USERINFO ERRMSG FINGER TIME PING ECHO INVITE WHOAMI OP OPS UNBAN IDENT XLINK UPTIME :Use CLIENTINFO to get more specific information\001"} "SED" {putserv "NOTICE $nick :\001CLIENTINFO SED contains simple_encrypted_data\001"} "UTC" {putserv "NOTICE $nick :\001CLIENTINFO UTC substitutes the local timezone\001"} "ACTION" {putserv "NOTICE $nick :\001CLIENTINFO ACTION contains action descriptions for atmosphere\001"} "DCC" {putserv "NOTICE $nick :\001CLIENTINFO DCC requests a direct_client_connection\001"} "CDCC" {putserv "NOTICE $nick :\001CLIENTINFO CDCC checks cdcc info for you\001"} "BDCC" {putserv "NOTICE $nick :\001CLIENTINFO BDCC checks cdcc info for you\001"} "XDCC" {putserv "NOTICE $nick :\001CLIENTINFO XDCC checks cdcc info for you\001"} "VERSION" {putserv "NOTICE $nick :\001CLIENTINFO VERSION shows client type, version and environment\001"} "CLIENTINFO" {putserv "NOTICE $nick :\001CLIENTINFO CLIENTINFO gives information about available CTCP commands\001"} "USERINFO" {putserv "NOTICE $nick :\001CLIENTINFO USERINFO returns user settable information\001"} "ERRMSG" {putserv "NOTICE $nick :\001CLIENTINFO ERRMSG returns error messages\001"} "FINGER" {putserv "NOTICE $nick :\001CLIENTINFO FINGER shows real name, login name and idle time of user\001"} "TIME" {putserv "NOTICE $nick :\001CLIENTINFO TIME tells you the time on the user's host\001"} "PING" {putserv "NOTICE $nick :\001CLIENTINFO PING returns the arguments it receives\001"} "ECHO" {putserv "NOTICE $nick :\001CLIENTINFO ECHO returns the arguments it receives\001"} "INVITE" {putserv "NOTICE $nick :\001CLIENTINFO INVITE invite to channel specified\001"} "WHOAMI" {putserv "NOTICE $nick :\001CLIENTINFO WHOAMI user list information\001"} "OP" {putserv "NOTICE $nick :\001CLIENTINFO OP ops the person if on userlist\001"} "OPS" {putserv "NOTICE $nick :\001CLIENTINFO OPS ops the person if on userlist\001"} "UNBAN" {putserv "NOTICE $nick :\001CLIENTINFO UNBAN unbans the person from channel\001"} "IDENT" {putserv "NOTICE $nick :\001CLIENTINFO IDENT change userhost of userlist\001"} "XLINK" {putserv "NOTICE $nick :\001CLIENTINFO XLINK x-filez rule\001"} "UPTIME" {putserv "NOTICE $nick :\001CLIENTINFO UPTIME my uptime\001"} "default" {putserv "NOTICE $nick :\001ERRMSG CLIENTINFO: $arg is not a valid function\001"} } return 1 } "VERSION" { putserv "NOTICE $nick :\001VERSION \002BitchX-$sl_bxversion\002 by panasync \002-\002 $sl_bxsystem :\002 Keep it to yourself!\002\001" return 1 } "USERINFO" { putserv "NOTICE $nick :\001USERINFO \001" return 1 } "FINGER" { putserv "NOTICE $nick :\001FINGER $realname ($sl_bxwhoami@$sl_bxmachine) Idle [expr [unixtime] - $sl_bxjointime] seconds\001" return 1 } "PING" { putserv "NOTICE $nick :\001PING $arg\001" return 1 } "ECHO" { if {[validchan $chan]} {return 1} putserv "NOTICE $nick :\001ECHO [string range $arg 0 59]\001" return 1 } "ERRMSG" { if {[validchan $chan]} {return 1} putserv "NOTICE $nick :\001ERRMSG [string range $arg 0 59]\001" return 1 } "INVITE" { if {$arg == "" || [validchan $chan]} {return 1} set chanarg [lindex [split $arg] 0] if {((($sl_bxversion == "75p1+") && ([string trim [string index $chanarg 0] "#+&"] == "")) || (($sl_bxversion == "75p3+") && ([string trim [string index $chanarg 0] "#+&!"] == "")))} { if {[validchan $chanarg]} { putserv "NOTICE $nick :\002BitchX\002: Access Denied" } else { putserv "NOTICE $nick :\002BitchX\002: I'm not on that channel" } } return 1 } "WHOAMI" { if {[validchan $chan]} {return 1} putserv "NOTICE $nick :\002BitchX\002: Access Denied" return 1 } "OP" - "OPS" { if {$arg == "" || [validchan $chan]} {return 1} putserv "NOTICE $nick :\002BitchX\002: I'm not on [lindex [split $arg] 0], or I'm not opped" return 1 } "UNBAN" { if {$arg == "" || [validchan $chan]} {return 1} if {[validchan [lindex [split $arg] 0]]} { putserv "NOTICE $nick :\002BitchX\002: Access Denied" } else { putserv "NOTICE $nick :\002BitchX\002: I'm not on that channel" } return 1 } } return 0 } proc sl_bmflood {nick uhost hand text} { global sl_bmflood sl_bflooded sl_bmqueue sl_note if {[matchattr $hand b] && [string tolower [lindex [split $text] 0]] == "go"} {return 0} if {$sl_bflooded} { sl_ignore [string tolower $uhost] $hand "MSG flooder" ; return 0 } incr sl_bmqueue utimer [lindex $sl_bmflood 1] {incr sl_bmqueue -1} if {$sl_bmqueue >= [lindex $sl_bmflood 0]} { putlog "sentinel: MSG flood detected on me! Stopped answering MSGs temporarily." set sl_bflooded 1 utimer [lindex $sl_bmflood 1] {set sl_bflooded 0} if {[info commands sendnote] != ""} { foreach recipient $sl_note { if {[validuser $recipient]} { sendnote SENTINEL $recipient "Bot was MSG flooded." } } } } return 0 } proc sl_avflood {from keyword arg} { global botnet-nick botnick sl_ban sl_avbanhost sl_avbannick sl_avflood sl_avqueue sl_flooded sl_locked sl_txflood sl_txqueue set arg [split $arg] set chan [string tolower [lindex $arg 0]] if {![validchan $chan]} {return 0} set nick [lindex [split $from !] 0] if {$nick == $botnick || $nick == "" || [string match *.* $nick]} {return 0} if {![onchan $nick $chan] || [isop $nick $chan]} {return 0} if {!$sl_flooded($chan) && [lsearch -exact $sl_txflood 0] == -1} { incr sl_txqueue($chan) if {$sl_txqueue($chan) >= [lindex $sl_txflood 0]} { sl_lock $chan "TEXT flood" ${botnet-nick} } } set text [join [lrange $arg 1 end]] if {[sl_checkaval $text] && [lsearch -exact $sl_avflood 0] == -1} { set uhost [string trimleft [getchanhost $nick $chan] "~+-^="] set hand [nick2hand $nick $chan] if {$sl_ban && !$sl_locked($chan) && $nick != $botnick && ![matchattr $hand f|f $chan]} { lappend sl_avbannick($chan) $nick ; lappend sl_avbanhost($chan) [string tolower $uhost] utimer [lindex $sl_avflood 1] [list sl_avbanqueue $chan] } if {$sl_flooded($chan)} {return 0} incr sl_avqueue($chan) utimer [lindex $sl_avflood 1] [list sl_avqueuereset $chan] if {$sl_avqueue($chan) >= [lindex $sl_avflood 0]} { sl_lock $chan "AVALANCHE/TSUNAMI flood" ${botnet-nick} } } return 0 } proc sl_checkaval {text} { global sl_tsunami if {[regsub -all -- "\001|\007" $text "" temp] >= 3} {return 1} if {$sl_tsunami && [regsub -all -- "\002|\003|\017|\026|\037" $text "" temp] >= $sl_tsunami} {return 1} return 0 } proc sl_nkflood {nick uhost hand chan newnick} { global botnet-nick botnick sl_ban sl_banmax sl_flooded sl_globalban sl_locked sl_nickkick sl_nkbanhost sl_nkflood sl_nkflooding sl_nkqueue set chan [string tolower $chan] if {[isop $newnick $chan]} {return 0} if {$sl_ban && !$sl_locked($chan) && $nick != $botnick && ![matchattr $hand f|f $chan]} { lappend sl_nkbanhost($chan) [string tolower $uhost] utimer [lindex $sl_nkflood 1] [list sl_nkbanqueue $chan] } if {!$sl_nickkick && $sl_flooded($chan) && $sl_locked($chan)} { putserv "KICK $chan $newnick :NICK flooder" set sl_nickkick 1 ; set sl_nkflooding($chan) [unixtime] if {$sl_ban} { set bhost [string tolower [sl_masktype $uhost]] if {$sl_globalban} { if {[llength [banlist]] < $sl_banmax && ![isban $bhost] && ![matchban $bhost]} { newban $bhost sentinel "NICK flooder" $sl_ban } } else { if {[llength [banlist $chan]] < $sl_banmax && ![isban $bhost $chan] && ![matchban $bhost $chan]} { newchanban $chan $bhost sentinel "NICK flooder" $sl_ban } } } utimer [expr [rand 2] + 3] {set sl_nickkick 0} return 0 } if {$sl_flooded($chan)} {return 0} incr sl_nkqueue($chan) utimer [lindex $sl_nkflood 1] [list sl_nkqueuereset $chan] if {$sl_nkqueue($chan) >= [lindex $sl_nkflood 0]} { sl_lock $chan "NICK flood" ${botnet-nick} } return 0 } proc sl_jflood {nick uhost hand chan} { global botnet-nick botnick sl_ban sl_banmax sl_boban sl_bobanhost sl_bobannick sl_boflood sl_boqueue sl_flooded sl_globalban sl_jbanhost sl_jbannick sl_jflood sl_jqueue sl_locked sl_pqueue if {$nick == $botnick} { sl_setarray $chan } else { set ihost [string tolower [sl_masktype $uhost]] if {[isignore $ihost]} { killignore $ihost } set chan [string tolower $chan] if {[lsearch -exact $sl_boflood 0] == -1 && [sl_checkbogus [lindex [split $uhost @] 0]]} { if {!$sl_locked($chan) && ![matchattr $hand f|f $chan]} { set bhost [string tolower [sl_masktype $uhost]] if {$sl_boban && [botisop $chan] && !$sl_flooded($chan)} { putserv "KICK $chan $nick :BOGUS username" if {$sl_globalban} { if {[llength [banlist]] < $sl_banmax && ![isban $bhost] && ![matchban $bhost]} { newban $bhost sentinel "BOGUS username" $sl_boban } } else { if {[llength [banlist $chan]] < $sl_banmax && ![isban $bhost $chan] && ![matchban $bhost $chan]} { newchanban $chan $bhost sentinel "BOGUS username" $sl_boban } } } if {$sl_ban} { lappend sl_bobannick($chan) $nick ; lappend sl_bobanhost($chan) [string tolower $uhost] utimer [lindex $sl_boflood 1] [list sl_bobanqueue $chan] } } if {!$sl_flooded($chan)} { incr sl_boqueue($chan) utimer [lindex $sl_boflood 1] [list sl_boqueuereset $chan] if {$sl_boqueue($chan) >= [lindex $sl_boflood 0]} { sl_lock $chan "BOGUS joins" ${botnet-nick} } } } if {[lsearch -exact $sl_jflood 0] == -1} { if {$sl_ban && !$sl_locked($chan) && ![matchattr $hand f|f $chan]} { lappend sl_jbannick($chan) $nick ; lappend sl_jbanhost($chan) [string tolower $uhost] utimer [lindex $sl_jflood 1] [list sl_jbanqueue $chan] } if {$sl_flooded($chan)} {return 0} incr sl_jqueue($chan) utimer [lindex $sl_jflood 1] [list sl_jqueuereset $chan] if {$sl_jqueue($chan) >= [lindex $sl_jflood 0] && $sl_pqueue($chan) >= [lindex $sl_jflood 0]} { sl_lock $chan "JOIN-PART flood" ${botnet-nick} } } } return 0 } proc sl_checkbogus {ident} { if {[regsub -all -- "\[^\041-\176\]" $ident "" temp] >= 1} {return 1} return 0 } proc sl_pflood {nick uhost hand chan {msg ""}} { global botnick sl_ban sl_flooded sl_jflood sl_locked sl_pbanhost sl_pbannick sl_pqueue if {[lsearch -exact $sl_jflood 0] != -1} {return 0} if {$nick == $botnick} { if {![validchan $chan]} { timer 5 [list sl_unsetarray $chan] } return 0 } set chan [string tolower $chan] if {$sl_ban && !$sl_locked($chan) && ![matchattr $hand f|f $chan]} { lappend sl_pbannick($chan) $nick ; lappend sl_pbanhost($chan) [string tolower $uhost] utimer [lindex $sl_jflood 1] [list sl_pbanqueue $chan] } if {$sl_flooded($chan)} {return 0} incr sl_pqueue($chan) utimer [lindex $sl_jflood 1] [list sl_pqueuereset $chan] return 0 } proc sl_pfloodk {nick uhost hand chan kicked reason} { global botnick sl_flooded sl_jflood sl_pqueue if {[lsearch -exact $sl_jflood 0] != -1} {return 0} if {$kicked == $botnick} {return 0} set chan [string tolower $chan] if {$sl_flooded($chan)} {return 0} incr sl_pqueue($chan) utimer [lindex $sl_jflood 1] [list sl_pqueuereset $chan] return 0 } proc sl_lock {chan flood detected} { global botnet-nick sl_bflooded sl_cfnotice sl_flooded sl_ilocktime sl_mlocktime sl_note if {[string tolower $detected] == [string tolower ${botnet-nick}]} { set sl_flooded($chan) 1 ; set sl_bflooded 1 if {[botisop $chan]} { sl_quicklock $chan sl_killutimer "sl_unlock $chan *" sl_killutimer "set sl_bflooded 0" if {$sl_mlocktime} { utimer $sl_mlocktime [list sl_unlock $chan m] } if {$sl_ilocktime} { utimer $sl_ilocktime [list sl_unlock $chan i] } utimer 120 {set sl_bflooded 0} putlog "sentinel: $flood detected on $chan! Channel locked temporarily." if {$sl_cfnotice != ""} { puthelp "NOTICE $chan :$sl_cfnotice" } } else { putlog "sentinel: $flood detected on $chan! Cannot lock channel because I'm not opped." utimer 120 {set sl_bflooded 0} } } else { putlog "sentinel: $flood detected by $detected on $chan!" } if {[info commands sendnote] != ""} { foreach recipient $sl_note { if {[validuser $recipient]} { if {[string tolower $detected] == [string tolower ${botnet-nick}]} { sendnote SENTINEL $recipient "$flood detected on $chan." } else { sendnote SENTINEL $recipient "$flood detected by $detected on $chan." } } } } return 0 } proc sl_unlock {chan umode} { global sl_bflooded sl_bfmaxbans sl_flooded sl_ilocktime sl_mlocktime sl_nkflooding if {[expr [unixtime] - $sl_nkflooding($chan)] < 12} { putlog "sentinel: nick flooding still in progress on $chan - not removing +mi yet.." set sl_flooded($chan) 1 ; set sl_bflooded 1 sl_killutimer "sl_unlock $chan *" sl_killutimer "set sl_bflooded 0" utimer $sl_mlocktime [list sl_unlock $chan m] ; utimer $sl_ilocktime [list sl_unlock $chan i] utimer 120 {set sl_bflooded 0} } else { set sl_flooded($chan) 0 if {![botisop $chan]} {return 0} if {$umode == "mi"} { putlog "sentinel: flood was small, performing early unlock.." } if {[string match *i* $umode] && [string match *i* [lindex [split [getchanmode $chan]] 0]]} { if {$sl_bfmaxbans && [llength [chanbans $chan]] >= $sl_bfmaxbans} { putlog "sentinel: not removing +i on $chan due to full ban list." } else { pushmode $chan -i putlog "sentinel: removed +i on $chan" } } if {[string match *m* $umode] && [string match *m* [lindex [split [getchanmode $chan]] 0]]} { pushmode $chan -m putlog "sentinel: removed +m on $chan" } } return 0 } proc sl_mode {nick uhost hand chan mode victim} { global botnick sl_ban sl_bfmaxbans sl_bfnotice sl_bfull sl_flooded sl_locked sl_note sl_unlocked set chan [string tolower $chan] if {$mode == "+b" && $sl_bfmaxbans && !$sl_bfull($chan) && ![string match *i* [lindex [split [getchanmode $chan]] 0]] && [botisop $chan] && [llength [chanbans $chan]] >= $sl_bfmaxbans} { putserv "MODE $chan +i" set sl_bfull($chan) 1 utimer 5 [list set sl_bfull($chan) 0] putlog "sentinel: locked $chan due to full ban list!" if {$sl_bfnotice != ""} { puthelp "NOTICE $chan :$sl_bfnotice" } if {[info commands sendnote] != ""} { foreach recipient $sl_note { if {[validuser $recipient]} { sendnote SENTINEL $recipient "Locked $chan due to full ban list." } } } } elseif {$mode == "+i" && $sl_flooded($chan)} { set sl_locked($chan) 1 if {$sl_ban} { sl_killutimer "sl_*banqueue $chan" utimer 7 [list sl_dokicks $chan] ; utimer 16 [list sl_setbans $chan] } } elseif {$mode == "-i" || $mode == "-m"} { set sl_locked($chan) 0 set sl_unlocked($chan) [unixtime] if {$sl_flooded($chan)} { set sl_flooded($chan) 0 if {$mode == "-i"} { sl_killutimer "sl_unlock $chan i" } else { sl_killutimer "sl_unlock $chan m" } sl_killutimer "sl_unlock $chan mi" if {$nick != $botnick} { putlog "sentinel: $chan unlocked by $nick" } } } return 0 } proc sl_dokicks {chan} { global sl_avbannick sl_bobannick sl_ccbannick sl_kflooders sl_jbannick sl_pbannick if {![botisop $chan]} {return 0} set sl_kflooders 0 sl_kick $chan $sl_ccbannick($chan) "CTCP flooder" ; set sl_ccbannick($chan) "" sl_kick $chan $sl_avbannick($chan) "AVALANCHE/TSUNAMI flooder" ; set sl_avbannick($chan) "" sl_kick $chan $sl_bobannick($chan) "BOGUS username" ; set sl_bobannick($chan) "" set jklist $sl_jbannick($chan) ; set pklist $sl_pbannick($chan) if {$jklist != "" && $pklist != ""} { set klist "" foreach nick $jklist { if {[lsearch -exact $pklist $nick] != -1} { lappend klist $nick } } sl_kick $chan $klist "JOIN-PART flooder" } set sl_jbannick($chan) "" ; set sl_pbannick($chan) "" return 0 } proc sl_kick {chan klist reason} { global sl_kflooders sl_kicks if {$klist != ""} { set kicklist "" foreach nick $klist { if {[lsearch -exact $kicklist $nick] == -1} { lappend kicklist $nick } } unset nick incr sl_kflooders [llength $kicklist] foreach nick $kicklist { if {[onchan $nick $chan] && ![onchansplit $nick $chan]} { lappend ksend $nick if {[llength $ksend] >= $sl_kicks} { putserv "KICK $chan [join $ksend ,] :$reason" unset ksend } } } if {[info exists ksend]} { putserv "KICK $chan [join $ksend ,] :$reason" } } return 0 } proc sl_setbans {chan} { global sl_avbanhost sl_bobanhost sl_ccbanhost sl_kflooders sl_jbanhost sl_nkbanhost sl_pbanhost sl_shortlock sl_unlocked sl_wideban if {![botonchan $chan]} {return 0} set sl_ccbanhost($chan) [sl_dfilter $sl_ccbanhost($chan)] set sl_avbanhost($chan) [sl_dfilter $sl_avbanhost($chan)] set sl_nkbanhost($chan) [sl_dfilter $sl_nkbanhost($chan)] set sl_bobanhost($chan) [sl_dfilter $sl_bobanhost($chan)] set sl_jbanhost($chan) [sl_dfilter $sl_jbanhost($chan)] set sl_pbanhost($chan) [sl_dfilter $sl_pbanhost($chan)] set blist "" if {$sl_jbanhost($chan) != "" && $sl_pbanhost($chan) != ""} { foreach bhost $sl_jbanhost($chan) { if {[lsearch -exact $sl_pbanhost($chan) $bhost] != -1} { lappend blist $bhost } } } set allbans [sl_dfilter [concat $sl_ccbanhost($chan) $sl_avbanhost($chan) $sl_nkbanhost($chan) $sl_bobanhost($chan) $blist]] if {$sl_wideban} { sl_ban $chan [sl_dcheck $allbans] "MULTIPLE IDENT/HOST flooders" } sl_ban $chan $sl_ccbanhost($chan) "CTCP flooder" ; set sl_ccbanhost($chan) "" sl_ban $chan $sl_avbanhost($chan) "AVALANCHE/TSUNAMI flooder" ; set sl_avbanhost($chan) "" sl_ban $chan $sl_nkbanhost($chan) "NICK flooder" ; set sl_nkbanhost($chan) "" sl_ban $chan $sl_bobanhost($chan) "BOGUS username" ; set sl_bobanhost($chan) "" sl_ban $chan $blist "JOIN-PART flooder" set sl_jbanhost($chan) "" ; set sl_pbanhost($chan) "" if {$sl_shortlock && $sl_kflooders <= 2 && [llength $allbans] <= 2 && [expr [unixtime] - $sl_unlocked($chan)] > 120} { sl_killutimer "sl_unlock $chan *" utimer 10 [list sl_unlock $chan mi] } return 0 } proc sl_dfilter {list} { set newlist "" foreach item $list { if {[lsearch -exact $newlist $item] == -1} { lappend newlist $item } } return $newlist } proc sl_dcheck {bhosts} { set blist "" foreach bhost $bhosts { set baddr [lindex [split [maskhost $bhost] "@"] 1] set bident [string trimleft [lindex [split $bhost "@"] 0] "~"] if {![info exists baddrs($baddr)]} { set baddrs($baddr) 1 } else { incr baddrs($baddr) } if {![info exists bidents($bident)]} { set bidents($bident) 1 } else { incr bidents($bident) } } foreach baddr [array names baddrs] { if {$baddrs($baddr) >= 2} { lappend blist *!*@$baddr } } foreach bident [array names bidents] { if {$bidents($bident) >= 2} { lappend blist *!*$bident@* } } return $blist } proc sl_ban {chan blist reason} { global sl_ban sl_banmax sl_globalban if {$blist != ""} { if {$sl_globalban} { foreach bhost $blist { if {![string match *!* $bhost]} { if {[matchban *!$bhost]} {continue} set bhost [sl_masktype $bhost] if {[isban $bhost]} {continue} } else { if {[isban $bhost]} {continue} foreach ban [banlist] { if {[lindex $ban 5] == "sentinel" && [string match $bhost [string tolower [lindex $ban 0]]]} { killban $ban } } } if {[llength [banlist]] >= $sl_banmax} {continue} newban $bhost sentinel $reason $sl_ban putlog "sentinel: banned $bhost ($reason)" sl_ignore $bhost * $reason } } else { foreach bhost $blist { if {![string match *!* $bhost]} { if {[matchban *!$bhost $chan]} {continue} set bhost [sl_masktype $bhost] if {[isban $bhost $chan]} {continue} } else { if {[isban $bhost $chan]} {continue} foreach ban [banlist $chan] { if {[lindex $ban 5] == "sentinel" && [string match $bhost [string tolower [lindex $ban 0]]]} { killchanban $chan $ban } } } if {[llength [banlist $chan]] >= $sl_banmax} {continue} newchanban $chan $bhost sentinel $reason $sl_ban putlog "sentinel: banned $bhost on $chan ($reason)" sl_ignore $bhost * $reason } } } return 0 } proc sl_ignore {ihost hand flood} { global sl_igtime if {$hand != "*"} { foreach chan [channels] { if {[matchattr $hand f|f $chan]} {return 0} } } if {![string match *!* $ihost]} { foreach ignore [ignorelist] { if {[string match [string tolower [lindex $ignore 0]] $ihost]} { return 0 } } set ihost [sl_masktype $ihost] if {[isignore $ihost]} {return 0} } else { if {[isignore $ihost]} {return 0} foreach ignore [ignorelist] { if {[lindex $ignore 4] == "sentinel" && [string match $ihost [string tolower [lindex $ignore 0]]]} { killignore $ignore } } } newignore $ihost sentinel $flood $sl_igtime putlog "sentinel: added $ihost to ignore list ($flood)" return 1 } # queuereset procs allow all queue timers to be killed easily proc sl_ccqueuereset {chan} { global sl_ccqueue incr sl_ccqueue($chan) -1 return 0 } proc sl_bcqueuereset {} { global sl_bcqueue incr sl_bcqueue -1 return 0 } proc sl_bmqueuereset {} { global sl_bmqueue incr sl_bmqueue -1 return 0 } proc sl_avqueuereset {chan} { global sl_avqueue incr sl_avqueue($chan) -1 return 0 } proc sl_txqueuereset {} { global sl_txqueue sl_txflood foreach chan [string tolower [channels]] { if {[info exists sl_txqueue($chan)]} { set sl_txqueue($chan) 0 } } utimer [lindex $sl_txflood 1] sl_txqueuereset return 0 } proc sl_nkqueuereset {chan} { global sl_nkqueue incr sl_nkqueue($chan) -1 return 0 } proc sl_boqueuereset {chan} { global sl_boqueue incr sl_boqueue($chan) -1 return 0 } proc sl_jqueuereset {chan} { global sl_jqueue incr sl_jqueue($chan) -1 return 0 } proc sl_pqueuereset {chan} { global sl_pqueue incr sl_pqueue($chan) -1 return 0 } proc sl_ccbanqueue {chan} { global sl_ccbanhost sl_ccbannick set sl_ccbannick($chan) [lrange sl_ccbannick($chan) 1 end] ; set sl_ccbanhost($chan) [lrange sl_ccbanhost($chan) 1 end] return 0 } proc sl_avbanqueue {chan} { global sl_avbanhost sl_avbannick set sl_avbannick($chan) [lrange sl_avbannick($chan) 1 end] ; set sl_avbanhost($chan) [lrange sl_avbanhost($chan) 1 end] return 0 } proc sl_nkbanqueue {chan} { global sl_nkbanhost set sl_nkbanhost($chan) [lrange sl_nkbanhost($chan) 1 end] return 0 } proc sl_bobanqueue {chan} { global sl_bobanhost sl_bobannick set sl_bobannick($chan) [lrange sl_bobannick($chan) 1 end] ; set sl_bobanhost($chan) [lrange sl_bobanhost($chan) 1 end] return 0 } proc sl_jbanqueue {chan} { global sl_jbanhost sl_jbannick set sl_jbannick($chan) [lrange sl_jbannick($chan) 1 end] ; set sl_jbanhost($chan) [lrange sl_jbanhost($chan) 1 end] return 0 } proc sl_pbanqueue {chan} { global sl_pbanhost sl_pbannick set sl_pbannick($chan) [lrange sl_pbannick($chan) 1 end] ; set sl_pbanhost($chan) [lrange sl_pbanhost($chan) 1 end] return 0 } proc sl_flud {nick uhost hand type chan} { global sl_flooded set chan [string tolower $chan] if {[validchan $chan] && $sl_flooded($chan)} {return 1} return 0 } proc sl_lc {nick uhost hand chan arg} { global sl_lockcmds set chan [string tolower $chan] if {![botisop $chan]} {return 0} if {$sl_lockcmds == 2 && ![isop $nick $chan]} {return 0} sl_quicklock $chan putlog "sentinel: channel lock requested by $hand on $chan" return 0 } proc sl_uc {nick uhost hand chan arg} { global sl_lockcmds set chan [string tolower $chan] if {![botisop $chan]} {return 0} if {$sl_lockcmds == 2 && ![isop $nick $chan]} {return 0} putserv "MODE $chan -mi" putlog "sentinel: channel unlock requested by $hand on $chan" return 0 } proc sl_dcclc {hand idx arg} { global sl_lockflags putcmdlog "#$hand# lock $arg" set chan [lindex [split $arg] 0] if {$chan == "-all"} { if {![matchattr $hand $sl_lockflags]} { putidx $idx "You're not global +$sl_lockflags." ; return 0 } set locklist "" foreach chan [channels] { if {[botisop $chan]} { sl_quicklock $chan lappend locklist $chan } } putidx $idx "Locked [join $locklist ", "]" } else { if {$chan == ""} { set chan [lindex [console $idx] 0] } if {![validchan $chan]} { putidx $idx "No such channel." ; return 0 } elseif {![matchattr $hand $sl_lockflags|$sl_lockflags $chan]} { putidx $idx "You're not +$sl_lockflags on $chan." ; return 0 } elseif {![botonchan $chan]} { putidx $idx "I'm not on $chan" ; return 0 } elseif {![botisop $chan]} { putidx $idx "I'm not opped on $chan" ; return 0 } sl_quicklock $chan putidx $idx "Locked $chan" } return 0 } proc sl_dccuc {hand idx arg} { global sl_lockflags putcmdlog "#$hand# unlock $arg" set chan [lindex [split $arg] 0] if {$chan == "-all"} { if {![matchattr $hand $sl_lockflags]} { putidx $idx "You're not global +$sl_lockflags." ; return 0 } set locklist "" foreach chan [channels] { if {[botisop $chan]} { putserv "MODE $chan -mi" lappend locklist $chan } } putidx $idx "Unlocked [join $locklist ", "]" } else { if {$chan == ""} { set chan [lindex [console $idx] 0] } if {![validchan $chan]} { putidx $idx "No such channel." ; return 0 } elseif {![matchattr $hand $sl_lockflags|$sl_lockflags $chan]} { putidx $idx "You're not +$sl_lockflags on $chan." ; return 0 } elseif {![botonchan $chan]} { putidx $idx "I'm not on $chan" ; return 0 } elseif {![botisop $chan]} { putidx $idx "I'm not opped on $chan" ; return 0 } putserv "MODE $chan -mi" putidx $idx "Unlocked $chan" } return 0 } proc sl_quicklock {chan} { global numversion if {$numversion < 1050000} { putquick "MODE $chan +mi" } else { putquick "MODE $chan +mi" -next } } proc sl_dcc {hand idx arg} { global sl_avflood sl_ban sl_banmax sl_bcflood sl_boban sl_boflood sl_bmflood sl_bxsimul sl_bfmaxbans sl_ccflood sl_detectquits sl_globalban sl_igtime sl_jflood sl_kicks sl_lockcmds sl_lockflags sl_ilocktime sl_mlocktime sl_nkflood sl_note sl_shortlock sl_tsunami sl_txflood putcmdlog "#$hand# sentinel $arg" putidx $idx "This bot is protected by sentinel.tcl by slennox" putidx $idx "Current settings" if {[lsearch -exact $sl_bcflood 0] != -1} { putidx $idx "- Bot CTCP flood: Off" } else { putidx $idx "- Bot CTCP flood: [lindex $sl_bcflood 0] in [lindex $sl_bcflood 1] secs" } if {[lsearch -exact $sl_bmflood 0] != -1} { putidx $idx "- Bot MSG flood: Off" } else { putidx $idx "- Bot MSG flood: [lindex $sl_bmflood 0] in [lindex $sl_bmflood 1] secs" } if {[lsearch -exact $sl_ccflood 0] != -1} { putidx $idx "- Channel CTCP flood: Off" } else { putidx $idx "- Channel CTCP flood: [lindex $sl_ccflood 0] in [lindex $sl_ccflood 1] secs" } if {[lsearch -exact $sl_avflood 0] != -1} { putidx $idx "- Channel AVALANCHE flood: Off" } else { putidx $idx "- Channel AVALANCHE flood: [lindex $sl_avflood 0] in [lindex $sl_avflood 1] secs" } if {[lsearch -exact $sl_avflood 0] != -1 || !$sl_tsunami} { putidx $idx "- Channel TSUNAMI flood: Off" } else { putidx $idx "- Channel TSUNAMI flood: [lindex $sl_avflood 0] in [lindex $sl_avflood 1] secs ($sl_tsunami ctrl codes / line)" } if {[lsearch -exact $sl_txflood 0] != -1} { putidx $idx "- Channel TEXT flood: Off" } else { putidx $idx "- Channel TEXT flood: [lindex $sl_txflood 0] in [lindex $sl_txflood 1] secs" } if {[lsearch -exact $sl_boflood 0] != -1} { putidx $idx "- Channel BOGUS flood: Off" } else { putidx $idx "- Channel BOGUS flood: [lindex $sl_boflood 0] in [lindex $sl_boflood 1] secs" } if {$sl_detectquits} { set detectquits "quit detection ON" } else { set detectquits "quit detection OFF" } if {[lsearch -exact $sl_jflood 0] != -1} { putidx $idx "- Channel JOIN-PART flood: Off" } else { putidx $idx "- Channel JOIN-PART flood: [lindex $sl_jflood 0] in [lindex $sl_jflood 1] secs ($detectquits)" } if {[lsearch -exact $sl_nkflood 0] != -1} { putidx $idx "- Channel NICK flood: Off" } else { putidx $idx "- Channel NICK flood: [lindex $sl_nkflood 0] in [lindex $sl_nkflood 1] secs" } if {!$sl_ilocktime} { putidx $idx "- Channel +i locktime: Indefinite" } else { putidx $idx "- Channel +i locktime: $sl_ilocktime secs" } if {!$sl_mlocktime} { putidx $idx "- Channel +m locktime: Indefinite" } else { putidx $idx "- Channel +m locktime: $sl_mlocktime secs" } if {$sl_shortlock && $sl_ban} { putidx $idx "- Small flood short lock: Active" } else { putidx $idx "- Small flood short lock: Inactive" } if {$sl_ban && $sl_ban < 120} { putidx $idx "- Channel flood bans: $sl_ban mins" } elseif {$sl_ban >= 120} { putidx $idx "- Channel flood bans: [expr $sl_ban / 60] hrs" } else { putidx $idx "- Channel flood bans: Disabled" } if {!$sl_boban || [lsearch -exact $sl_boflood 0] != -1} { putidx $idx "- Bogus username bans: Disabled" } elseif {$sl_boban > 0 && $sl_boban < 120} { putidx $idx "- Bogus username bans: $sl_boban mins" } elseif {$sl_boban >= 120} { putidx $idx "- Bogus username bans: [expr $sl_boban / 60] hrs" } if {$sl_ban || [lsearch -exact $sl_boflood 0] == -1} { if {$sl_globalban} { putidx $idx "- Ban type: Global [sl_masktype nick@host.domain]" } else { putidx $idx "- Ban type: Channel-specific [sl_masktype nick@host.domain]" } } if {$sl_ban || [lsearch -exact $sl_boflood 0] == -1} { putidx $idx "- Maximum bans: $sl_banmax" } if {$sl_igtime > 0 && $sl_igtime < 120} { putidx $idx "- Flooder ignores: $sl_igtime mins" } elseif {$sl_igtime >= 120} { putidx $idx "- Flooder ignores: [expr $sl_igtime / 60] hrs" } else { putidx $idx "- Flooder ignores: Permanent" } if {$sl_ban} { putidx $idx "- Kicks per line: $sl_kicks" } if {!$sl_bfmaxbans} { putidx $idx "- Maximum channel bans: Disabled" } else { putidx $idx "- Maximum channel bans: $sl_bfmaxbans" } if {$sl_note != ""} { putidx $idx "- Flood notification: Notifying [join $sl_note ", "]" } else { putidx $idx "- Flood notification: Off" } if {!$sl_lockcmds} { putidx $idx "- Public lc/uc commands: Disabled" } elseif {$sl_lockcmds == 1} { putidx $idx "- Public lc/uc commands: Enabled (+$sl_lockflags users, ops not required)" } elseif {$sl_lockcmds == 2} { putidx $idx "- Public lc/uc commands: Enabled (+$sl_lockflags users, ops required)" } if {$sl_bxsimul} { putidx $idx "- BitchX simulation: On" } elseif {!$sl_bxsimul} { putidx $idx "- BitchX simulation: Off" } return 0 } if {$sl_bxsimul} { bind raw - 001 sl_bxserverjoin if {![info exists sl_bxonestack]} { set sl_bxonestack 0 } if {![info exists sl_bxversion]} { set sl_bxversion [lindex {75p1+ 75p3+} [rand 2]] } set sl_bxsystem "*IX" ; set sl_bxwhoami $username ; set sl_bxmachine "" catch {set sl_bxsystem [exec uname -s -r]} catch {set sl_bxwhoami [exec id -un]} catch {set sl_bxmachine [exec uname -n]} set sl_bxjointime [unixtime] proc sl_bxserverjoin {from keyword arg} { global sl_bxjointime sl_bxisaway set sl_bxjointime [unixtime] ; set sl_bxisaway 0 return 0 } proc sl_bxaway {} { global sl_bxjointime sl_bxisaway if {!$sl_bxisaway} { puthelp "AWAY :is away: (Auto-Away after 10 mins) \[\002BX\002-MsgLog [lindex {On Off} [rand 2]]\]" set sl_bxisaway 1 } else { puthelp "AWAY" set sl_bxisaway 0 ; set sl_bxjointime [unixtime] } if {![string match *sl_bxaway* [timers]]} { timer [expr [rand 300] + 10] sl_bxaway } return 0 } if {![info exists sl_bxisaway]} { set sl_bxisaway 0 } if {![string match *sl_bxaway* [timers]]} { timer [expr [rand 300] + 10] sl_bxaway } } proc sl_setarray {chan} { global sl_avbanhost sl_avbannick sl_avqueue sl_bfull sl_bobanhost sl_bobannick sl_boqueue sl_ccbanhost sl_ccbannick sl_ccqueue sl_flooded sl_jbanhost sl_jbannick sl_jqueue sl_locked sl_nkbanhost sl_nkflooding sl_nkqueue sl_pbanhost sl_pbannick sl_pqueue sl_txqueue sl_unlocked set chan [string tolower $chan] sl_killutimer "incr sl_*queue($chan) -1" sl_killutimer "sl_*banqueue $chan" sl_killutimer "sl_*queuereset $chan" set sl_flooded($chan) 0 ; set sl_locked($chan) 0 ; set sl_unlocked($chan) [unixtime] set sl_nkflooding($chan) [unixtime] set sl_ccqueue($chan) 0 ; set sl_ccbanhost($chan) "" ; set sl_ccbannick($chan) "" set sl_avqueue($chan) 0 ; set sl_avbanhost($chan) "" ; set sl_avbannick($chan) "" set sl_txqueue($chan) 0 set sl_nkqueue($chan) 0 ; set sl_nkbanhost($chan) "" set sl_boqueue($chan) 0 ; set sl_bobanhost($chan) "" ; set sl_bobannick($chan) "" set sl_jqueue($chan) 0 ; set sl_jbanhost($chan) "" ; set sl_jbannick($chan) "" set sl_pqueue($chan) 0 ; set sl_pbanhost($chan) "" ; set sl_pbannick($chan) "" set sl_bfull($chan) 0 return 0 } proc sl_unsetarray {chan} { global sl_avbanhost sl_avbannick sl_avqueue sl_bfull sl_bobanhost sl_bobannick sl_boqueue sl_ccbanhost sl_ccbannick sl_ccqueue sl_flooded sl_jbanhost sl_jbannick sl_jqueue sl_locked sl_nkbanhost sl_nkflooding sl_nkqueue sl_pbanhost sl_pbannick sl_pqueue sl_txqueue sl_unlocked set chan [string tolower $chan] if {![validchan $chan] && [info exists sl_flooded($chan)]} { unset sl_flooded($chan) sl_locked($chan) sl_unlocked($chan) sl_nkflooding($chan) sl_ccqueue($chan) sl_ccbanhost($chan) sl_ccbannick($chan) sl_avqueue($chan) sl_avbanhost($chan) sl_avbannick($chan) sl_txqueue($chan) sl_nkqueue($chan) sl_nkbanhost($chan) sl_boqueue($chan) sl_bobanhost($chan) sl_bobannick($chan) sl_jqueue($chan) sl_jbanhost($chan) sl_jbannick($chan) sl_pqueue($chan) sl_pbanhost($chan) sl_pbannick($chan) sl_bfull($chan) } return 0 } proc sl_settimer {} { foreach chan [channels] { sl_setarray $chan } return 0 } proc sl_killutimer {cmd} { set n 0 regsub -all -- {\[} $cmd {\[} cmd ; regsub -all -- {\]} $cmd {\]} cmd foreach tmr [utimers] { if {[string match $cmd [join [lindex $tmr 1]]]} { killutimer [lindex $tmr 2] incr n } } return $n } proc sl_masktype {uhost} { global sl_masktype switch -exact -- $sl_masktype { 0 {return *!*[string range $uhost [string first @ $uhost] end]} 1 {return *!*$uhost} 2 {return *!*[lindex [split [maskhost $uhost] "!"] 1]} } return } if {![info exists sl_unlocked] && ![string match *sl_settimer* [utimers]]} { utimer 3 sl_settimer } if {![info exists sl_bflooded]} { set sl_bflooded 0 } if {![info exists sl_bcqueue]} { set sl_bcqueue 0 } if {![info exists sl_bmqueue]} { set sl_bmqueue 0 } if {![info exists sl_nickkick]} { set sl_nickkick 0 } set sl_bcflood [split $sl_bcflood :] ; set sl_bmflood [split $sl_bmflood :] set sl_ccflood [split $sl_ccflood :] ; set sl_avflood [split $sl_avflood :] set sl_txflood [split $sl_txflood :] ; set sl_boflood [split $sl_boflood :] set sl_jflood [split $sl_jflood :] ; set sl_nkflood [split $sl_nkflood :] set sl_note [split $sl_note] if {$sl_ilocktime > 0 && $sl_ilocktime < 30} { set sl_ilocktime 30 } if {$sl_mlocktime > 0 && $sl_mlocktime < 30} { set sl_mlocktime 30 } set trigger-on-ignore 0 if {!${kick-method}} { set sl_kicks 8 } else { set sl_kicks ${kick-method} } if {$numversion <= 1040400} { if {$numversion >= 1032100} { set kick-bogus 0 } if {$numversion >= 1032400} { set ban-bogus 0 } } if {$numversion >= 1032400} { set kick-fun 0 ; set ban-fun 0 } if {$numversion >= 1032500} { set ctcp-mode 0 } if {![string match *sl_txqueuereset* [utimers]] && [lsearch -exact $sl_txflood 0] == -1} { utimer [lindex $sl_txflood 1] sl_txqueuereset } bind pub $sl_lockflags|$sl_lockflags lc sl_lc bind pub $sl_lockflags|$sl_lockflags uc sl_uc bind dcc $sl_lockflags|$sl_lockflags lock sl_dcclc bind dcc $sl_lockflags|$sl_lockflags unlock sl_dccuc if {!$sl_lockcmds} { unbind pub $sl_lockflags|$sl_lockflags lc sl_lc unbind pub $sl_lockflags|$sl_lockflags uc sl_uc rename sl_lc "" rename sl_uc "" } bind dcc m|m sentinel sl_dcc bind raw - NOTICE sl_avflood bind raw - PRIVMSG sl_avflood if {[lsearch -exact $sl_avflood 0] != -1 && [lsearch -exact $sl_txflood 0] != -1} { unbind raw - NOTICE sl_avflood unbind raw - PRIVMSG sl_avflood rename sl_avflood "" } bind ctcp - CLIENTINFO sl_ctcp bind ctcp - USERINFO sl_ctcp bind ctcp - VERSION sl_ctcp bind ctcp - FINGER sl_ctcp bind ctcp - ERRMSG sl_ctcp bind ctcp - ECHO sl_ctcp bind ctcp - INVITE sl_ctcp bind ctcp - WHOAMI sl_ctcp bind ctcp - OP sl_ctcp bind ctcp - OPS sl_ctcp bind ctcp - UNBAN sl_ctcp bind ctcp - PING sl_ctcp bind ctcp - TIME sl_ctcp bind msgm - * sl_bmflood if {[lsearch -exact $sl_bmflood 0] != -1} { unbind msgm - * sl_bmflood rename sl_bmflood "" } bind nick - * sl_nkflood if {[lsearch -exact $sl_nkflood 0] != -1} { unbind nick - * sl_nkflood rename sl_nkflood "" } bind join - * sl_jflood bind part - * sl_pflood bind sign - * sl_pflood if {![info exists sl_detectquits]} { set sl_detectquits 0 } if {!$sl_detectquits} { unbind sign - * sl_pflood } bind kick - * sl_pfloodk bind flud - * sl_flud bind mode - * sl_mode putlog "Loaded sentinel.tcl v2.70 by slennox" return eggdrop1.6.19/scripts/userinfo.tcl0000664000076400007640000002321007374660223016322 0ustar guppyguppy# userinfo.tcl v1.06 for Eggdrop 1.4.3 and higher # Scott G. Taylor -- ButchBub!staylor@mrynet.com # # $Id: userinfo.tcl,v 1.5 2001-11-15 06:28:35 guppy Exp $ # # v1.00 ButchBub 14 July 1997 -Original release. Based on # whois.tcl "URL" commands. # v1.01 Beldin 11 November 1997 -1.3 only version # v1.02 Kirk 19 June 1998 -extremely small fixes # v1.03 guppy 17 March 1999 -small fixes again # v1.04 Ernst 15 June 1999 -fix for egg 1.3.x + TCL 8.0 # v1.05 Dude 14 July 1999 -small cosmetic/typo fixes # -$lastbind bug work around fix # -added userinfo_loaded var # -fixed bug in dcc_chuserinfo proc # -unbinds removed user fields # -dcc .showfields command added # -deletes removed userinfo fields # from the whois-fields list. # v1.06 guppy 19 March 2000 -removed lastbind workaround since # lastbind is fixed in eggdrop1.4.3 # v1.07 TaKeDa 20 August 2001 -now script works also on bots, # which didn't have server module loaded # -added new fields PHONE & ICQ # # TO USE: o Set the desired userinfo field keywords to the # `userinfo-fields' line below where indicated. # o Load this script on a 1.1.6 or later Eggdrop bot. # o Begin having users save the desired information. If you # choose to add the default "IRL" field, they just use # the IRC command: /MSG irl Joe Blow. # o See the new information now appear with the whois command. # # This script enhances the `whois' output utilizing the `whois-fields' # option of eggdrop 1.1-grant and later versions. It adds the functionality # of whois.tcl used in pre-1.1-grant versions. # # The fields desired to be maintained in the userfile `xtra' information # should be put in `userinfo-fields'. This is different than the Eggdrop # configuration variable `whois-fields' in that this script will add the # commands to change these fields. It will also add these desired fields # to the `whois-fields' itself, so do not define them there as well. The # fields added in `userinfo-fields' will be converted to upper case for # aesthetics in the `whois' command output. # # The commands that will be added to the running eggdrop are: # ( will be the respective userfile field added in `userinfo-fields') # # TYPE COMMAND USAGE # ====== ============== ======================================== # msg To change your via /MSG. # dcc . To change your via DCC. # dcc .ch To change someone else's via DCC. # # Currently supported fields and commands: # # FIELD USAGE # ===== ===================== # URL WWW page URL # IRL In Real Life name # BF Boyfriend # GF Girlfriend # DOB Birthday (Date Of Birth) # EMAIL Email address # PHONE Phone number # ICQ ICQ number ################################ # Set your desired fields here # ################################ set userinfo-fields "URL BF GF IRL EMAIL DOB PHONE ICQ" # This script's identification set userinfover "Userinfo TCL v1.07" # This script is NOT for pre-1.4.3 versions. catch { set numversion } if {![info exists numversion] || ($numversion < 1040300)} { putlog "*** Can't load $userinfover -- At least Eggdrop v1.4.3 required" return 0 } # Make sure we don't bail because whois and/or userinfo-fields aren't set. if { ![info exists whois-fields]} { set whois-fields "" } if { ![info exists userinfo-fields]} { set userinfo-fields "" } # Add only the userinfo-fields not already in the whois-fields list. foreach field [string tolower ${userinfo-fields}] { if { [lsearch -exact [string tolower ${whois-fields}] $field] == -1 } { append whois-fields " " [string toupper $field] } } # If olduserinfo-fields doesn't exist, create it. if { ![info exists olduserinfo-fields] } { set olduserinfo-fields ${userinfo-fields} } # Delete only the userinfo-fields that have been removed but are still # listed in the whois-fields list. foreach field [string tolower ${olduserinfo-fields}] { if { [lsearch -exact [string tolower ${whois-fields}] $field] >= 0 && [lsearch -exact [string tolower ${userinfo-fields}] $field] == -1 } { set fieldtmp [lsearch -exact [string tolower ${whois-fields}] $field] set whois-fields [lreplace ${whois-fields} $fieldtmp $fieldtmp] } } # If olduserinfo-fields don't equal userinfo-fields, lets run through the # old list of user fields and compare them with the current list. this way # any fields that have been removed that were originally in the list will # have their msg/dcc commands unbinded so you don't have to do a restart. if {[info commands putserv] == ""} { set isservermod 0 } else { set isservermod 1 } if { [string tolower ${olduserinfo-fields}] != [string tolower ${userinfo-fields}] } { foreach field [string tolower ${olduserinfo-fields}] { if { [lsearch -exact [string tolower ${userinfo-fields}] $field] == -1 } { if $isservermod {unbind msg - $field msg_setuserinfo} unbind dcc - $field dcc_setuserinfo unbind dcc m ch$field dcc_chuserinfo } } set olduserinfo-fields ${userinfo-fields} } # Run through the list of user info fields and bind their commands if { ${userinfo-fields} != "" } { foreach field [string tolower ${userinfo-fields}] { if $isservermod {bind msg - $field msg_setuserinfo} bind dcc - $field dcc_setuserinfo bind dcc m ch$field dcc_chuserinfo } } # This is the `/msg ' procedure if $isservermod { proc msg_setuserinfo {nick uhost hand arg} { global lastbind quiet-reject userinfo-fields set userinfo [string toupper $lastbind] set arg [cleanarg $arg] set ignore 1 foreach channel [channels] { if {[onchan $nick $channel]} { set ignore 0 } } if {$ignore} { return 0 } if {$hand != "*"} { if {$arg != ""} { if {[string tolower $arg] == "none"} { putserv "NOTICE $nick :Removed your $userinfo line." setuser $hand XTRA $userinfo "" } { putserv "NOTICE $nick :Now: $arg" setuser $hand XTRA $userinfo "[string range $arg 0 159]" } } { if {[getuser $hand XTRA $userinfo] == ""} { putserv "NOTICE $nick :You have no $userinfo set." } { putserv "NOTICE $nick :Currently: [getuser $hand XTRA $userinfo]" } } } else { if {${quiet-reject} != 1} { putserv "NOTICE $nick :You must be a registered user to use this feature." } } putcmdlog "($nick!$uhost) !$hand! $userinfo $arg" return 0 } #checking for server module } # This is the dcc '.' procedure. proc dcc_setuserinfo {hand idx arg} { global lastbind userinfo-fields set userinfo [string toupper $lastbind] set arg [cleanarg $arg] if {$arg != ""} { if {[string tolower $arg] == "none"} { putdcc $idx "Removed your $userinfo line." setuser $hand XTRA $userinfo "" } { putdcc $idx "Now: $arg" setuser $hand XTRA $userinfo "[string range $arg 0 159]" } } { if {[getuser $hand XTRA $userinfo] == ""} { putdcc $idx "You have no $userinfo set." } { putdcc $idx "Currently: [getuser $hand XTRA $userinfo]" } } putcmdlog "#$hand# [string tolower $userinfo] $arg" return 0 } # This is the DCC `.ch' procedure proc dcc_chuserinfo {hand idx arg} { global lastbind userinfo-fields set userinfo [string toupper [string range $lastbind 2 end]] set arg [cleanarg $arg] if { $arg == "" } { putdcc $idx "syntax: .ch[string tolower $userinfo] \[<[string tolower $userinfo]>|NONE\]" return 0 } set who [lindex [split $arg] 0] if {![validuser $who]} { putdcc $idx "$who is not a valid user." return 0 } if {[llength [split $arg]] == 1} { set info "" } { set info [lrange [split $arg] 1 end] } if {$info != ""} { if {[string tolower $info] == "none"} { putdcc $idx "Removed $who's $userinfo line." setuser $who XTRA $userinfo "" putcmdlog "$userinfo for $who removed by $hand" } { putdcc $idx "Now: $info" setuser $who XTRA $userinfo "$info" putcmdlog "$userinfo for $who set to \"$info\" by $hand" } } { if {[getuser $who XTRA $userinfo] == ""} { putdcc $idx "$who has no $userinfo set." } { putdcc $idx "Currently: [getuser $who XTRA $userinfo]" } } return 0 } bind dcc m showfields showfields proc showfields {hand idx arg} { global userinfo-fields if { ${userinfo-fields} == "" } { putdcc $idx "Their is no user info fields set." return 0 } putdcc $idx "Currently: [string toupper ${userinfo-fields}]" putcmdlog "#$hand# showfields" return 0 } proc cleanarg {arg} { set response "" for {set i 0} {$i < [string length $arg]} {incr i} { set char [string index $arg $i] if {($char != "\12") && ($char != "\15")} { append response $char } } return $response } # Set userinfo_loaded variable to indicate that the script was successfully # loaded. this can be used in scripts that make use of the userinfo tcl. set userinfo_loaded 1 # Announce that we've loaded the script. putlog "$userinfover loaded (${userinfo-fields})." putlog "use '.help userinfo' for commands." eggdrop1.6.19/scripts/quotepass.tcl0000664000076400007640000000203510753731331016510 0ustar guppyguppy# # quotepass.tcl # written by simple, [sL], and guppy # # Some servers on the Undernet will make you send 'PASS ' before you # can connect if you did not return an identd response. This script will # handle sending that for you. # # updates # ------- # 10Feb08: initial version # # $Id: quotepass.tcl,v 1.3 2008-02-11 02:28:41 guppy Exp $ set quotepass_resyntax "must type /QUOTE PASS (\[^\" \]*)" bind evnt - init-server quotepass_unbind bind evnt - disconnect-server quotepass_unbind bind evnt - connect-server quotepass_bind proc quotepass_notice {from cmd text} { global quotepass_resyntax if {[regexp -nocase $quotepass_resyntax $text - pass]} { putlog "Got a QUOTE PASS request from the server, sending \"PASS $pass\"" putserv "PASS $pass" } return 0 } proc quotepass_unbind {type} { # Try to unbind our raw NOTICE bind once we are connected since it will # never be needed again catch { unbind raw - NOTICE quotepass_notice } } proc quotepass_bind {type} { bind raw - NOTICE quotepass_notice } eggdrop1.6.19/scripts/getops.tcl0000664000076400007640000002474307640171022015773 0ustar guppyguppy # Getops 2.3b # $Id: getops.tcl,v 1.18 2003-03-26 00:19:30 wcc Exp $ # This script is used for bots to request and give ops to each other. # For this to work, you'll need: # - Bots must be linked in a botnet # - Every bot that should be ops on your channels must load this script # - Add all bots you wanna op with this one using the .+bot nick address # command. The "nick" should be exactly the botnet-nick of the other bot # - Add the hostmasks that uniquely identify this bot on IRC # - Add a global or channel +o flag on all bots to be opped # - Do exactly the same on all other bots # The security of this relies on the fact that the bot which wants to have # ops must be 1) linked to the current botnet (which requires a password), # 2) have an entry with +o on the bot that he wants ops from and 3) must match # the hostmask that is stored on each bots userfile (so it is good to keep the # hostmasks up-to-date). # ----------------------------------------------------------------------------- # 2.3c by PPSlim # - Small fix on timer hanlding. # Not list formatted, allowing command parsing of channel name # 2.3b by gregul # - small fix in getbot # 2.3a by guppy # - fix for bind need # 2.3 by guppy # - minor cleanup to use some 1.6 tcl functions # - use bind need over need-op, need-invite, etc ... # 2.2g by poptix # - Fabian's 2.2e broke the script, fixed. # 2.2f by Eule # - removed key work-around added in 2.2d as eggdrop now handles this # correctly. # 2.2e by Fabian # - added support for !channels (so-called ID-channels), using chandname2name # functions. This makes it eggdrop 1.5+ specific. # 2.2d by brainsick # - Undernet now handles keys differently. It no longer gives the key on a # join, but instead gives it on an op, but eggdrop doesn't check for this. # getops-2.2d should now handle this correctly. (This should be the final # fix to the key problems.) # 2.2c by Progfou (Jean Christophe ANDRE ) # - changed "Requested" to "Requesting" as it was a little confusing # - corrected the "I am not on chan..." problem with key request # (thanks to Kram |FL| and Gael for reporting it) # - removed more unnecessary check # 2.2b by Progfou (Jean Christophe ANDRE ) # - removed global +o in unknown bot test # - removed unnecessary checks due to previous unknown bot test # 2.2a by Progfou (Jean Christophe ANDRE ) # - removed Polish language! # 2.2 by Cron (Arkadiusz Miskiewicz ) # - works good (tested on eggdrop 1.3.11) # - asks from unknown (and bots without +bo) are ignored # - all messages in Polish language # - better response from script to users # - fixed several bugs # 2.1 by Ernst # - asks for ops right after joining the channel: no wait anymore # - sets "need-op/need-invite/etc" config right after joining dynamic channels # - fixed "You aren't +o" being replied when other bot isn't even on channel # - better response from bots, in case something went wrong # (for example if bot is not recognized (hostmask) when asking for ops) # - removed several no-more-used variables # - added the information and description above # 2.0.1 by beldin (1.3.x ONLY version) # - actually, iso needed to be modded for 1.3 :P, and validchan is builtin # and I'll tidy a couple of functions up to # 2.0 by DarkDruid # - It'll work with dynamic channels(dan is a dork for making it not..) # - It will also only ask one bot at a time for ops so there won't be any more # annoying mode floods, and it's more secure that way # - I also took that annoying wallop and resynch stuff out :P # - And I guess this will with with 1.3.x too # Previously by The_O, dtM. # Original incarnation by poptix (poptix@poptix.net) # ----------------------------------------------------------------------------- # [0/1] do you want GetOps to notice when some unknown (unauthorized) bot # sends request to your bot set go_bot_unknown 1 # [0/1] do you want your bot to request to be unbanned if it becomes banned? set go_bot_unban 1 # [0/1] do you want GetOps to notice the channel if there are no ops? set go_cycle 0 # set this to the notice txt for the above (go_cycle) set go_cycle_msg "Please part the channel so the bots can cycle!" # ----------------------------------------------------------------------------- set bns "" proc gain_entrance {what chan} { global botnick botname go_bot_unban go_cycle go_cycle_msg bns switch -exact $what { "limit" { foreach bs [lbots] { putbot $bs "gop limit $chan $botnick" putlog "GetOps: Requesting limit raise from $bs on $chan." } } "invite" { foreach bs [lbots] { putbot $bs "gop invite $chan $botnick" putlog "GetOps: Requesting invite from $bs for $chan." } } "unban" { if {$go_bot_unban} { foreach bs [lbots] { putbot $bs "gop unban $chan $botname" putlog "GetOps: Requesting unban on $chan from $bs." } } } "key" { foreach bs [lbots] { putbot $bs "gop key $chan $botnick" putlog "GetOps: Requesting key on $chan from $bs." } } "op" { if {[hasops $chan]} { set bot [getbot $chan] if {$bot == ""} { set bns "" set bot [getbot $chan] } lappend bns "$bot" if {$bot != ""} { putbot $bot "gop op $chan $botnick" putlog "GetOps: Requesting ops from $bot on $chan" } } { if {$go_cycle} { putserv "NOTICE [chandname2name $chan] :$go_cycle_msg" } } } } } proc hasops {chan} { foreach user [chanlist $chan] { if {[isop $user $chan]} { return 1 } } return 0 } proc getbot {chan} { global bns foreach bn [bots] { if {[lsearch $bns $bn] < 0} { if {[matchattr $bn o|o $chan]} { set nick [hand2nick $bn $chan] if {[onchan $nick $chan] && [isop $nick $chan]} { return $bn break } } } } } proc botnet_request {bot com args} { global go_bot_unban go_bot_unknown set args [lindex $args 0] set subcom [lindex $args 0] set chan [string tolower [lindex $args 1]] if {![validchan $chan]} { putbot $bot "gop_resp I don't monitor $chan." return 0 } # Please note, 'chandname2name' will cause an error if it is not a valid channel # Thus, we make sure $chan is a valid channel -before- using it. -poptix set idchan [chandname2name $chan] set nick [lindex $args 2] if {$subcom != "takekey" && ![botonchan $chan]} { putbot $bot "gop_resp I am not on $chan." return 0 } if {![matchattr $bot b]} { if { $go_bot_unknown == 1} { putlog "GetOps: Request ($subcom) from $bot - unknown bot (IGNORED)" } return 0 } switch -exact $subcom { "op" { if {![onchan $nick $chan]} { putbot $bot "gop_resp You are not on $chan for me." return 1 } set bothand [finduser $nick![getchanhost $nick $chan]] if {$bothand == "*"} { putlog "GetOps: $bot requested ops on $chan. Ident not recognized: $nick![getchanhost $nick $chan]." putbot $bot "gop_resp I don't recognize you on IRC (your ident: $nick![getchanhost $nick $chan])" return 1 } if {[string tolower $bothand] == [string tolower $nick]} { putlog "GetOps: $bot requested ops on $chan." } { putlog "GetOps: $bot requested ops as $nick on $chan." } if {[iso $nick $chan] && [matchattr $bothand b]} { if {[botisop $chan]} { if {![isop $nick $chan]} { putlog "GetOps: $nick asked for op on $chan." putbot $bot "gop_resp Opped $nick on $chan." pushmode $chan +o $nick } } { putbot $bot "gop_resp I am not +o on $chan." } } { putbot $bot "gop_resp You aren't +o in my userlist for $chan, sorry." } return 1 } "unban" { if {$go_bot_unban} { putlog "GetOps: $bot requested that I unban him on $chan." foreach ban [chanbans $chan] { if {[string compare $nick $ban]} { set bug_1 [lindex $ban 0] pushmode $chan -b $bug_1 } } return 1 } { putlog "GetOps: Refused request to unban $bot ($nick) on $chan." putbot $bot "gop_resp Sorry, not accepting unban requests." } } "invite" { putlog "GetOps: $bot asked for an invite to $chan." putserv "invite $nick $idchan" return 1 } "limit" { putlog "GetOps: $bot asked for a limit raise on $chan." pushmode $chan +l [expr [llength [chanlist $chan]] + 1] return 1 } "key" { putlog "GetOps: $bot requested the key on $chan." if {[string match *k* [lindex [getchanmode $chan] 0]]} { putbot $bot "gop takekey $chan [lindex [getchanmode $chan] 1]" } { putbot $bot "gop_resp There isn't a key on $chan!" } return 1 } "takekey" { putlog "GetOps: $bot gave me the key to $chan! ($nick)" foreach channel [string tolower [channels]] { if {$chan == $channel} { if {$idchan != ""} { putserv "JOIN $idchan $nick" } else { putserv "JOIN $channel $nick" } return 1 } } } default { putlog "GetOps: ALERT! $bot sent fake 'gop' message! ($subcom)" } } } proc gop_resp {bot com msg} { putlog "GetOps: MSG from $bot: $msg" return 1 } proc lbots {} { set unf "" foreach users [userlist b] { foreach bs [bots] { if {$users == $bs} { lappend unf $users } } } return $unf } # Returns list of bots in the botnet and +o in my userfile on that channel proc lobots { channel } { set unf "" foreach users [userlist b] { if {![matchattr $users o|o $channel]} { continue } foreach bs [bots] { if {$users == $bs} { lappend unf $users } } } return $unf } proc iso {nick chan} { return [matchattr [nick2hand $nick $chan] o|o $chan] } proc gop_need {chan type} { # Use bind need over setting need-op, need-invite, etc ... gain_entrance $type $chan } bind need - * gop_need bind bot - gop botnet_request bind bot - gop_resp gop_resp bind join - * gop_join proc requestop { chan } { global botnick set chan [string tolower $chan] foreach thisbot [lobots $chan] { # Send request to all, because the bot does not have the channel info yet putbot $thisbot "gop op $chan $botnick" lappend askedbot $thisbot } if {[info exist askedbot]} { regsub -all " " $askedbot ", " askedbot putlog "GetOps: Requested Ops from $askedbot on $chan." } { putlog "GetOps: No bots to ask for ops on $chan." } return 0 } proc gop_join { nick uhost hand chan } { if {[isbotnick $nick]} { utimer 3 [list requestop $chan] } return 0 } set getops_loaded 1 putlog "GetOps v2.3c loaded." eggdrop1.6.19/scripts/ques5.tcl0000664000076400007640000003172510755654156015551 0ustar guppyguppy# # ques5.tcl # # Copyright (C) 1995 - 1997 Robey Pointer # Copyright (C) 1999 - 2008 Eggheads Development Team # # v1 -- 20aug95 # v2 -- 2oct95 [improved it] # v3 -- 17mar96 [fixed it up for 1.0 multi-channel] # v4 -- 3nov97 [Fixed it up for 1.3.0 version bots] by TG # v4.00001 nov97 [blurgh] # v5-BETA1 -- 26sep99 by rtc # # $Id: ques5.tcl,v 1.16 2008-02-16 21:41:02 guppy Exp $ # # o clean webfile var removal # o using timezone variable from config file # o unified options and removed unnecessary ones. # o convert urls, nicks etc. to HTML before we put them into the page. # o nice html source indenting # o replace the old file after the new one has completely written to # disk # o the description still contained robey's address, replaced # by the eggheads email. # o don't link any spaces in the HTML2.0 file # v5-RC1 -- 29sep99 by rtc # o info line wasn't converted to HTML. # o now supports bold, italic and underline text style and colors. # v5-FINAL -- 04oct99 by rtc # o style converter now strictly follows HTML standard. # o Fake color attributes with number > 2^32 don't cause Tcl # error anymore. # o now uses strftime as time and date functions have both been removed # in 1.3.29 # this will create an html file every so often (the default is once every # 5 minutes). the html file will have a table showing the people currently # on the channel, their user@hosts, who's an op, and who's idle. it # uses a table which some browsers (and pseudo-browsers like lynx) can't # see, but it can optionally make a second page which will support these # archaic browsers. browsers supporting push-pull will receive the updated # page automatically periodically. # # if you have a "url" field defined for a user, their nickname in the # table will be a link pointing there. otherwise it checks the info # line and comment field to see if they start with "http://" -- if so, # that link will be used. as a last resort, it will make a "mailto:" # link if an email address is recorded for the user. # # feel free to modify and play with this. the original was written in # 15 minutes, then at various times i fixed bugs and added features. # softlord helped me make the design look a little nicer. :) if you make # any nifty improvements, please let us know. # eggheads@eggheads.org # this line makes sure other scripts won't interfere if {[info exists web_file] || [array exists web_file]} {unset web_file} # You must define each channel you want a webfile for . # If you want a HTML2.0 file, too, put it's filename separated by # a colon to the same option, it goes to the same directory. #set web_file(#turtle) "/home/lamest/public_html/turtle.html:turtle-lynx.html" # This example demonstrates how to put lynx files into another dir. #set web_file(#gloom) "/home/lamest/public_html/gloom.html:lynx/gloom.html" # You can also prevent the HTML2.0 file from being written. #set web_file(#channel) "/home/lamest/public_html/channel.html" # You can even let the bot write only a HTML2.0. #set web_file(#blah) "/home/lamest/public_html/:blah.html" # how often should these html files get updated? # (1 means once every minute, 5 means once every 5 minutes, etc) set web_update 5 # Which characters should be allowed in URLs? # DO NOT MODIFY unless you really know what you are doing. # Especially never add '<', '"' and '>' set web_urlchars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 :+-/!\$%&()=[]{}#^~*.:,;\\|?_@" # IRC -> HTML color translation table set web_color(0) "#FFFFFF" set web_color(1) "#000000" set web_color(2) "#00007F" set web_color(3) "#008F00" set web_color(4) "#FF0000" set web_color(5) "#7F0000" set web_color(6) "#9F009F" set web_color(7) "#FF7F00" set web_color(8) "#F0FF00" set web_color(9) "#00F700" set web_color(10) "#008F8F" set web_color(11) "#00F7FF" set web_color(12) "#0000FF" set web_color(13) "#FF00FF" set web_color(14) "#7F7F7F" set web_color(15) "#CFCFCF" # IRC -> HTML style translation table set web_style(\002) " " set web_style(\003) " " set web_style(\026) " " set web_style(\037) " " proc getnumber {string} { set result "" foreach char [split $string ""] { if {[string first $char "0123456789"] == -1} { return $result } else { append result $char } } return $result } proc webify {string} { # Tcl8.1 only: #return [string map {\" " & & < < > >} $string] # Otherwise use this: regsub -all "\\&" $string "\\&" string regsub -all "\"" $string "\\"" string regsub -all "<" $string "<" string regsub -all ">" $string ">" string return $string } proc convstyle {string} { global web_color web_style set result "" set stack "" for {set i 0} "\$i < [string length $string]" {incr i} { set char [string index $string $i] switch -- $char { "\002" - "\026" - "\037" { if {[string first $char $stack] != -1} { # NOT && if {[string index $stack 0] == $char} { append result [lindex $web_style($char) 1] set stack [string range $stack 1 end] } } else { append result [lindex $web_style($char) 0] set stack $char$stack } } "\003" { if {[string first $char $stack] != -1} { if {[string index $stack 0] == $char} { append result [lindex $web_style($char) 1] set stack [string range $stack 1 end] } } set c [getnumber [string range $string [expr $i + 1] [expr $i + 2]]] if {$c != "" && $c >= 0 && $c <= 15} { incr i [string length $c] append result "" set stack $char$stack } } default {append result $char} } } foreach char [split $stack ""] { if {$char == "\002" || $char == "\003" || $char == "\026" || $char == "\037"} { append result [lindex $web_style($char) 1] } } return $result } proc urlstrip {string} { global web_urlchars set result "" foreach char [split $string ""] { if {[string first $char $web_urlchars] != -1} { append result $char } } return $result } proc do_ques {} { global web_file web_update web_timerid global botnick timezone if {[info exists web_timerid]} {unset web_timerid} foreach chan [array names web_file] { if {[lsearch -exact [string tolower [channels]] [string tolower $chan]] == -1} {continue} set i [split $web_file($chan) ":"] set dir "" set file1 [lindex $i 0] set file2 [lindex $i 1] set j [string last "/" $file1] if {$j != -1} { set dir [string range $file1 0 $j] set file1 [string range $file1 [expr $j + 1] end] } unset i j if {$file1 != ""} { set fd1 [open $dir$file1~new w] } else { set fd1 [open "/dev/null" w] } if {$file2 != ""} { set fd2 [open $dir$file2~new w] } else { set fd2 [open "/dev/null" w] } puts $fd1 "" puts $fd1 " " puts $fd1 " People on [webify $chan] right now" puts $fd1 " " puts $fd1 " " puts $fd1 " " puts $fd1 " " puts $fd2 "" puts $fd2 " " puts $fd2 " People on [webify $chan] right now" puts $fd2 " " puts $fd2 " " puts $fd2 " " puts $fd2 " " if {![onchan $botnick $chan]} { puts $fd1 "

Oops!

" puts $fd1 " I'm not on [webify $chan] right now for some reason
" puts $fd1 " IRC isn't a very stable place these days..." puts $fd1 " Please try again later!
" puts $fd2 "

Oops!

" puts $fd2 " I'm not on [webify $chan] right now for some reason
" puts $fd2 " IRC isn't a very stable place these days..." puts $fd2 " Please try again later!
" } else { puts $fd1 "

[webify $chan]

" puts $fd2 "

[webify $chan]

" if {$file2 != ""} { puts $fd1 " If this page looks screwy on your browser, " puts $fd1 " try the HTML 2.0 " puts $fd1 " version.
" } puts $fd1 " " puts $fd1 " " puts $fd1 " " puts $fd1 " " puts $fd1 " " puts $fd1 " " puts $fd1 " " puts $fd2 " People on [webify $chan] as of [webify [strftime %a,\ %d\ %b\ %Y\ %H:%M\ %Z]]" puts $fd2 "
"
      puts $fd2 "      Nickname  Status           User@Host"
      foreach nick [chanlist $chan] {
        set len1 9
        set len2 16
        puts $fd1 "      
" if {[isop $nick $chan]} {lappend status "op"} if {[getchanidle $nick $chan] > 10} {lappend status "idle"} set host [getchanhost $nick $chan] set handle [finduser $nick!$host] set host [webify $host] if {[onchansplit $nick $chan]} { lappend status "split" #incr len2 [string length ""] incr len2 17 } if {![info exists status]} { set status "-" } else { set status [join $status ", "] } set url [urlstrip [getuser $handle XTRA url]] set info [getuser $handle INFO] set comment [getuser $handle COMMENT] set email [getuser $handle XTRA email] if {$url == "" && [string range $comment 0 6] == "http://"} { set url [urlstrip $comment] } if {$url == "" && [string range $info 0 6] == "http://"} { set url [urlstrip $info] } if {$url == "" && $email != "" && [string match *@*.* $email]} { set url [urlstrip mailto:$email] } incr len1 [string length [webify $nick]] incr len1 -[string length $nick] if {[string tolower $nick] == [string tolower $botnick]} { set host "<- it's me, the channel bot!" set info "" } elseif {[matchattr $handle b]} { set host "<- it's another channel bot" set info "" } if {$url != ""} { incr len1 [string length ""] puts $fd1 " " puts $fd2 " [format %-${len1}s [webify $nick]] [format %-${len2}s $status] $host" } else { puts $fd1 " " puts $fd2 " [format %-${len1}s [webify $nick]] [format %-${len2}s $status] $host" } puts $fd1 " " puts $fd1 " " puts $fd1 " " if {$info != ""} { puts $fd1 " " puts $fd1 " " puts $fd1 " " puts $fd2 " Info: [convstyle [webify $info]]" } unset len1 len2 status info url host comment email } puts $fd1 "
People on [webify $chan] as of [webify [strftime %a,\ %d\ %b\ %Y\ %H:%M\ %Z]]
NicknameStatusUser@Host
[webify $nick][webify $nick]$status$host
Info: [convstyle [webify $info]]
" puts $fd2 " " } puts $fd1 "
" puts $fd1 " This page is automatically refreshed every [webify $web_update] minute(s).
" puts $fd1 "
Created by quesedilla v5 via eggdrop.
" puts $fd1 " " puts $fd1 "" puts $fd1 "" puts $fd2 "
" puts $fd2 " This page is automatically refreshed every [webify $web_update] minute(s).
" puts $fd2 "
Created by quesedilla v5 via eggdrop.
" puts $fd2 " " puts $fd2 "" puts $fd2 "" close $fd1 close $fd2 if {$file1 != ""} {exec /bin/mv $dir$file1~new $dir$file1} if {$file2 != ""} {exec /bin/mv $dir$file2~new $dir$file2} unset nick file1 file2 dir fd1 fd2 } set web_timerid [timer $web_update do_ques] } #if {[info exists web_timerid]} { # killtimer $web_timerid # unset web_timerid #} if {![info exists web_timerid] && $web_update > 0} { set web_timerid [timer $web_update do_ques] } #do_ques foreach chan [array names web_file] { if {[string first ":" $web_file($chan)] != -1} { lappend channels "$chan" } else { lappend channels "$chan (no lynx)" } } if {![info exists channels]} { putlog "Quesedilla v5 final loaded (no channels)" } else { putlog "Quesedilla v5 final loaded: [join $channels ,\ ]" unset channels } if {![info exists timezone]} { set timezone [clock format 0 -format %Z] } eggdrop1.6.19/scripts/CONTENTS0000664000076400007640000000420310755654156015152 0ustar guppyguppy$Id: CONTENTS,v 1.15 2008-02-16 21:41:02 guppy Exp $ Directory Contents - scripts/ Last revised: August 08, 2004 _____________________________________________________________________ Directory Contents - scripts/ These are the example scripts that come with eggdrop. They're meant to be useful AND to introduce Tcl to those who haven't dealt with it before. Even people who program in Tcl may be confused by Eggdrop's implementation at first, because so many commands were added to interface with the bot. action.fix.tcl Gets rid of those ugly /me's people do instead of a .me. alltools.tcl Several useful procs for use in scripts. autobotchk Tcl script used to crontab your Eggdrop. Type 'scripts/autobotchk' from the Eggdrop's root directory for help. botchk A shell script which can be used for auto-starting the bot via 'cron'. cmd_resolve.tcl Adds a dcc command called '.resolve' which can be used to resolve hostnames or IP addresses via the partyline. compat.tcl Maps old Tcl functions to new ones, for lazy people who can't be bothered updating their scripts. getops.tcl A way for bots to get ops from other bots on the botnet (if they're on the same channel). klined.tcl Removes servers from your server list that your bot has been k-lined on, to prevent admins getting peeved with constant connects from your bot's host. notes2.tcl Check your notes on every shared bot of the hub. ques5.tcl Makes web pages of who's on each channel, updated periodically (requires alltools.tcl). sentinel.tcl (by slennox) Flood protection script for Eggdrop with integrated BitchX CTCP simulation. This script is designed to provide strong protection for your bot and channels against large floodnets and proxy floods. userinfo.tcl Cute user info settings things. weed Weed out certain undesirables from an Eggdrop userlist. Type 'scripts/weed' from the Eggdrop's root directory for help. _____________________________________________________________________ Copyright (C) 2001 - 2008 Eggheads Development Team eggdrop1.6.19/scripts/alltools.tcl0000664000076400007640000002056410755654156016337 0ustar guppyguppy# # All-Tools TCL, includes toolbox.tcl, toolkit.tcl and moretools.tcl # toolbox was originally authored by cmwagner # toolkit was originally authored by Robey Pointer # moretools was originally authored by David Sesno # modified for 1.3.0 bots by TG # # Copyright (C) 1999, 2003 - 2008 Eggheads Development Team # # Tothwolf 02May1999: rewritten and updated # guppy 02May1999: updated even more # Tothwolf 02May1999: fixed what guppy broke and updated again # Tothwolf 24/25May1999: more changes # rtc 20Sep1999: added isnumber, changes # dw 20Sep1999: use regexp for isnumber checking # Tothwolf 06Oct1999: optimized completely # krbb 09Jun2000: added missing return to randstring # Tothwolf 18Jun2000: added ispermowner # Sup 02Apr2001: added matchbotattr # Tothwolf 13Jun2001: updated/modified several commands # Hanno 28Sep2001: fixed testip # guppy 03Mar2002: optimized # Souperman 05Nov2002: added ordnumber # Tothwolf 27Dec2003: added matchbotattrany, optimized ordnumber, # more minor changes # # $Id: alltools.tcl,v 1.21 2008-02-16 21:41:02 guppy Exp $ # ######################################## # # Descriptions of available commands: # ## ## (toolkit): ## # # putmsg # send a privmsg to the given nick or channel # # putchan # send a privmsg to the given nick or channel # (for compat only, this is the same as 'putmsg' above) # # putnotc # send a notice to the given nick or channel # # putact # send an action to the given nick or channel # # ## ## (toolbox): ## # # strlwr # string tolower # # strupr # string toupper # # strcmp # string compare # # stricmp # string compare (case insensitive) # # strlen # string length # # stridx # string index # # iscommand # if the given command exists, return 1 # else return 0 # # timerexists # if the given command is scheduled by a timer, return its timer id # else return empty string # # utimerexists # if the given command is scheduled by a utimer, return its utimer id # else return empty string # # inchain # if the given bot is connected to the botnet, return 1 # else return 0 # (for compat only, same as 'islinked') # # randstring # returns a random string of the given length # # putdccall # send the given text to all dcc users # # putdccbut # send the given text to all dcc users except for the given idx # # killdccall # kill all dcc user connections # # killdccbut # kill all dcc user connections except for the given idx # # ## ## (moretools): ## # # iso # if the given nick has +o access on the given channel, return 1 # else return 0 # # realtime [format] # 'time' returns the current time in 24 hour format '14:15' # 'date' returns the current date in the format '21 Dec 1994' # not specifying any format will return the current time in # 12 hour format '1:15 am' # # testip # if the given ip is valid, return 1 # else return 0 # # number_to_number # if the given number is between 1 and 15, return its text representation # else return the number given # # ## ## (other commands): ## # # isnumber # if the given string is a valid number, return 1 # else return 0 # # ispermowner # if the given handle is a permanent owner, return 1 # else return 0 # # matchbotattr # if the given bot has all the given flags, return 1 # else return 0 # # matchbotattrany # if the given bot has any the given flags, return 1 # else return 0 # # ordnumber # if the given string is a number, returns the # "ordinal" version of that number, i.e. 1 -> "1st", # 2 -> "2nd", 3 -> "3rd", 4 -> "4th", etc. # else return # ######################################## # So scripts can see if allt is loaded. set alltools_loaded 1 set allt_version 206 # For backward compatibility. set toolbox_revision 1007 set toolbox_loaded 1 set toolkit_loaded 1 # # toolbox: # proc putmsg {dest text} { puthelp "PRIVMSG $dest :$text" } proc putchan {dest text} { puthelp "PRIVMSG $dest :$text" } proc putnotc {dest text} { puthelp "NOTICE $dest :$text" } proc putact {dest text} { puthelp "PRIVMSG $dest :\001ACTION $text\001" } # # toolkit: # proc strlwr {string} { string tolower $string } proc strupr {string} { string toupper $string } proc strcmp {string1 string2} { string compare $string1 $string2 } proc stricmp {string1 string2} { string compare [string tolower $string1] [string tolower $string2] } proc strlen {string} { string length $string } proc stridx {string index} { string index $string $index } proc iscommand {command} { if {[string compare "" [info commands $command]]} then { return 1 } return 0 } proc timerexists {command} { foreach i [timers] { if {![string compare $command [lindex $i 1]]} then { return [lindex $i 2] } } return } proc utimerexists {command} { foreach i [utimers] { if {![string compare $command [lindex $i 1]]} then { return [lindex $i 2] } } return } proc inchain {bot} { islinked $bot } proc randstring {length {chars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789}} { set count [string length $chars] for {set index 0} {$index < $length} {incr index} { append result [string index $chars [rand $count]] } return $result } proc putdccall {text} { foreach i [dcclist CHAT] { putdcc [lindex $i 0] $text } } proc putdccbut {idx text} { foreach i [dcclist CHAT] { set j [lindex $i 0] if {$j != $idx} then { putdcc $j $text } } } proc killdccall {} { foreach i [dcclist CHAT] { killdcc [lindex $i 0] } } proc killdccbut {idx} { foreach i [dcclist CHAT] { set j [lindex $i 0] if {$j != $idx} then { killdcc $j } } } # # moretools: # proc iso {nick chan} { matchattr [nick2hand $nick $chan] o|o $chan } proc realtime {args} { switch -exact -- [lindex $args 0] { time { return [strftime %H:%M] } date { return [strftime "%d %b %Y"] } default { return [strftime "%I:%M %P"] } } } proc testip {ip} { set tmp [split $ip .] if {[llength $tmp] != 4} then { return 0 } set index 0 foreach i $tmp { if {(([regexp \[^0-9\] $i]) || ([string length $i] > 3) || \ (($index == 3) && (($i > 254) || ($i < 1))) || \ (($index <= 2) && (($i > 255) || ($i < 0))))} then { return 0 } incr index } return 1 } proc number_to_number {number} { switch -exact -- $number { 0 { return Zero } 1 { return One } 2 { return Two } 3 { return Three } 4 { return Four } 5 { return Five } 6 { return Six } 7 { return Seven } 8 { return Eight } 9 { return Nine } 10 { return Ten } 11 { return Eleven } 12 { return Twelve } 13 { return Thirteen } 14 { return Fourteen } 15 { return Fifteen } default { return $number } } } # # other commands: # proc isnumber {string} { if {([string compare "" $string]) && \ (![regexp \[^0-9\] $string])} then { return 1 } return 0 } proc ispermowner {hand} { global owner if {([matchattr $hand n]) && \ ([lsearch -exact [split [string tolower $owner] ", "] \ [string tolower $hand]] != -1)} then { return 1 } return 0 } proc matchbotattr {bot flags} { foreach flag [split $flags ""] { if {[lsearch -exact [split [botattr $bot] ""] $flag] == -1} then { return 0 } } return 1 } proc matchbotattrany {bot flags} { foreach flag [split $flags ""] { if {[string first $flag [botattr $bot]] != -1} then { return 1 } } return 0 } proc ordnumber {string} { if {[isnumber $string]} then { set last [string index $string end] if {[string index $string [expr [string length $string] - 2]] != 1} then { if {$last == 1} then { return ${string}st } elseif {$last == 2} then { return ${string}nd } elseif {$last == 3} then { return ${string}rd } } return ${string}th } return $string } eggdrop1.6.19/scripts/autobotchk0000775000076400007640000002235607647042145016067 0ustar guppyguppy#! /bin/sh # This trick is borrowed from Tothwolf's Wolfpack \ # Search for tclsh[0-9].[0-9] in each valid dir in PATH \ for dir in $(echo $PATH | sed 's/:/ /g'); \ do \ if test -d $dir; \ then \ files=$(/bin/ls $dir | egrep '^tclsh[0-9]\.[0-9]$'); \ if test "$files" != ""; \ then \ versions="${versions:+$versions }$(echo $files | sed 's/tclsh//g')"; \ fi; \ fi; \ done; \ for ver in $versions; \ do \ tmpver=$(echo $ver | sed 's/\.//g'); \ if test "$lasttmpver" != ""; \ then \ if test "$tmpver" -gt "$lasttmpver"; \ then \ lastver=$ver; \ lasttmpver=$tmpver; \ fi; \ else \ lastver=$ver; \ lasttmpver=$tmpver; \ fi; \ done; \ exec tclsh$lastver "$0" "$@" # # AutoBotchk - An eggdrop utility to autogenerate botchk/crontab entries # # Copyright (C) 1999, 2000, 2001, 2002 Jeff Fisher (guppy@eggheads.org) # # How to use # ---------- # # Most people begin to use AutoBotchk by moving it from the script # directory to their Eggdrop directory -- this will save you from having to # use the -dir option. # # If you run AutoBotchk without any arguments, it will present you with # a list of valid ones. Most people run AutoBotchk by doing: # # ./autobotchk # # This will setup crontab to check every 10 minutes to see whether or not # your bot needs to be restarted and it will e-mail if a restart was # performed. A lot of people turn off crontab e-mail support; however, I do # not recommend this since you will be unable to see any errors that might # happen. # # Updates # ------- # 27Sep2001: added new pidfile setting # 14Nov2001: removed old autobotchk update entries and updated the help # section a little bit. also made autobotchk move down one # directory if being run from the scripts directory. # 15Apr2003: cleaned up a few things, fixed a few bugs, and made a little # love! j/k # # $Id: autobotchk,v 1.11 2003-04-15 17:41:57 guppy Exp $ # if {$argc == 0} { puts "\nusage: $argv0 \[options\]" puts " -dir (directory to run autobotchk in)" puts " -noemail (discard crontab e-mails)" puts " -5 (5 minute checks)" puts " -10 (10 minute checks)" puts " -15 (15 minute checks)" puts " -30 (30 minute checks)" puts "" exit } fconfigure stdout -buffering none proc newsplit {text {split " "}} { upvar $text ours append ours $split set index [string first $split $ours] if {$index == -1} { set ours "" return "" } set tmp [string trim [string range $ours 0 $index]] set ours [string trim [string range $ours [expr $index + [string length $split]] end]] return $tmp } puts "\nautobotchk 1.10, (C) 2003 Jeff Fisher (guppy@eggheads.org)" puts "------------------------------------------------------------\n" set config [newsplit argv] set dir [pwd] set delay 10 set email 1 # If you renamed your eggdrop binary, you should change this variable set binary "eggdrop" while {[set opt [newsplit argv]] != ""} { switch -- $opt { "-time" - "-1" { set delay 1 } "-5" { set delay 5 } "-10" { set delay 10 } "-15" { set delay 15 } "-20" { set delay 20 } "-30" { set delay 30 } "-nomail" - "-noemail" {set email 0} "-dir" { set dir [newsplit argv] if {[string match -* $dir]} { puts "*** ERROR: you did not supply a directory name" puts "" exit } if {![file isdirectory $dir]} { puts "*** ERROR: the directory you supplied is not a directory" puts "" exit } } } } switch -- $delay { "30" { set minutes "0,30" } "20" { set minutes "0,20,40" } "15" { set minutes "0,15,30,45" } "5" { set minutes "0,5,10,15,20,25,30,35,40,45,50,55" } "1" { set minutes "*" } default { set minutes "0,10,20,30,40,50" } } if {[string match "*/scripts" $dir]} { set dir [string range $dir 0 [expr [string length $dir] - 8]] } set dir [string trimright $dir /] if {![file exists $dir/help] || ![file isdirectory $dir/help]} { puts "*** ERROR: are you sure you are running from a bot directory?" puts "" exit } elseif {![file exists $dir/$binary]} { puts "*** ERROR: are you sure you are running from a bot directory?" puts "" exit } puts -nonewline "Opening '$config' for processing ... " if {[catch {open $dir/$config r} fd]} { puts "error:" puts " $fd\n" exit } else { puts "done" } set count 0 puts -nonewline "Scanning the config file " while {![eof $fd]} { incr count if {$count == 100} { puts -nonewline "." set count 0 } set line [gets $fd] if {[set blarg [newsplit line]] != "set"} { continue } switch -- [set opt [newsplit line]] { "pidfile" - "nick" - "userfile" - "botnet-nick" { set $opt [string trim [newsplit line] " \""] } } } close $fd if {$count != 0} { puts -nonewline "." } puts " done" if {![info exists {botnet-nick}] && [info exists nick]} { puts " Defaulting \$botnet-nick to \"$nick\"" set botnet-nick $nick } if {![info exists pidfile]} { puts " Defaulting \$pidfile to \"pid.${botnet-nick}\"" set pidfile "pid.${botnet-nick}" } if {![info exists {botnet-nick}] || ![info exists userfile]} { puts " *** ERROR: could not find either \$userfile or \$botnet-nick" puts "" puts " Are you sure this is a valid eggdrop config file?" puts "" exit } if {[catch {open $dir/${botnet-nick}.botchk w} fd]} { puts " *** ERROR: unable to open '${botnet-nick}.botchk' for writing" puts "" exit } puts $fd "#! /bin/sh # # ${botnet-nick}.botchk (generated on [clock format [clock seconds] -format "%B %d, %Y @ %I:%M%p"]) # # Generated by AutoBotchk 1.10 # Copyright (C) 1999, 2000, 2001, 2002, 2003 Jeff Fisher # # change this to the directory you run your bot from: botdir=\"$dir\" # change this to the name of your bot's script in that directory: botscript=\"$binary $config\" # change this to the nickname of your bot (capitalization COUNTS) botname=\"${botnet-nick}\" # change this to the name of your bot's userfile (capitalization COUNTS) userfile=\"$userfile\" # change this to the name of your bot's pidfile (capitalization COUNTS) pidfile=\"$pidfile\" ########## you probably don't need to change anything below here ########## cd \$botdir # is there a pid file? if test -r \$pidfile then # there is a pid file -- is it current? botpid=`cat \$pidfile` if `kill -CHLD \$botpid >/dev/null 2>&1` then # it's still going -- back out quietly exit 0 fi echo \"\" echo \"Stale \$pidfile file, erasing...\" rm -f \$pidfile fi if test -r CANTSTART.\$botname then if test -r \$userfile || test -r \$userfile~new || test -r \$userfile~bak then echo \"\" echo \"Userfile found, removing check file 'CANTSTART.\$botname'...\" rm -f CANTSTART.\$botname fi fi # test if we have run botchk previously and didn't find a userfile if test ! -f CANTSTART.\$botname then echo \"\" echo \"Couldn't find bot '\$botname' running, reloading...\" echo \"\" # check for userfile and reload bot if found if test -r \$userfile then # It's there, load the bot ./\$botscript exit 0 else if test -r \$userfile~new then # Bot f*@!ed up while saving the userfile last time. Move it over. echo \"Userfile missing. Using last saved userfile...\" mv -f \$userfile~new \$userfile ./\$botscript exit 0 else if test -r \$userfile~bak then # Userfile is missing, use backup userfile. echo \"Userfile missing. Using backup userfile...\" cp -f \$userfile~bak \$userfile ./\$botscript exit 0 else # Well, nothing to work with... echo \"No userfile. Could not reload the bot...\" echo \"no userfile\" > CANTSTART.\$botname exit 1 fi fi fi fi exit 0 " close $fd puts "Wrote '${botnet-nick}.botchk' successfully ([file size $dir/${botnet-nick}.botchk] bytes)" if {[catch {exec chmod u+x $dir/${botnet-nick}.botchk} 0]} { puts " *** ERROR: unable to 'chmod u+x' the output file" puts "" exit } puts -nonewline "Scanning crontab entries ... " set tmp ".autobotchk[clock clicks].[pid]" if {$email} { set line "$minutes \* \* \* \* $dir/${botnet-nick}.botchk" } { set line "$minutes \* \* \* \* $dir/${botnet-nick}.botchk >\/dev\/null 2>&1" } if {[catch {exec crontab -l > $tmp} error ]} { if {![string match "*no*cron*" [string tolower $error]] && ![string match "*can't open*" [string tolower $error]]} { catch {file delete -force $tmp} 0 puts "error: unable to get crontab listing" puts "" puts $error puts "" exit } } set fd [open $tmp r] while {![eof $fd]} { set z [gets $fd] if {[string match "*$dir/${botnet-nick}.botchk*" $z] || [string match "*$dir//${botnet-nick}.botchk*" $z]} { puts "found an existing entry, we're done now" puts "" exit } } close $fd puts "done" puts -nonewline "Adding the new crontab entry ... " set fd [open $tmp a] puts $fd $line close $fd if {[catch {exec crontab $tmp} error]} { puts "error: unable to do 'crontab $tmp'" puts "" puts $error puts "" exit } else { catch {file delete -force $tmp} 0 } puts "done" puts "" puts "Use 'crontab -l' to view all your current crontab entries" puts " 'crontab -r' to remove all your crontab entries" puts "" eggdrop1.6.19/scripts/Makefile.in0000664000076400007640000000423710755475761016051 0ustar guppyguppy# Makefile for scripts/ # $Id: Makefile.in,v 1.15 2008-02-16 06:00:17 guppy Exp $ SHELL = @SHELL@ top_srcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ @SET_MAKE@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ DOCS = CONTENTS SCRIPTS = action.fix.tcl alltools.tcl compat.tcl getops.tcl \ klined.tcl notes2.tcl ques5.tcl sentinel.tcl userinfo.tcl cmd_resolve.tcl \ quotepass.tcl quotepong.tcl EXESCRIPTS = autobotchk botchk weed doofus: @echo "" @echo "Let's try this from the right directory..." @echo "" @cd .. && $(MAKE) all: $(DOCS) $(SCRIPTS) $(EXESCRIPTS) clean: @rm -f *~ install: @if test ! -d $(DEST)/scripts; then \ echo "Creating 'scripts' subdirectory."; \ $(top_srcdir)/misc/mkinstalldirs $(DEST)/scripts >/dev/null; \ echo "Copying scripts."; \ for i in $(DOCS); do \ $(INSTALL_DATA) $(srcdir)/$$i $(DEST)/scripts/; \ done; \ for i in $(SCRIPTS); do \ $(INSTALL_DATA) $(srcdir)/$$i $(DEST)/scripts/; \ done; \ for i in $(EXESCRIPTS); do \ $(INSTALL_SCRIPT) $(srcdir)/$$i $(DEST)/scripts/; \ done; \ if test ! "x`echo $(srcdir)/help/*.help`" = "x$(srcdir)/help/*.help"; then \ if test ! -d $(DEST)/help; then \ echo "Creating 'help' subdirectory."; \ $(top_srcdir)/misc/mkinstalldirs $(DEST)/help >/dev/null; \ fi; \ for i in $(srcdir)/help/*.help; do \ $(INSTALL_DATA) $$i $(DEST)/help/; \ done; \ fi; \ if test ! "x`echo $(srcdir)/help/msg/*.help`" = "x$(srcdir)/help/msg/*.help"; then \ if test ! -d $(DEST)/help/msg; then \ echo "Creating 'help/msg' subdirectory."; \ $(top_srcdir)/misc/mkinstalldirs $(DEST)/help/msg >/dev/null; \ fi; \ for i in $(srcdir)/help/msg/*.help; do \ $(INSTALL_DATA) $$i $(DEST)/help/msg/; \ done; \ fi; \ if test ! "x`echo $(srcdir)/help/set/*.help`" = "x$(srcdir)/help/set/*.help"; then \ if test ! -d $(DEST)/help/set; then \ echo "Creating 'help/set' subdirectory."; \ $(top_srcdir)/misc/mkinstalldirs $(DEST)/help/set >/dev/null; \ fi; \ for i in $(srcdir)/help/set/*.help; do \ $(INSTALL_DATA) $$i $(DEST)/help/set/; \ done; \ fi; \ fi #safety hash eggdrop1.6.19/scripts/quotepong.tcl0000664000076400007640000001322011002272200016462 0ustar guppyguppy# quotepong.tcl by [sL] (Feb 14, 08) # Based on quotepass.tcl by simple, guppy, [sL] # # Ascii Letter definitions provided by Freeder # # Description: # # Some EFnet servers require the user to type /quote pong : # when ident is broken or disabled. This will send pong : to # the server when connecting. # set a2t_alphabet(a) "\n\ /\\ \n\ \ / \\ \n\ \ / /\\ \\ \n\ \ / ____ \\ \n\ /_/ \\_\\\n" set a2t_alphabet(b) "\ ____ \n\ | _ \\ \n\ | |_) |\n\ | _ < \n\ | |_) |\n\ |____/" set a2t_alphabet(c) "\ _____ \n\ \ / ____|\n\ | | \n\ | | \n\ | |____ \n\ \ \\_____|" set a2t_alphabet(d) "\ _____ \n\ | __ \\ \n\ | | | |\n\ | | | |\n\ | |__| |\n\ |_____/ " set a2t_alphabet(e) "\ ______ \n\ | ____|\n\ | |__ \n\ | __| \n\ | |____ \n\ |______|\n" set a2t_alphabet(f) "\ ______ \n\ | ____|\n\ | |__ \n\ | __| \n\ | | \n\ |_| " set a2t_alphabet(g) "\ _____\n\ \ / ____|\n\ | | __ \n\ | | |_ |\n\ | |__| |\n\ \ \\_____|" set a2t_alphabet(h) "\ _ _ \n\ | | | |\n\ | |__| |\n\ | __ |\n\ | | | |\n\ |_| |_|" set a2t_alphabet(i) "\ _____ \n\ |_ _|\n\ \ | | \n\ \ | | \n\ \ _| |_ \n\ |_____|" set a2t_alphabet(j) "\ _ \n\ \ | |\n\ \ | |\n\ \ _ | |\n\ | |__| |\n\ \ \\____/ " set a2t_alphabet(k) "\ _ __\n\ | |/ /\n\ | ' / \n\ | < \n\ | . \\ \n\ |_|\\_\\" set a2t_alphabet(l) "\ _ \n\ | | \n\ | | \n\ | | \n\ | |____ \n\ |______|" set a2t_alphabet(m) "\ __ __ \n\ | \\/ |\n\ | \\ / |\n\ | |\\/| |\n\ | | | |\n\ |_| |_|" set a2t_alphabet(n) "\ _ _ \n\ | \\ | |\n\ | \\| |\n\ | . ` |\n\ | |\\ |\n\ |_| \\_|" set a2t_alphabet(o) "\ ____ \n\ \ / __ \\ \n\ | | | |\n\ | | | |\n\ | |__| |\n\ \ \\____/ " set a2t_alphabet(p) "\ _____ \n\ | __ \\ \n\ | |__) |\n\ | ___/ \n\ | | \n\ |_| " set a2t_alphabet(q) "\ ____ \n\ \ / __ \\ \n\ | | | |\n\ | | | |\n\ | |__| |\n\ \ \\___\\_\\" set a2t_alphabet(r) "\ _____ \n\ | __ \\ \n\ | |__) |\n\ | _ / \n\ | | \\ \\ \n\ |_| \\_\\" set a2t_alphabet(s) "\ _____ \n\ \ / ____|\n\ | (___ \n\ \ \\___ \\ \n\ \ ____) |\n\ |_____/ " set a2t_alphabet(t) "\ _______ \n\ |__ __|\n\ \ | | \n\ \ | | \n\ \ | | \n\ \ |_| " set a2t_alphabet(u) "\ _ _ \n\ | | | |\n\ | | | |\n\ | | | |\n\ | |__| |\n\ \ \\____/ " set a2t_alphabet(v) " __ __\n\ \\ \\ / /\n\ \ \\ \\ / / \n\ \ \\ \\/ / \n\ \ \\ / \n\ \ \\/ " set a2t_alphabet(w) " __ __\n\ \\ \\ / /\n\ \ \\ \\ /\\ / / \n\ \ \\ \\/ \\/ / \n\ \ \\ /\\ / \n\ \ \\/ \\/ " set a2t_alphabet(x) " __ __\n\ \\ \\ / /\n\ \ \\ V / \n\ \ > < \n\ \ / . \\ \n\ /_/ \\_\\" set a2t_alphabet(y) " __ __\n\ \\ \\ / /\n\ \ \\ \\_/ / \n\ \ \\ / \n\ \ | | \n\ \ |_| " set a2t_alphabet(z) "\ ______\n\ |___ /\n\ \ / / \n\ \ / / \n\ \ / /__ \n\ /_____|" proc a2t_ascii2text {ascii {count 6}} { global a2t_alphabet # foreach line [split $ascii \n] { putlog $line } set a2t_result "" for {set i 0} {$i < $count} {incr i} { foreach let [split abcdefghijklmnopqrstuvwxyz ""] { set match 1 set tascii $ascii foreach alph_line [split $a2t_alphabet($let) \n] { set alph_line [string range $alph_line 1 end] set asc_line [lindex [split $tascii \n] 0] set tascii [join [lrange [split $tascii \n] 1 end] \n] # need to fix our match pattern regsub -all {\\} $alph_line {\\\\} alph_line if {![string match "[string trim $alph_line]*" [string trim $asc_line]]} { set match 0 break } } if {$match} { append a2t_result $let # remove the ascii letter set new_ascii [list] foreach alph_line [split $a2t_alphabet($let) \n] { set alph_line [string range $alph_line 1 end] set asc_line [lindex [split $ascii \n] 0] set ascii [join [lrange [split $ascii \n] 1 end] \n] # need to fix our regspec regsub -all {\\} $alph_line {\\\\} alph_line regsub -all {\|} $alph_line "\\|" alph_line regsub -all {\)} $alph_line "\\)" alph_line regsub -all {\(} $alph_line "\\(" alph_line regsub -- $alph_line "$asc_line" "" asc_line lappend new_ascii $asc_line } set ascii [join $new_ascii \n] } if {$match} { break } } } return [string toupper $a2t_result] } set quotepong_match "/QUOTE PONG :cookie" bind evnt - init-server quotepong_unbind bind evnt - disconnect-server quotepong_unbind bind evnt - connect-server quotepong_bind proc quotepong_servermsg {from cmd text} { global quotepong_match quotepong_count quotepong_ascii if {![info exists quotepong_count] && [string match "*$quotepong_match*" $text]} { set quotepong_count 0 set quotepong_ascii [list] return 0 } if {[info exists quotepong_count] && ($cmd == "998")} { if {$quotepong_count == 0} { putlog "Received ASCII Cookie from server:" } incr quotepong_count lappend quotepong_ascii [lindex [split $text :] 1] putlog "[lindex [split $text :] 1]" if {$quotepong_count == 6} { # time to send back to server set cookie [a2t_ascii2text [join $quotepong_ascii \n]] putlog "Sending Cookie to server: $cookie" putserv "PONG :$cookie" catch {unset quotepong_count} } } return 0 } proc quotepong_unbind {type} { # Try to unbind our raw NOTICE bind once we are connected since it will # never be needed again catch { unbind raw - NOTICE quotepong_servermsg unbind raw - 998 quotepong_servermsg } } proc quotepong_bind {type} { bind raw - NOTICE quotepong_servermsg bind raw - 998 quotepong_servermsg } eggdrop1.6.19/scripts/klined.tcl0000664000076400007640000000717707027735114015751 0ustar guppyguppy# # KLined.TCL - Version 1.0 # By Ian Kaney - ikaney@uk.defiant.org # # $Id: klined.tcl,v 1.2 1999-12-21 17:35:08 fabian Exp $ # # Even at the best of times, your bot will get k-lined by one operator or # another on a server you're running your bot on. This script will 'hopefully' # handle this by removing it from your bot's server list when it detects # you've been k-lined there. Thus, stopping IRC server admins getting # rather peeved at the constant connects from your host. # # USAGE: # The actual handling of removing the server from your server list # and writing it to the 'klines' file is handled automatically when # your bot receives the k-line signal, but there are some DCC commands # that have been added, these are: # # .klines - Lists the 'klines' file showing servers that your bot # has registered as being k-lined on. # .unkline - Removes the k-line from the server *joke* ;) # Actually, this removes the server from the list # of servers to remove. # # Bindings # --- bind load - server remove_kservers bind raw - 465 woah_klined bind dcc n klines list_kservers bind dcc n unkline unkline_server # Variables # --- # Change this to suite your tastes - if you can't be bothered, or # don't know how, leave it. set kfile "klines" proc list_kservers {handle idx args} { global kfile putcmdlog "#$handle# klines" set fd [open $kfile r] set kservers { } while {![eof $fd]} { set tmp [gets $fd] if {[eof $fd]} {break} set kservers [lappend kservers [string trim $tmp]] } close $fd if {[llength $kservers] == 0} { putdcc $idx "No k-lined servers." return 0 } putdcc $idx "My k-lined server list:\n" foreach tmp $kservers { putdcc $idx $tmp } } proc unkline_server {handle idx args} { global kfile set kservers {} set fd [open $kfile r] set rem [lindex $args 0] putcmdlog "#$handle# unkline $rem" while {![eof $fd]} { set tmp [gets $fd] if {[eof $fd]} {break} set kservers [lappend kservers [string trim $tmp]] } close $fd set fd [open $kfile w] set flag "0" foreach tmp $kservers { if {$tmp == $rem} { set flag "1" } if {$tmp != $rem} { puts $fd $tmp } } close $fd if {$flag == "0"} { putdcc $idx "Could not find $rem in the k-lined server list." } if {$flag == "1"} { putdcc $idx "Removed server $rem from k-lined server list." } } proc remove_kservers {module} { global kfile global server servers if {[catch {set fd [open $kfile r]}] != 0} { set fd [open $kfile w] close $fd set fd [open $kfile r] } while {![eof $fd]} { set from [string trim [gets $fd]] set name "*$from*" if {[eof $fd]} {break} for {set j 0} {$j >= 0} {incr j} { set x [lsearch $servers $name] if {$x >= 0} { set servers [lreplace $servers $x $x] } if {$x < 0} { if {$j >= 0} { putlog "Removed server: $from" } break } } } close $fd return 1 } proc woah_klined {from keyword arg} { global kfile global server servers set kservers {} set fd [open $kfile r] while {![eof $fd]} { set tmp [gets $fd] if {[eof $fd]} {break} set kservers [lappend kservers [string trim $tmp]] } close $fd set flag "0" foreach tmp $kservers { if {$tmp == $from} { set flag "1" } } if {$flag != "1"} { set fd [open $kfile a] puts $fd $from close $fd } set name "*$from*" for {set j 0} {$j >= 0} {incr j} { set x [lsearch $servers $name] if {$x >= 0} { set servers [lreplace $servers $x $x] } if {$x <= 0} { if {$j >= 0} { putlog "Removed server: $from" } break } } return 1 } putlog "TCL loaded: k-lined" remove_kservers server eggdrop1.6.19/scripts/botchk0000775000076400007640000000533007437221672015170 0ustar guppyguppy#! /bin/sh # # botchk # # $Id: botchk,v 1.6 2002-02-27 18:21:46 guppy Exp $ # # This is a script suitable for use in a crontab. It checks to make sure # your bot is running. YOU NEED A SEPARATE CRON JOB FOR EACH BOT. If your # bot isn't found, it'll try to start it back up. # # You'll need to edit this script for your bot. # # To check for your bot every 10 minutes, put the following line in your # crontab: # 0,10,20,30,40,50 * * * * /home/mydir/mybot/botchk # And if you don't want to get email from crontab when it checks you bot, # put the following in your crontab: # 0,10,20,30,40,50 * * * * /home/mydir/mybot/botchk >/dev/null 2>&1 # # change this to the directory you run your bot from (capitalization COUNTS): botdir="/home/mydir/mybot" # change this to the name of your bot's config file (capitalization COUNTS): botscript="mybot" # change this to the botnet-nick of your bot (capitalization COUNTS): botname="LamestBot" # change this to the name of your bot's userfile (capitalization COUNTS): userfile="LamestBot.user" # change this to the name of your bot's pidfile (capitalization COUNTS): pidfile="pid.LamestBot" ########## you probably don't need to change anything below here ########## cd $botdir # is there a pid file? if test -r $pidfile then # there is a pid file -- is it current? botpid=`cat $pidfile` if `kill -CHLD $botpid >/dev/null 2>&1` then # it's still going -- back out quietly exit 0 fi echo "" echo "Stale $pidfile file, erasing..." rm -f $pidfile fi if test -r CANTSTART.$botname then if test -r $userfile || test -r $userfile~new || test -r $userfile~bak then echo "" echo "Userfile found, removing check file 'CANTSTART.$botname'..." rm -f CANTSTART.$botname fi fi # test if we have run botchk previously and didn't find a userfile if test ! -f CANTSTART.$botname then echo "" echo "Couldn't find bot '$botname' running, reloading..." echo "" # check for userfile and reload bot if found if test -r $userfile then # It's there, load the bot ./$botscript exit 0 else if test -r $userfile~new then # Bot f*@!ed up while saving the userfile last time. Move it over. echo "Userfile missing. Using last saved userfile..." mv -f $userfile~new $userfile ./$botscript exit 0 else if test -r $userfile~bak then # Userfile is missing, use backup userfile. echo "Userfile missing. Using backup userfile..." cp -f $userfile~bak $userfile ./$botscript exit 0 else # Well, nothing to work with... echo "No userfile. Could not reload the bot..." echo "no userfile" > CANTSTART.$botname exit 1 fi fi fi fi exit 0 eggdrop1.6.19/scripts/cmd_resolve.tcl0000664000076400007640000000247107647125710017000 0ustar guppyguppy# # cmd_resolve.tcl # written by Jeff Fisher (guppy@eggheads.org) # # This script adds the commands '.resolve' and '.dns' which can be used to # lookup hostnames or ip addresses in the partyline without causing the bot # to block while doing so thanks to the dns module. # # updates # ------- # 15Apr2003: fixed a logging bug and stop using regexp incorrectly # 05Nov2000: fixed a nasty security hole, .resolve [die] # 04Nov2000: first version # # $Id: cmd_resolve.tcl,v 1.4 2003-04-16 01:03:04 guppy Exp $ bind dcc -|- resolve resolve_cmd bind dcc -|- dns resolve_cmd proc resolve_cmd {hand idx arg} { global lastbind if {[scan $arg "%s" hostip] != 1} { putidx $idx "Usage: $lastbind " } else { putidx $idx "Looking up $hostip ..." set hostip [split $hostip] dnslookup $hostip resolve_callback $idx $hostip $lastbind } return 0 } proc resolve_callback {ip host status idx hostip cmd} { if {![valididx $idx]} { return 0 } elseif {!$status} { putidx $idx "Unable to resolve $hostip" } elseif {[string tolower $ip] == [string tolower $hostip]} { putidx $idx "Resolved $ip to $host" } else { putidx $idx "Resolved $host to $ip" } putcmdlog "#[idx2hand $idx]# $cmd $hostip" return 0 } loadhelp cmd_resolve.help putlog "Loaded cmd_resolve.tcl successfully." eggdrop1.6.19/scripts/compat.tcl0000664000076400007640000000411610755654156015764 0ustar guppyguppy# compat.tcl # This script just quickly maps old Tcl functions to the new ones, # use this is you are to lazy to get of your butt and update your scripts :D # by the way it binds some old command to the new ones # # Copyright (C) 2002 - 2008 Eggheads Development Team # # Wiktor 31Mar2000: added binds and chnick proc # Tothwolf 25May1999: cleanup # Tothwolf 06Oct1999: optimized # rtc 10Oct1999: added [set|get][dn|up]loads functions # # $Id: compat.tcl,v 1.15 2008-02-16 21:41:02 guppy Exp $ proc gethosts {hand} { getuser $hand HOSTS } proc addhost {hand host} { setuser $hand HOSTS $host } proc chpass {hand pass} { setuser $hand PASS $pass } proc chnick {oldnick newnick} { chhandle $oldnick $newnick } # setxtra is no longer relevant proc getxtra {hand} { getuser $hand XTRA } proc setinfo {hand info} { setuser $hand INFO $info } proc getinfo {hand} { getuser $hand INFO } proc getaddr {hand} { getuser $hand BOTADDR } proc setaddr {hand addr} { setuser $hand BOTADDR $addr } proc getdccdir {hand} { getuser $hand DCCDIR } proc setdccdir {hand dccdir} { setuser $hand DCCDIR $dccdir } proc getcomment {hand} { getuser $hand COMMENT } proc setcomment {hand comment} { setuser $hand COMMENT $comment } proc getemail {hand} { getuser $hand XTRA email } proc setemail {hand email} { setuser $hand XTRA EMAIL $email } proc getchanlaston {hand} { lindex [getuser $hand LASTON] 1 } proc time {} { strftime "%H:%M" } proc date {} { strftime "%d %b %Y" } proc setdnloads {hand {c 0} {k 0}} { setuser $hand FSTAT d $c $k } proc getdnloads {hand} { getuser $hand FSTAT d } proc setuploads {hand {c 0} {k 0}} { setuser $hand FSTAT u $c $k } proc getuploads {hand} { getuser $hand FSTAT u } # as you can see it takes a lot of effort to simulate all the old commands # and adapting your scripts will take such an effort you better include # this file forever and a day :D # Following are some TCL global variables that are obsolete now and have been removed # but are still defined here so not to break older scripts set strict-servernames 0 eggdrop1.6.19/Makefile0000664000076400007640000000025711002271516013725 0ustar guppyguppyall: @echo "" @echo "Before you can compile your bot you have to configure it." @echo "Please start the configure script now:" @echo "" @echo " % ./configure" @echo "" eggdrop1.6.19/help/0000775000076400007640000000000011002271500013202 5ustar guppyguppyeggdrop1.6.19/help/cmds1.help0000664000076400007640000003340610057630512015104 0ustar guppyguppy%{help=+bot}%{+t} ### %b+bot%b [address[:bot port[/user port]]] [host] Creates a user record for a new bot with the handle given. If no hostmask is specified, the bot will try to automatically add a host from the channel. The bot's address will be used in linking. If the bot has a separate port for bots and users they should be separated with a slash (/). See also: -bot %{help=+host}%{+t|m} ### %b+host%b [handle] Adds a hostmask to a user's user record. Hostmasks are used to identify your handle on IRC. If a handle is not specified, the hostmask will be added to YOUR user record. See also: -host %{help=+ignore}%{+m} ### %b+ignore%b [%%] [comment] Adds an ignore to the list of ignores stored on the bot, with optional comment and ignore time. This ignore is stored with your handle as the creator. Ignore time has to be expressed in days, hours, and/or minutes. See also: -ignore, ignores %{help=+user}%{+m} ### %b+user%b [hostmask] Creates a new user record for the handle given. The new user record will have no flags, an optional hostmask, and no password. See also: -user, +host, -host %{help=-bot}%{+t} ### %b-bot%b This is exactly the same as %b'.-user'%b (it removes a user record). It is included for convenience. See also: +bot, +user, -user %{help=-host}%{-} ### %b-host%b Removes a host from your handle. %{+m|m} ### %b-host%b Removes a hostmask from a user's user record. %{-} See also: +host %{help=-ignore}%{+m} ### %b-ignore%b Removes the specified ignore from the list of ignores stored on the bot. You may also reference the ignore by the number shown by the 'ignores' command. See also: +ignore, ignores %{help=-user}%{+m} ### %b-user%b Removes the specified handle's user record. See also: +user, +bot, -bot %{help=addlog}%{+to|o} ### %baddlog%b Adds your comment to the bot's logfile. Bot masters can go back later and review the log, and will see your comment (with your handle attached). This is useful for explaining confusing activity. %{help=away}%{-} ### %baway%b [away-message] Marks you as "away" on the party line. Your away message will show up in the %b'.who'%b list, and will be displayed to anyone who tries to send you a note. Your notes will be stored, and then displayed to you as soon as you are no longer away. Saying something on the party line will automatically remove your "away" status, or you can type %b'.back'%b or %b'.away'%b by itself. See also: back %{help=back}%{-} ### %bback%b This marks you as no longer away on the party line. See also: away %{help=backup}%{+m|m} ### %bbackup%b This makes the bot write a backup of its entire user list to the disk. If the channels module is loaded, this will also write a backup of the channels file. This is useful if you feel the need to backup the userfile and channel settings. See also: reload, rehash, save %{help=banner}%{+t} ### %bbanner%b Displays a message to everyone currently using the bot's party line or file area. This is useful for announcing that the bot will go down, etc. %{help=binds}%{+m} ### %bbinds%b [type/match] [all] Shows the Tcl bindings in effect, in a list similar to this: Command bindings: TYPE FLGS COMMAND HITS BINDING (TCL) msg -|- rose 0 msg_rose msg -|- go 0 msg_go dcc m|- bind 0 cmd_bind pub -|- gross 0 pub_gross The fields should be self-explanatory, except for HITS, which records the number of times that binding has been called. If not, go read the file %b'doc/tcl-commands.doc'%b for help on the Tcl bind command. Note that the builtin commands are now shown. You may also specify a type of binding to show (i.e. %b'.binds msg'%b) or you can specify a wild card match (i.e. %b'.binds *seen*'%b) if you want to narrow the field a bit. The wild card matches will match against the TYPE, COMMAND and BINDING fields. You can view more binds by adding 'all' to the end of the command. See also: tcl %{help=boot}%{+t} ### %bboot%b [reason] Kicks a user off the party line and displays the reason, if you specify one. You can also specify a bot, and attempt to boot someone from another bot on the botnet, though it may be rejected if that bot does not allow remote boots. You can not boot a bot owner. %{help=botattr}%{+t} ### %bbotattr%b [flags] [channel] Lets you view and change the bot flags for a bot. For example, to set "Fred1" +share and -hub, you would do '.botattr Fred1 +s-h.' Whether or not you change any flags, it will show you the bot's flags afterwards. To get a list of the flags possible, see %b'.help whois'%b. %bNOTE:%b This command is NOT used to replace .chattr. It modifies bot flags, such as s, h, a, u, etc. %bNOTE:%b You can't use this command on bots which are directly linked to your bot at the current moment. See also: whois, chattr %{help=botinfo}%{-} ### %bbotinfo%b Requests information from every bot currently on the botnet. Each bot should eventually send you one line containing its version, network setting, channels, and uptime. See also: bottree, vbottree, bots %{help=bots}%{-} ### %bbots%b Shows the list of bots currently on the botnet. Example: Bots: cEvin, ruthie, Killa1 There is no indication of which bots are directly connected to this current bot. Use %b'.who'%b%{+t} or %b'.bottree'%b%{-} for that information. See also: bottree, vbottree, botinfo %{help=bottree}%{-} ### %bbottree%b Shows a tree-format diagram of the bots currently on the botnet. It's just a nice way to get a feel for how the bots are physically connected. If 2 bots are sharing, a + will be indicated, or a ? if nothing is known. See also: bots, botinfo, vbottree %{help=chaddr}%{+t} ### %bchaddr%b Changes the address for a bot. This is the address your bot will try to connect to when linking. If the bot has a separate port for bots and users, they should be separated by a slash (/). See also: link, +bot %{help=chat}%{-} ### %bchat%b ### %bchat%b <[*]channel number/name> Changes your current channel on the partyline. When you first connect to the partyline, it places you on channel 0 (the main party line). Some channels may have assigned names if the assoc module is loaded. For these, you can specify the channel by name instead of channel number if you wish. %b'.chat off'%b removes you from all channels, including the main party line. You can still use bot commands and see the console, but you can't talk to anyone except via %b'.note'%b. %b'.chat on'%b returns you to the main party line (channel 0) if you were elsewhere. If you prefix the channel with a '*', you will join a local channel. See also: console %{help=chattr}%{+m|m} ### %bchattr%b [flags] [channel] This lets you view and change the flags for a user. For example, to give Lamer the p and f flags: .chattr Lamer +pf To remove Denali from the global op list: .chattr Denali -o You may also do any combination of the above: .chattr Fred1 -m+xj-o You can also change the flags for Usagi on a specific channel by supplying the channel after the attributes: .chattr Usagi -m+dk-o #blah Changing global and channel specific flags within the same command line is also possible (global +f, +o #lamer): .chattr Bill f|o #lamer Whether or not you change any flags, it will show you the user's attributes afterwards. To get a list of all possible flags, see %b'.help whois'%b. %bNOTES:%b Only the owner may add or remove the 'n' (owner), 'm' (master) or 't' (botnet master) flags. It is pointless to -n a permanent owner. You must remove the permanent owner in the config file. See also: whois, botattr %{help=chhandle}%{+t} ### %bchhandle%b Changes the handle of a user. For example, to change the handle of user 'gavroche' to 'jamie', you would use 'chhandle gavroche jamie'. See also: chpass %{help=chpass}%{+t} ### %bchpass%b [newpassword] Changes a user's password. If you do not specify the new password, the user effectively no longer has a password set. A password is needed to get ops, join the party line, etc. %bNOTE:%b In previous versions, setting a password to "nopass" would clear a user's password -- with encrypted passwords. This no longer works! See also: chhandle %{help=comment}%{+m} ### %bcomment%b Creates or changes the comment field for a user. The comment field can only be seen via 'whois' or 'match'. Non-masters cannot see the comment field. %{help=console}%{+to|o} ### %bconsole%b [channel] [modes] Changes your console level so that you will see only the types of console messages that you want to. Your current console channel is the channel (that the bot is on) from which you can view from the party line, and which channel-specific commands (like 'say' and 'op') take affect on. Valid flags are: %bj%b joins, parts, quits, and netsplits on the channel %bk%b kicks, bans, and mode changes on the channel %bm%b private msgs, notices and ctcps to the bot %bp%b public text on the channel %bs%b server connects, disconnects, and notices %{+m} Masters only: %bb%b information about bot linking and userfile sharing %bd%b misc debug information %bc%b commands %bo%b misc info, errors, etc (IMPORTANT STUFF) %bw%b wallops (make sure the bot sets +w in init-server) %{+n} Owners only (these have to be enabled in the config file via "set raw-log"): %bh%b raw share traffic %br%b raw incoming server traffic %bt%b raw botnet traffic %bv%b raw outgoing server traffic There are also 8 user-defined console modes ('1' through '8'). %{+o|o} The mode can also be a modifier like '+p' or '-jk' or '+mp-b'. If you omit the channel and modes, your current console channel and flags will be shown. %{+m|m} ### %bconsole%b [channel] [modes] This is used to set the console level of another user. This can even be used on users who normally would not be able to set their own console mode. %{help=dccstat}%{+m} ### %bdccstat%b Displays a table-format list of all "dcc" connections in use on the bot. Dcc stands for "Direct Client-to-client Communication", and Eggdrop expands this to cover every open socket. Any type of network connection to the bot is considered a "dcc" connection. The headings of the table are: %bSOCK%b the socket number of this connection (always unique) %bADDR%b the ip address mask of the host the bot is connected to, if applicable %bPORT%b the port number being used for this connection %bNICK%b the handle of the user or bot, if applicable %bHOST%b the hostname corresponding to the IP address, if available %bTYPE%b the type of dcc connection (see below) The types of connections currently possible are as follows (but more are being added all the time): %bCHAT%b dcc-chat partyline user %bPASS%b user entering dcc chat (being asked for password) %bSEND%b user sending a file %bGET%b sending a file to a user %bGETP%b pending get (waiting for the user to acknowledge) %bLSTN%b telnet listening port (in place of a hostname, it will show the callback procedure name, or a mask of acceptable handles) %bT-IN%b incoming telnet user (being asked for handle) %bFILE%b user in dcc-chat file area %bBOT%b connected bot (botnet connection) %bBOT*%b pending bot link (waiting for acknowledgement) %bRELA%b user in relay connection to another bot %b>RLY%b bot being relay'd to (one for each "RELA") %bCONN%b pending telnet connection (chat, relay, bot-link, etc) %bNEW%b new user via telnet (entering a handle) %bNEWP%b new user via telnet (entering a password) In addition, 'CHAT' and 'BOT' have flags listed for each connection. Capital letters mean that the flag is on, and lowercase letters mean that the flag is off. The flags for 'CHAT' are: %bC%b in file area, but allowed to return to party line %bP%b party line access only %bT%b telnet connection (instead of dcc chat) %bE%b echo is on %bP%b paging is on The flags for 'BOT' are: %bP%b ping sent, waiting for reply %bU%b user-file sharing is active %bC%b local bot initiated the connection %bO%b user-file offered, waiting for reply %bS%b in the process of sending the user-file %bG%b in the process of getting the user-file %bW%b warned this bot to stop hubbing %bL%b leaf-only bot (not allowed to be a hub) %bI%b bot is currently in the 'linking' stage %bA%b bot is being aggressively shared with For 'CHAT' users, the party-line channel is also listed. %{help=debug}%{+m} ### %bdebug%b Display a dump of memory allocation information, assuming the bot was compiled with memory debugging. It's useless to anyone but developers trying to find memory leaks. %{help=echo}%{-} ### %becho%b Specifies whether you want your messages echoed back to you. If it's on, then when you say something on the party line, it will be displayed to you just like everyone else will see it. If it's off, then it won't happen. %{help=die}%{+n} ### %bdie%b [reason] This kills the bot. The bot goes offline immediately, logging who issued the 'die' command. You shouldn't have to use this too often. If you specify a reason, it is logged, otherwise the reason is "authorized by ". eggdrop1.6.19/help/msg/0000775000076400007640000000000011002271500013770 5ustar guppyguppyeggdrop1.6.19/help/core.help0000664000076400007640000001671610056752403015035 0ustar guppyguppy%{help=help}%{-} DCC commands for %B, %V: For all users: %bwho away quit whom%b %bme page match motd%b %bbots newpass chat handle%b %bwhoami echo strip su%b %btrace fixcodes bottree vbottree%b %bbotinfo relay -host%b %{o|o} For ops: %baddlog console match whois%b %{+t} For botnet masters: %b+bot botattr chhandle chpass%b %b+host -bot link chaddr%b %bboot unlink banner dccstat%b %{+m|m} For channel masters: %bchattr save backup reload%b %bstatus traffic uptime%b %{+m} For global masters: %b+user +ignore comment binds%b %bignores -user -ignore dccstat%b %bdebug rehash restart module%b %{+n} For owners: %bdie simul loadmod unloadmod%b %blanguage set tcl rehelp%b %bmodules +lang -lang +lsec%b %b-lsec lstat relang ldump%b %{-} All commands begin with '.', and all else goes to the party line. %{+m} Text starting with ',' is sent ONLY to bot-masters. %{-} You can get help on individual commands: %b'.help '%b. %{+n} Extra help relating to loaded modules may be obtained by typing %b'.help module'%b. Possible modules include: %bassoc channels compress console ctcp%b %bfilesys irc notes seen server%b %bshare transfer uptime wire%b %{-} You may receive a list of commands provided by all loaded modules by using %b'.help all'%b. If you only remember a part of the command's name you are searching for, just use wildcards (e.g. %b'.help *bot*'%b), and all matching help texts will be displayed. %{help=partyline}%{-} %B party-line commands: %b.quit%b Use this command to leave the party line. %b.whom%b [channel] Shows a list of all users on the party line, or on a particular channel. %b.whom *%b Shows a list of all users, indicating which ones are on the party line. %b.chat%b Makes you leave the main partyline channel and join a specific channel (valid channels are 1 to 99999, channel 0 is the party line). %b.me%b Preform an action to the party line. %b.handle%b Changes your nick on party line. %b.help%b Shows more help on a specific command. See '%b.help all%b' for a complete list of commands. All commands begin with '.', and all else goes to the party line. %{+m} Text starting with ',' is sent ONLY to bot-masters. %{help=common}%{+o|o} ### %bcommon (the +c 'common' flag)%b Sometimes a lot of people use IRC from the same account, for example, a public telnet site, where many people can have the same user@host. For that reason, they can't use a traditional user record because they will appear to all be the same user. In such cases, create a user record for the account, and set it +c, or "common access", via the chanset command. Marking it as "common access" means that it shouldn't be used as a definitive address. When someone introduces themselves to the bot (i.e. by /msg "hello") and matches as a +c user, they will be given a new user record which identifies them BY NICKNAME. Obviously, people with that kind of user record shouldn't be given much special access, as when they change nicknames the bot will identify them as someone else. See also: chattr, whois %{help=+lang}%{+n} ### %b+lang%b Adds a new language to the top of the language list. All sections are rechecked to test if there are language files supporting the language. See also: -lang, +lsec, -lsec, lstat, relang %{help=-lang}%{+n} ### %b-lang%b Removes a language from the language list. If possible, the next available language will be loaded. See also: +lang, +lsec, -lsec, lstat, relang %{help=+lsec}%{+n} ### %b+lsec%b
Adds a new language section. The bot tries to load the section with the preferred language if possible. See also: -lang, +lang, -lsec, lstat, relang %{help=-lsec}%{+n} ### %b-lsec%b
Removes a language section. The language bindings are not removed, however. See also: +lang, -lang, +lsec, lstat, relang %{help=lstat}%{+n} ### %blstat%b Shows the language statistics: all selected languages and a list of all language sections. See also: +lang, -lang, +lsec, -lsec, relang %{help=ldump}%{+n} ### %bldump%b Dumps all language data to the partyline. See also: +lang, -lang, +lsec, -lsec, relang, lstat %{help=relang}%{+n} ### %brelang%b Try to find language files with a more preferred language than right now. See also: +lang, -lang, +lsec, -lsec, lstat %{help=tcl}%{+n} ### %btcl%b Executes the specified Tcl command. See doc/tcl-commands.doc for details on Tcl commands added to Eggdrop, and visit http://tcl.activestate.com/ for more information on Tcl. %{help=set}%{+n} ### %bset%b [value] Changes the values of config-file settings of the bot, or, if used without a value parameter, shows the current value of a setting. Any config file setting changed with this command will be reset when the config file is reloaded. Here are the variables that can be modified with this command (note that other modules can add variables): %{cols=4} botnet-nick userfile motd paranoid-telnet-flood my-ip telnet-banner admin use-telnet-banner temp-path notify-newusers owner my-hostname nat-ip dcc-sanitycheck network whois-fields username version firewall telnet-flood ignore-time dcc-flood-thr hourly-updates connect-timeout resolve-timeout dupwait-timeout require-p keep-all-logs open-telnets stealth-telnets handlen reserved-portrange console default-flags log-time max-logsize quick-logs logfile-suffix quiet-save sort-users die-on-sighup die-on-sigterm remote-boots max-dcc max-logs protect-telnet ident-timeout share-unlinks allow-dk-cmds userfile-perm switch-logfiles-at %{end} Use %b'.help set '%b for more info on each variable. %{help=all}%{-} ### %bcore%b commands For all users: %bwho away quit whom%b %bme page match motd%b %bbots newpass chat handle%b %bwhoami echo strip su%b %btrace fixcodes bottree vbottree%b %bbotinfo relay -host%b %{o|o} For ops: %baddlog console match whois%b %{+t} For botnet masters: %b+bot botattr chhandle chpass%b %b+host -bot link chaddr%b %bboot unlink banner dccstat%b %{+m|m} For channel masters: %bchattr save backup reload%b %bstatus traffic uptime%b %{+m} For global masters: %b+user +ignore comment binds%b %bignores -user -ignore dccstat%b %bdebug rehash restart module%b %{+n} For owners: %bdie simul loadmod unloadmod%b %blanguage set tcl rehelp%b %bmodules +lang -lang +lsec%b %b-lsec lstat relang ldump%b eggdrop1.6.19/help/set/0000775000076400007640000000000011002271500013775 5ustar guppyguppyeggdrop1.6.19/help/set/cmds1.help0000664000076400007640000002622310304503110015662 0ustar guppyguppy%{help=set botnet-nick}%{+n} ### %bset botnet-nick%b If you want to use a different nickname on the botnet than you use on IRC (i.e. if you're on an un-trusted botnet), set this setting to the nick you would like to use. %{help=set userfile}%{+n} ### %bset userfile%b Specify here the filename your userfile should be saved as. %{help=set motd}%{+n} ### %bset motd%b The MOTD (Message Of The day) is displayed when people dcc chat or telnet to the bot. Look at doc/TEXT-SUBSTITUTIONS for options. %{help=set telnet-banner}%{+n} ### %bset telnet-banner%b This banner will be displayed on telnet connections. Look at doc/TEXT-SUBSTITUTIONS for options. %{help=set admin}%{+n} ### %bset admin%b This setting defines which contact person should be shown in .status, /msg help, and other places. You really should include this information. %{help=set temp-path}%{+n} ### %bset temp-path%b Set here a place to store temporary files. %{help=set notify-newusers}%{+n} ### %bset notify-newusers%b Who should a note be sent to when new users are learned? %{help=set owner}%{+n} ### %bset owner%b This is a list of owners of the bot. %{help=set my-hostname}%{+n} ### %bset my-hostname%b Set this if Eggdrop has trouble detecting its hostname. %{help=set my-ip}%{+n} ### %bset my-ip%b If you're using virtual hosting (your machine has more than 1 IP), you may want to set this to a particular IP to bind to. %{help=set nat-ip}%{+n} ### %bset nat-ip%b If you have a NAT firewall (you box has an IP in one of the following ranges: 192.168.0.0-192.168.255.255, 172.16.0.0-172.31.255.255, 10.0.0.0-10.255.255.255 and your firewall transparently changes your address to a unique address for your box) or you have IP masquerading between you and the rest of the world, and /dcc chat, /ctcp chat or userfile sharing aren't working, enter your outside IP here. This IP is used for transfers only, and has nothing to do with the my-ip or my-hostname settings. You may still need to set my-ip and/or my-hostname. %{help=set dcc-sanitycheck}%{+n} ### %bset dcc-sanitycheck%b <0/1> This setting will make the bot ignore DCC chat requests which appear to have bogus information on the grounds that the user may have been trying to make the bot connect to somewhere that will get it into trouble, or that the user has a broken client, in which case the connect wouldn't work anyway. %{help=set network}%{+n} ### %bset network%b This setting is used only for info to share with others on your botnet. Set this to the IRC network your bot is connected to. %{help=set whois-fields}%{+n} ### %bset whois-fields%b Enter all user-defined fields that should be displayed in a '.whois'. This will only be shown if the user has one of these extra fields. You might prefer to comment this out and use the userinfo1.0.tcl script which provides commands for changing all of these. %{help=set username}%{+n} ### %bset username%b This setting defines the username the bot uses on IRC. This setting has no effect if an ident daemon is running on your bot's machine. %{help=set version}%{+n} ### %bset version%b Current bot version - "1.1.2+pl1 1010201 pl1"; first item is the text version, second item is a numerical version, and any following items are the names of patches that have been added. %{help=set firewall}%{+n} ### %bset firewall%b Set this to your socks host if your Eggdrop sits behind a firewall. If you use a Sun "telnet passthru" firewall, prefix the host with a '!'. %{help=set telnet-flood}%{+n} ### %bset telnet-flood%b Define here how many telnet connection attempts in how many seconds from the same host constitute a flood. The correct format is Attempts:Seconds. %{help=set paranoid-telnet-flood}%{+n} ### %bset paranoid-telnet-flood%b <0/1> If you want telnet-flood to apply even to +f users, set this setting to 1. %{help=set ignore-time}%{+n} ### %bset ignore-time%b