# Eggdrop Bot

**Category:** Eggdrop_Bot
**Original Author:** Robey Pointer (robey@acolyte.slip.netcom.com)

## Description
Eggdrop is a highly customizable IRC bot written in C, designed to protect channels from takeovers and manage users with various access levels. It includes extensive channel protection features, user management, and automation capabilities.

## Key Features
- **Channel Protection:** Permanent ban lists with comments.
- **User Management:** User records saved on disk with passwords, hostmasks, and flags.
- **Access Control:** Customizable access levels for users.
- **Party Line:** Intercepts text from party-line users and sends it to local users only.
- **TCL Scripting:** Extensive TCL bindings for commands and events.
- **Mode Changes:** Queue and flush mode changes made by the bot.
- **Message Handling:** Handles messages, notices, and CTCP requests.

## File Analysis
- **chan.c** — handles channel manipulation and status reporting.
- **chan.h** — header file for chan.c containing data structures and definitions.
- **chanprog.c** — handles server list maintenance, revenge punishment, timers, and tcl script initialization.
- **chanset.c** — manages low-level channel and chanset operations.
- **cmds.c** — processes commands from users via DCC sockets.
- **cmdt.h** — defines command types for TCL bindings.
- **dcc.c** — handles activity and disconnects on DCC connections.
- **dccutil.c** — provides functions to send formatted text over various connections, including `.who`, `.whom`, and `.dccstat`.
- **eggdrop.h** — compile-time settings and configuration options.
- **english.h** — contains strings for file area operations.
- **filedb.c** — handles low-level filesystem database manipulation and remote requests.
- **fileq.c** — manages the file queue, listing files on the queue, sending queued files, and canceling them.
- **files.c** — handles all file system commands.
- **files.h** — defines structures for file database per directory.
- **gotdcc.c** — processes incoming CTCP DCCs (chat, send), flood checking, and booting users from dcc chat.
- **hash.c** — handles non-Tcl procedure lookups and Tcl bindings to msg/dcc/file commands.
- **hash.h** — default bindings for TCL hash-tables.
- **main.c** — handles changing nicknames, flood detection, signal handling, telnet code translation, command line arguments, connecting to a server, and interpreting server responses.
- **match.c** — implements wildcard matching functions.
- **mem.c** — manages memory allocation and deallocation.
- **misc.c** — handles string operations, logging, output queueing for the bot, resync buffers, help system, MOTD display, and note system.
- **mode.c** — queues and flushes mode changes made by the bot, channel mode changes, and reactions to them.
- **msgcmds.c** — handles all commands entered via /MSG.
- **msgnotice.c** — processes messages and notices from users or channels, simple CTCP requests and replies.
- **net.c** — net functions especially for bots.
- **proc.c** — process handling for eggdrop.
- **proto.h** — prototypes for every function used outside its own module.
- **tandcmd.c** — handles commands that come across the botnet and userfile transfer commands from sharebots.
- **tandem.c** — keeps track of tandem-bots in the chain, channel name associations on the party line, rejecting a bot, linking, unlinking, and relaying to another bot.
- **tcl.c** — handles TCL command additions, Tcl initialization, and getting/setting TCL/eggdrop variables.
- **tclegg.h** — defines types of commands for TCL bindings.
- **tclhash.c** — handles binding and unbinding, checking and triggering bindings, and listing current bindings.
- **thread.c** — Linux threading support.
- **userrec.c** — adds and removes bans and ignores, lists bans and ignores, auto-linking bots, sending/receiving userfiles from a bot, listing users, and reading the user file.
- **users.c** — tests and enforces bans and ignores, adding/removing bans and ignores, listing bans and ignores, auto-linking bots, sending/receiving userfiles, listing users, and reading the user file.
- **users.h** — structures and definitions used by users.c and userrec.c.
- **dcc.save** — saves the entire user list to disk for safety.
- **compat.tcl** — implements old '+friend' commands for compatibility with older versions of eggdrop.
- **console.tcl** — saves a user's console when they leave, restores it on return.
- **gainops1.tcl** — sends and handles requests for ops from other tandem bots on the same channel.
- **local.tcl** — intercepts text starting with ' from party-line users and sends to local users only.
- **ques3.tcl** — creates an HTML file every 5 minutes showing people currently on the channel, their user@hosts, who's an op, and who's idle.
- **samples.tcl** — adds example TCL commands for extending eggdrop.
- **toolkit.tcl** — provides useful Tcl procedures for script packages.
- **README** — documentation for Eggdrop.
- **FEATURES** — features of Eggdrop.
- **Makefile** — build instructions.
- **Makefile.in** — default Makefile configuration.
- **UPDATES** — changes in eggdrop.
- **botchk** — checks if the bot is running and starts it back up if needed.
- **config.h.in** — header file for configuration options.
- **configure** — GNU configure script to generate Makefiles.
- **eggdrop.doc** — documentation for Eggdrop.
- **eggstat** — utility to dump statistics about userfile.
- **lamestbot** — sample configuration file for the bot.