# Eggdrop 1.6.6 Source Code

**Category:** Eggdrop_Bot
**Original Author:** Unknown

## Description
Eggdrop is a bot for IRC that provides automated services such as channel management, user tracking, and network communication. It supports various commands and automations to manage channels, users, and server interactions.

## Key Features
- **Commands and Automations**: Supports various commands like `.resolve`, `.whois`, and `.match` for channel and user information.
- **Channel Management**: Manages channel modes, bans, and op rights.
- **User Tracking**: Tracks and manages user flags and ignores.
- **Network Communication**: Handles server connections and communication with other bots on the network.

## File Analysis
- **acconfig.h** — template file for autoheader configuration.
- **mod.irc** — module providing basic IRC support, including loading commands.
- **action.fix.tcl** — fixes for handling `/me` actions in different contexts.
- **alltools.tcl** — includes various tools and scripts used by the bot.
- **cmd_resolve.tcl** — command to resolve hostnames or IP addresses without blocking.
- **compat.tcl** — compatibility script mapping old functions to new ones.
- **getops.tcl** — script for requesting and giving ops to other bots in a botnet.
- **klined.tcl** — handles k-lines by removing servers from the bot's list when detected.
- **notes2.tcl** — manages notes and information about users.
- **ques5.tcl** — handles web file indexing and retrieval.
- **sentinel.tcl** — flood protection system with integrated BitchX CTCP simulation.
- **userinfo.tcl** — provides user information and URL conversion for HTML output.
- **bg.c** — background process handling, ensuring threads are happy while moving to the background.
- **bg.h** — header file for background process support.
- **botcmd.c** — handles commands from the botnet and userfile transfer.
- **botmsg.c** — formats messages sent on the botnet and sends different messages based on versioned bots.
- **botnet.c** — manages botnet connections, channel name associations, and pinging of bots.
- **chan.h** — common header file for channel management.
- **chanprog.c** — handles server list maintenance, revenge punishment, timers, and tcl script loading.
- **cmds.c** — handles commands from users via DCC.
- **cmdt.h** — command type definitions.
- **dcc.c** — handles activity on DCC sockets.
- **dccutil.c** — utility functions for sending formatted text over various connections.
- **dns.c** — DNS resolve calls and events, providing fallback code if the DNS module is not loaded.
- **dns.h** — header file for DNS support.
- **eggdrop.h** — compile-time settings for Eggdrop.
- **flags.c** — flag matching and conversion functions.
- **flags.h** — header file for flags.
- **language.c** — handles language support.
- **main.c** — core event handling, signal handling, command line arguments, context and assert debugging.
- **main.h** — main include file.
- **match.c** — wildcard matching functions.
- **mem.c** — memory allocation and deallocation.
- **misc.c** — logging, queueing output, help system, motd display, and %var substitution.
- **misc_file.c** — copyfile() and movefile() functions.
- **misc_file.h** — header file for misc_file.c.
- **modules.c** — support for modules in Eggdrop.
- **modules.h** — header file for module support.
- **net.c** — handles raw network i/o.
- **patch.h** — header file for adding patches to Eggdrop's version string.
- **proto.h** — prototypes for functions used outside their own modules.
- **rfc1459.c** — RFC 1459 compliant IRC protocol handling.
- **stat.h** — file attributes.
- **tandem.h** — header file for tandem support.
- **tcl.c** — handles Tcl commands and initialization.
- **tcldcc.c** — Tcl stubs for DCC commands.
- **tclegg.h** — header file used by tcl.c and tclhash.c.
- **tclhash.c** — handles bindings, procedures lookups, and Tcl binding internal procedures.
- **tclhash.h** — header file for tclhash.c.
- **tclmisc.c** — Tcl stubs for file system commands and other non-Tcl commands.
- **tcluser.c** — Tcl stubs for user-record-oriented commands.
- **userent.c** — user entry handling, more versatile.
- **userrec.c** — functions to find and change user records, flag changes.
- **users.c** — handles ignores, userfile transfer, `.whois` and `.match`.
- **users.h** — structures and definitions used by users.c and userrec.c.