@chatformat
Description
COMMAND: @chatformat
Per-player channel message formatting attribute. When set, this attribute is evaluated each time a channel message is received, allowing each player to customize how channel messages appear to them.
The following substitutions are available during evaluation:
- %0 - The channel name.
- %1 - The formatted message (including the sender’s name as it would normally appear).
- %2 - The dbref of the sender.
When the @chatformat attribute is not set on a player, there is zero overhead on channel message delivery. The attribute is only evaluated for players who have it set.
Examples
> &chatformat me = [ansi(hc,%0)] %1
Prefixes all channel messages with the channel name highlighted in cyan.
> &chatformat me = [ansi(hw,<[capstr(%0)]>)] %1
Displays channel messages with the channel name capitalized and highlighted in white.
> &chatformat me = [switch(%0,Public,[ansi(hg,<%0>)] %1,Guest,[ansi(hy,<%0>)] %1,%1)]
Uses different colors for different channels.