# mbot - Mirage IRC Bot

**Category:** Standalone_Bot
**Original Author:** Tiago Sousa <mirage@PTlink.net>

## Description
mbot is a standalone IRC bot designed for automated tasks such as channel management, user tracking, and flood detection. It supports various modules that can be loaded to extend its functionality.

## Key Features
- **Text/Join/Kick Automation**: Manages channel events based on predefined rules.
- **Flood Detection**: Detects and limits excessive message flooding in channels.
- **User Tracking**: Tracks the presence of nicks using the `watch` command.
- **Command Handling**: Supports custom commands like `!calc`, `!seen`, and `!invite`.
- **Module System**: Loads and unloads modules to extend functionality dynamically.

## File Analysis
- **acconfig.h** — Configuration settings for various system features.
- **CBot.cpp** — Core bot logic, including server management and logging.
- **CChannel.cpp** — Manages IRC channels, handling join/part/kick events.
- **CList.cpp** — Implements a linked list data structure used throughout the codebase.
- **CLog.cpp** — Handles logging of bot activities to files or other destinations.
- **CModule.cpp** — Loads and manages dynamically loaded modules.
- **CNet.cpp** — Network communication handling, including DCC support.
- **CScript.cpp** — Implements script commands and event handlers.
- **CServices.cpp** — Manages IRC services like NickServ and ChanServ interactions.
- **CString.cpp** — String manipulation utilities.
- **CText.cpp** — Text file reading and processing.
- **config.h** — Configuration settings for the bot, including paths and limits.
- **defines.h** — Defines constants used throughout the codebase.
- **mbot.h** — Main header defining the CBot class and other global variables.
- **missing.h** — Provides missing system functions if not available.
- **utils.h** — Utility functions for string manipulation, time handling, etc.
- **alice.cpp** — A module based on C-ALICE AI framework.
- **calc.cpp** — Implements a simple calculator command.
- **chanstat.cpp** — Creates HTML files with channel status information.
- **extra.cpp** — Adds miscellaneous commands like `!raw` and `!ping`.
- **flood.cpp** — Detects and limits message flooding in channels.
- **invite.cpp** — Allows inviting users to specific channels via private messages.
- **ircop.cpp** — Implements a `!kill` command for IRC operators.
- **joinmsg.cpp** — Sends a file of text to all joining users in specified channels.
- **log.cpp** — Logs privmsgs or channel events from certain nicks.
- **seen.cpp** — Tracks when nicks were last seen by the bot.
- **tcl.cpp** — Implements a subset of Eggdrop's TCL functionality.
- **watch.cpp** — Watches and logs nick activity using IRC `whois` commands.
- **whois.cpp** — Uses external `whois` tools to look up IP information.
- **word.cpp** — Manages a dictionary-like database for words and their definitions.