# ch-relay1.01.tcl

**Category:** mIRC_Bot
**Original Author:** shred (shreder@tsu.tmn.ru)

## Description
This script automates the process of relaying messages between IRC channels across multiple bots, allowing for synchronized channel activity and event handling.

## Key Features
- **Relay Mechanism**: The script defines a set of rules to relay specific types of events (JOIN, PART, NICK, MODE, TOPIC) from one bot to another.
- **Event Handling**: It handles various IRC events such as pubm, act, nick change, mode changes, and topic changes.
- **Priority Management**: Messages can be sent with different priorities (1, 2, or 3).
- **Bot Communication**: Bots communicate via DCC commands for rehashing purposes.

## File Analysis
- **ch-relay1.01.tcl** — The main script file that defines the relay mechanism and event handling logic.
- **cr_modep** — A procedure to determine if a user is an operator or voice in a channel.
- **cr_cansend** — Determines whether a message can be sent based on the specified modes.
- **cr_getpri** — Retrieves the priority of a message based on its mode settings.
- **cr_send2** — Sends messages between two bots based on defined rules and priorities.
- **cr_send** — The main procedure that processes and relays events to other bots.
- **cr_pubm, cr_act, cr_nick, cr_mode, cr_join, cr_part, cr_sign, cr_topc, cr_kick** — Specific event handling procedures for different IRC actions.
- **cr_putx** — Sends messages with a specified priority using putquick, putserv, or puthelp commands.
- **cr_brecive** — Receives and processes messages from other bots.
- **cr_sendrehash** — Handles rehash requests between multiple bots.
- **cr_need** — A procedure to handle specific needs like unban requests.