# Eggdrop Bot

**Category:** Eggdrop_Bot
**Original Author:** Robey Pointer (Unknown)

## Description
This is a version of the Eggdrop IRC bot from around 1996-2000, designed to protect channels and manage users with various access levels. It includes extensive channel protection features, user management, and automation for text, join, kick, and op actions.

## Key Features
- **Channel Protection:** Permanent ban lists with comments.
- **User Management:** User records saved on disk, configurable access flags.
- **Automated Actions:** Text sending, joining, kicking, and op managing.
- **File Services:** File serving (fserve) and XDCC services.
- **Tcl Scripting:** Extensive use of Tcl for command bindings and scripting.

## File Analysis
- **chan.c** — Handles channel manipulation, user bans, and status updates.
- **chan.h** — Header file defining structures used in `chan.c`.
- **chanprog.c** — Manages server lists, revenge punishments, timers, and initializations.
- **chanset.c** — Low-level channel and chanset management.
- **cmds.c** — Handles commands from users via DCC connections.
- **cmdt.h** — Defines command types used in the bot.
- **dcc.c** — Manages DCC socket activity and disconnects.
- **dccutil.c** — Functions for sending formatted text over various connections, including `.who`, `.whom`, and `.dccstat`.
- **eggdrop.h** — Compile-time settings and defines for the bot.
- **english.h** — String definitions used in file operations.
- **filedb.c** — Handles filesystem database manipulation and remote requests.
- **fileq.c** — Manages file queueing, listing, sending, and cancellation.
- **files.c** — Handles all file system commands.
- **files.h** — Structure for the file database.
- **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.
- **hash.h** — Default bindings to load into Tcl hash-tables.
- **main.c** — Main entry point for the bot, handling nick changes, flood detection, signal handling, and command line arguments.
- **match.c** — Wildcard matching functions used in bans and ignores.
- **mem.c** — Memory allocation and deallocation tracking.
- **misc.c** — Handles string operations, logging, queueing output, help system, MOTD display, and note systems.
- **mode.c** — Manages channel modes and bot reactions to them.
- **msgcmds.c** — Handles all commands entered via `/MSG`.
- **msgnotice.c** — Processes msgs and notices from users or channels, simple CTCP requests and replies.
- **net.c** — Network functions especially for bots.
- **proc.c** — Process handling for the bot, including DCC connections, telnet links, and shell command execution.
- **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 associations, and pinging other bots.
- **tcl.c** — Handles Tcl commands added to the bot, initialization, and variable management.
- **tclegg.h** — Defines types for Tcl command bindings.
- **tclhash.c** — Handles bind/unbind, checking/triggering bindings, and listing current bindings.
- **thread.c** — Linux threading support (not used in this version).
- **userrec.c** — Functions to find and change user records.
- **users.c** — Tests and enforces bans and ignores, adds/removes them, lists them, auto-links bots, sends/receives a userfile from another bot, and reads the user file.
- **users.h** — Structures and definitions used by `users.c` and `userrec.c`.
- **dcc.save** — Script to save the entire user list to disk.
- **compat.tcl** — Scripts for compatibility with old versions of Eggdrop.
- **console.tcl** — Saves and restores a user's console mode when they leave or return.
- **gainops1.tcl** — Sends and handles requests for ops from/to other tandem bots on the same channel.
- **local.tcl** — Intercepts text starting with ' and sends it to local users only.
- **ques3.tcl** — Creates an HTML file showing people currently on a channel, their user@hosts, who's an op, and who's idle.
- **samples.tcl** — Examples of extending Eggdrop with Tcl scripts.
- **toolkit.tcl** — Useful Tcl procs for script packages.
- **README** — General information about the bot.
- **FEATURES** — List of features provided by Eggdrop.
- **Makefile** — Build instructions, not used in this version.
- **Makefile.in** — Template Makefile configuration.
- **UPDATES** — List of updates and changes made to the bot.
- **botchk** — Script for checking if a bot is running and restarting it if necessary.
- **config.h.in** — Configuration header template.
- **configure** — Autoconf script for generating `Makefile`.
- **eggdrop.doc** — Documentation about Eggdrop, not fully completed.
- **eggstat** — Tcl utility to dump statistics on the user file.
- **lamestbot** — Sample configuration file for setting up a bot.
- **motd** — Message of the day file.
- **nets** — List of botnets using Eggdrop.