# Eggdrop 1.0s Bot

**Category:** Eggdrop_Bot
**Original Author:** Robey Pointer

## Description
Eggdrop is an IRC bot written in C that provides comprehensive channel protection, user management, and automation features. It runs unattended and can be configured to handle various IRC commands and events.

## Key Features
- **Channel Protection**: Permanent ban list storage with comments.
- **User Records Management**: User passwords (encrypted), hostmasks, access flags.
- **Automatic User Learning**: Users can /MSG the bot "hello" for automatic access.
- **Text/Join/Kick/Ops Automation**: Handles various IRC commands and events.
- **File Service/XDCC Support**: Provides file serving and XDCC services.

## File Analysis
- **bf_tab.h** — Blowfish P-box and S-box tables for encryption.
- **blowfish.c** — Handles password encryption and decryption using the Blowfish algorithm.
- **botcmd.c** — Manages commands that come across the botnet, including userfile transfer and update commands from sharebots.
- **botnet.c** — Tracks connected bots in the chain, manages channel name associations on the party line, and handles bot rejection and linking.
- **chan.c** — Handles almost everything related to channel manipulation, including telling channel status, 'who' responses, and user kickban operations.
- **chan.h** — Defines common structures used by chan.c and mode.c.
- **chanprog.c** — Manages server lists, revenge punishment, timers, and Tcl script initialization.
- **chanset.c** — Handles low-level channel and chanset manipulation, including channel pointers to the userrec cache and check for expired channels.
- **cmds.c** — Processes commands from users via DCC connections.
- **cmdt.h** — Defines command structures used by various modules.
- **dcc.c** — Manages activity on DCC sockets and disconnects.
- **dccutil.c** — Handles formatted text sending to varying types of connections, '.who', '.whom', and '.dccstat' code, and memory management for DCC structures.
- **eggdrop.h** — Contains compile-time settings and defines various macros and constants.
- **english.h** — Provides English language strings used in the bot's output.
- **filedb.c** — Manages low-level filesystem database files and handles remote file requests.
- **fileq.c** — Adds, removes, lists, sends, and cancels queued files for users.
- **files.c** — Handles all file system commands.
- **files.h** — Defines the structure of the file database (per directory).
- **gotdcc.c** — Processes incoming CTCP DCC requests, manages flood checking, and boots users from dcc chat.
- **hash.c** — Manages procedure lookups for msg/dcc/file commands and Tcl binding internal procedures to those commands.
- **hash.h** — Default bindings loaded into the Tcl hash-tables.
- **main.c** — Handles nickname changes, flood detection, signal handling, command line arguments, connecting to a server, and interpreting server responses.
- **match.c** — Implements wildcard matching functions for various purposes.
- **mem.c** — Manages memory allocation and deallocation, tracking what memory is being used by whom.
- **misc.c** — Handles string operations, logging, queueing output, resync buffers for sharebots, help system, and MOTD display with %var substitution.
- **mode.c** — Queues and flushes mode changes made by the bot, handles channel mode changes, and sets/get current wanted channel modes.
- **msgcmds.c** — Manages all commands entered via /MSG.
- **msgnotice.c** — Handles messages and notices from users or channels, including simple CTCP requests and replies.
- **net.c** — Manages raw network I/O.
- **notes.c** — Reads and sends notes, kills old notes, and changes destinations.
- **proto.h** — Contains function prototypes for various modules.
- **tandem.h** — Tracks tandem-bots in the chain, channel associations, and party-line members.
- **tcl.c** — Manages Tcl commands added to Eggdrop, Tcl initialization, and getting/setting Tcl/eggdrop variables.
- **tclchan.c** — Handles Tcl stubs for channel-oriented commands.
- **tcldcc.c** — Handles Tcl stubs for DCC commands.
- **tclegg.h** — Defines types of commands used by tcl.c and tclhash.c.
- **tclhash.c** — Manages binding, unbinding, checking, triggering, and listing current bindings.
- **tclmisc.c** — Handles Tcl stubs for file system commands and other miscellaneous functions.
- **tcluser.c** — Handles Tcl stubs for user-record-oriented commands.
- **userrec.c** — Manages adding, deleting, and changing user records.
- **users.c** — Tests and enforces bans and ignores, adds/removes bans/ignores, lists bans/ignores, auto-links bots, sends/receives a userfile from a bot, and lists users.
- **users.h** — Defines structures and constants used by users.c and userrec.c.
- **dcc.save** — Script to save the entire user list when exiting.
- **action.fix.tcl** — Implements '.me' actions for DCC chat.
- **compat.tcl** — Scripts to implement old '+friend' commands for compatibility with older Eggdrop versions.
- **console.tcl** — Saves and restores a user's console mode on exit.
- **dike.tcl** — Detects floodnets by checking recent message history.
- **gainops1.tcl** — Sends and handles requests for ops to other tandem bots on the same channel.
- **local.tcl** — Intercepts text from party-line users and sends it locally.
- **ntalk.irc** — Script to talk to an Eggdrop bot in DCC chat.
- **ques3.tcl** — Creates HTML files showing current channel occupants, their user@hosts, ops status, and idle times.
- **samples.tcl** — Examples of extending Eggdrop with Tcl scripts.
- **toolbox.tcl** — Useful procedures for use in Tcl scripts.
- **toolkit.tcl** — Additional Tcl procedures for script packages.
- **wire.tcl** — Secondary encrypted communications on a botnet.
- **README** — Instructions and information about compiling and using Eggdrop.
- **COPYING** — User license document, GNU GPL v2.
- **FEATURES** — List of features provided by Eggdrop.
- **CONTENTS** — Directory structure and file descriptions.