Thema: Delphi Chat with IdIrc

Einzelnen Beitrag anzeigen

dangerduck

Registriert seit: 14. Dez 2008
39 Beiträge
 
#1

Chat with IdIrc

  Alt 14. Dez 2008, 17:22
Ich deutch nicht verstehe and schprahe good
So please write posts in english
I have an program in delphi who has to connect to an irc channel and chat with him my problem is how to recive message from channel and how to recognize recived messages. I know to send messages and connect on irc but reciving is a problem...
I try to download indy 10 but it give me an error
please if you have it send me
my msn is : dangerduck.1337@gmail.com

and code :

Delphi-Quellcode:
unit Unit5;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
  IdCmdTCPClient, IdIRC, IdContext, ExtCtrls, shellapi, GIFImg;

type
  TForm5 = class(TForm)
    IdIRC1: TIdIRC;
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure IdIRC1Join(ASender: TIdContext; ANickname, AHost,
      AChannel: string);
    procedure IdIRC1DCCChat(ASender: TIdContext; ANickname, AHost: string;
      APort: Integer);
    procedure IdIRC1PrivateMessage(ASender: TIdContext; const ANicknameFrom,
      AHost, ANicknameTo, AMessage: string);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form5: TForm5;
  x:integer;
implementation

{$R *.dfm}




procedure TForm5.FormCreate(Sender: TObject);
begin
IdIRC1 := TIdIRC.Create(nil);
  IdIRC1.Host := 'irc.darkmyst.org';
  IdIRC1.Port := 6667;
  IdIRC1.Nickname := 'DDbot';
   idIRC1.AltNickname := 'DDbot2';
    idIRC1.AltNickname := 'DDbot3';
     idIRC1.AltNickname := 'DDbot4';
       idIRC1.AltNickname := 'DDbot5';
         idIRC1.AltNickname := 'DDbot6';
           idIRC1.AltNickname := 'DDbot7';
             idIRC1.AltNickname := 'DDbot8';
               idIRC1.AltNickname := 'DDbot9';
                 idIRC1.AltNickname := 'DDbot10';
  IdIRC1.Username := 'DDbot';
  IdIRC1.RealName := 'DDbot';
  While not IdIRC1.Connected=true Do
  Begin
    IdIRC1.Connect;
    If not IdIRC1.Connected=true Then
    sleep(500);
  End;
x:=0;
repeat
inc(x);
IdIRC1.Join('#DDbot','');
sleep(5000);
until x=3;
end;

procedure TForm5.IdIRC1Join(ASender: TIdContext; ANickname, AHost,
  AChannel: string);
begin
IdIRC1.Say('#DDbot', 'Zdravo');
end;





end.
Bitte helfen
und einen schönen Gruß aus Slowenien
  Mit Zitat antworten Zitat