Home  |   News  |   Screen Shots  |   Downloads  |   Plugins & Scripts  |   Developer Tools  |   IRC Articles

General Info
Bersirc Features
Bersirc Source
Bersirc FAQ
IRC Articles
Promote Bersirc
About the Team
Feedback

IRC Networks
EFnet (Primary)
IRCNet
Undernet
Dalnet
Kids IRC
Other networks

Alternatives
Windows: mIRC
Windows: ViRC
Windows: Pirch
Windows: Xircon

Non-Windows
All: X-Chat
All: BitchX
Unices: KVIrc
Unices: ircII-EPIC
Mac: IRCle
WinCE: Irc CE
BeOS: Bowser

Other Content
IRC Help
Operators Guide
IRC Channels
IRC Help
IRC Protocol
IRCNumeric Help


Comments, complaints, insults? E-Mail us!

  

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



Copyright © 1999-2003 Jamie Frater. All rights reserved.