Changing Channel Captions
How to Change Channel Captions
Article By: Jamie Frater
Article Written: 18th January, 2001
Bersirc has a rather nice event to let you configure channel captions. The event is called OnCaption, and
if you are using the default script, you can find it in events.ops. The event looks like this:
procedure OnCaption(ServerID: Integer; ChanName: String;
UserCount: Integer; Topic, Modes, Key: String;
Limit: Integer);
begin
// user SetCaption to put your own
// caption, and set handled to true
end;
The parameters are:
ServerID: Integer - ID number of the server calling the event
ChanName: String - Name of the channel which is having its caption set
UserCount: Integer; - Total count of users in the channel
Topic: String; - Topic of the channel
Modes: String; - Modes of the channel (for example +stn)
Key: String; - Key of the channel (if channel is +k)
Limit: String; - Total users permitted (if channel is +l)
Using SetCaption, we can change the caption to anything we like. SetCaption is defined as follows:
procedure SetCaption(ServerID: Integer; Window: string;
Caption: string);
For this example, we will make the caption show as:
[irc.something.com] #Something [20 +stnl 34] Topic here
procedure OnCaption(ServerID: Integer; ChanName: String;
UserCount: Integer; Topic, Modes, Key: String;
Limit: Integer);
begin
SetCaption(ServerID, ChanName,
'['+GetServerName(ServerID)+'] '+
ChanName+' ['+IntToStr(UserCount)+' '+Modes+' '+
IntToStr(Limit)+'] '+Topic);
Handled := true;
end;
After making the above changes, save your script and reload it. Voila!
-- Jamie Frater