procedure TForm1.FormCreate(Sender: TObject);
begin
IdIRC1.Nick := '
Testuser';
IdIRC1.Host := '
irc.*****.com';
IdIRC1.Port := 6667;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
IdIRC1.Connect();
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
IdIRC1.Join('
#test');
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
IdIRC1.Say('
#test',Edit1.Text);
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
IdIRC1.Quit('
Haut mal ab');
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
idirc1.Disconnect;
end;
procedure TForm1.IdIRC1Message(Sender: TObject; AUser: TIdIRCUser;
AChannel: TIdIRCChannel; Content:
String);
begin
RichEdit1.Lines.Add('
[' + AUser.Nick + '
]: ' + Content);
end;
procedure TForm1.IdIRC1Send(Sender: TObject; ACommand:
String);
begin
RichEdit1.Lines.Add(ACommand);
end;
procedure TForm1.IdIRC1Join(Sender: TObject; AUser: TIdIRCUser;
AChannel: TIdIRCChannel);
var
i:integer;
begin
for i := 0
to IdIRC1.Users.Count
do
begin
ListBox1.Items.Add(AUser.Nick);
end;
end;
procedure TForm1.IdIRC1Receive(Sender: TObject; ACommand:
String);
begin
RichEdit1.Lines.Add(Acommand)
end;