Evo koda:
program Project1;
uses
IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdIRC,dialogs,sysutils;
type
TConnection = class(TObject)
Client: TIdIRC;
procedure ClientOnRaw(Sender: TObject; AUser: TIdIRCUser; ACommand,
AContent: String; var Suppress: Boolean);
private
public
constructor Create;
destructor Destroy; override;
end;
var
con: TConnection;
f:integer;
procedure TConnection.ClientOnRaw(Sender: TObject; AUser: TIdIRCUser; ACommand,
AContent: String; var Suppress: Boolean);
begin
ShowMessage('aaaa');
end;
constructor TConnection.Create;
begin
Client:=TIdIRC.Create(nil);
Client.Port:=6667;
client.host:='irc.kravakazemoo.com';
Randomize;
Client.Nick:='krava';
Client.Password:='muuuu';
Client.OnRaw:=Self.ClientOnRaw;
Client.Username:='mesokombinat';
Client.RealName:= 'Belka';
end;
destructor TConnection.Destroy;
begin
inherited;
Client.FRee;
end;
begin
con:=TConnection.Create;
con.Client.Connect;
f:=0;
repeat
sleep(0);
until
f=1;
end.