Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Chat with IdIrc (https://www.delphipraxis.net/125907-chat-idirc.html)

dangerduck 14. Dez 2008 17:22


Chat with IdIrc
 
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 :D
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
:cheers:

monXii 14. Dez 2008 17:43

Re: Chat with IdIrc
 
1. You only set 1 Alternate Nickname :) he cant handle so much.. the last nick will be used if ddbot is not free.. :)
2. theres a procedure called like onMessage or onPrivatemessage.. do you use indy9 or 10?
i have read in some posts that indy 9 is more stable.. ;)

dangerduck 14. Dez 2008 17:48

Re: Chat with IdIrc
 
ok i wil set one altnick i didnt know that :D
i use RAD studio 2007 so i think is delphi 9 in :D
yes i try with onPrivateMessage but i dont know how to write code for it
Delphi-Quellcode:
procedure TForm5.IdIRC1PrivateMessage(ASender: TIdContext; const ANicknameFrom,
  AHost, ANicknameTo, AMessage: string);
begin
Memo1.lines.Add();
end;
what i must insert betwen () ??

beelze000 14. Dez 2008 18:21

Re: Chat with IdIrc
 
if you only need the message is it memo1.lines.add(AMessage);
greetz beelze

Larsi 14. Dez 2008 18:44

Re: Chat with IdIrc
 
What's the Error Message?

monXii 14. Dez 2008 18:50

Re: Chat with IdIrc
 
theres no error cause he didnt knew how to do it ;)

dangerduck 14. Dez 2008 19:08

Re: Chat with IdIrc
 
no the Memo1.lines.Add(AMessage); wont help :( 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 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.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;




procedure TForm5.IdIRC1PrivateMessage(ASender: TIdContext; const ANicknameFrom,
  AHost, ANicknameTo, AMessage: string);
begin
Memo1.lines.Add(AMessage);
end;

end.

dangerduck 14. Dez 2008 21:02

Re: Chat with IdIrc
 
video :wall: :
http://rapidshare.de/files/41137040/Film.wmv.html

Valle 14. Dez 2008 21:32

Re: Chat with IdIrc
 
Zitat:

Zitat von dangerduck

This video is 14MB big! I need around 20 minutes to download it. I think nobody wants to download such a big video. Please just tell us, why it doesn't work. Do you get an error? Which error? This is the fastest way to get help. :wink:

Die Muhkuh 14. Dez 2008 21:44

Re: Chat with IdIrc
 
Zitat:

Zitat von Valle
This video is 14MB big! I need around 20 minutes to download it.

Bad luck guy, bad luck. I don't need a minute to download it...

dangerduck 14. Dez 2008 22:00

Re: Chat with IdIrc
 
fucking adsl XD 150 kbs down ;-)

no i dont get any error :(

just wont show me a message in memo :(

Relicted 15. Dez 2008 07:46

Re: Chat with IdIrc
 
Whats your problem with downloading that file? the longest waittime was the 60secs from rapidshare... the downloading was 1 sec :-) (ok, ok.. 100 mbps :-p )

have a look at whats the name of the function you are using..

Delphi-Quellcode:
procedure TForm5.IdIRC1PrivateMessage(ASender: TIdContext; const ANicknameFrom,
  AHost, ANicknameTo, AMessage: string);
IdIRC1PrivateMessage

how about writing your bot a private message and not just writing some text into the public channel?

dangerduck 15. Dez 2008 15:37

Re: Chat with IdIrc
 
thanks i now that but shit is i cant (if you see video ) chat with my client ((amessage) doesnt work :( )
please help me cos i want to do something nice for my project in sql :)

If i come in yanuar in Germany we can go on beer :cheers:

dangerduck 15. Dez 2008 18:30

Re: Chat with IdIrc
 
:duck:
anybody know the answer?

dangerduck 15. Dez 2008 20:13

Re: Chat with IdIrc
 
http://www.devarticles.com/c/a/Delph...-IRC-Client/1/

i try it with this but doesnt work :(

dangerduck 16. Dez 2008 20:47

Re: Chat with IdIrc
 
do sombedy know to help *??? :angel2:

inherited 16. Dez 2008 20:51

Re: Chat with IdIrc
 
Does the Bot actually join the channel?
have you tried setting breakpoints to see if he really reaches OnPrivateMessage?
Are you using Indy9 or Indy10?

dangerduck 16. Dez 2008 21:16

Re: Chat with IdIrc
 
yes if you see the video i can send message to irc channel and im connected to but i cant recive messages from server or another client :(

my problem ---> http://www.shrani.si/f/30/cp/3QZTy6Mj/untitled-1.jpg

dangerduck 17. Dez 2008 20:24

Re: Chat with IdIrc
 
anybody?

Valle 17. Dez 2008 20:28

Re: Chat with IdIrc
 
Zitat:

Zitat von inherited
Are you using Indy9 or Indy10?

Would you please answer "inherited"s question?
There's a big difference between Indy 9 and 10! ;-)

dangerduck 17. Dez 2008 20:49

Re: Chat with IdIrc
 
i say it on the begin of topic i'am very shure that i have indy 9

Valle 17. Dez 2008 20:57

Re: Chat with IdIrc
 
Zitat:

Zitat von dangerduck
i say it on the begin of topic i'am very shure that i have indy 9

Oh sorry, you said you were using Delphi 9, that confused me... Are you sure that you use Indy 9? I can't find a event called 'OnPrivateMessage' in the Indy 9 documentation. Is there an event called 'OnMessage' in your TIdIRC? Try using this instead of OnPrivateMessage!

dangerduck 17. Dez 2008 21:10

Re: Chat with IdIrc
 
now i will cry :cyclops:
i try with onprivate and i insertet in (amessage) look on first page....
but it doesnt work :(
it doesn't work in anyway i do it :/
http://www.shrani.si/f/8/pK/1B2q9SNB/weee.jpg

Valle 17. Dez 2008 21:14

Re: Chat with IdIrc
 
Zitat:

Zitat von dangerduck
now i will cry :cyclops:
i try with onprivate and i insertet in (amessage) look on first page....
but it doesnt work :(

I think onPrivateMessage is only for private messages, but in your video you wrote a message to the channel. This is a public message, so it's not going to be received by onPrivateMessage. Please look for another event or write private message to your bot. ;-)

dangerduck 17. Dez 2008 21:28

Re: Chat with IdIrc
 
i try later in a private but it doestn work....

please add me on msn :roll:

dangerduck 17. Dez 2008 21:39

Re: Chat with IdIrc
 
fucking maddafaka was updatet with delphi 2009

in both i have 10.1.5

dangerduck 18. Dez 2008 17:55

Re: Chat with IdIrc
 
and still doesnt work :wall:

dangerduck 20. Dez 2008 11:36

Re: Chat with IdIrc
 
you are my last help :(
I don't know why if i have indy V10 i don't have onMessage

Valle 20. Dez 2008 13:56

Re: Chat with IdIrc
 
Zitat:

Zitat von dangerduck
you are my last help :(
I don't know why if i have indy V10 i don't have onMessage

I translated the tutorial of our user MSSSSM for you.
I hope you understand my terrible school-english, I didn't try very hard...

click me!

dangerduck 20. Dez 2008 16:05

Re: Chat with IdIrc
 
Danke :D
You are very kind ;-) :angel:

dangerduck 21. Dez 2008 17:15

Re: Chat with IdIrc
 
Hello!
it's me again i didnt open new theme cos it's not necessary.
I made mail notifier for other mail works well but for gmail wont (i know it using ssl )
so i look on google and make like it's say and now i get that:

1. I made to fix that
http://www.shrani.si/t/E/se/32Q3lqBq/ssl.jpg
with dll's

2. now Look at that:
http://www.shrani.si/?3W/10h/7HEffF4/sss.jpg

dangerduck 21. Dez 2008 17:57

Re: Chat with IdIrc
 
:?:

DeddyH 21. Dez 2008 18:03

Re: Chat with IdIrc
 
Please do not push within 24 hours after your last post without answers.

dangerduck 21. Dez 2008 19:43

Re: Chat with IdIrc
 
sorry :cry:
i wont any more :wink:

dangerduck 23. Dez 2008 19:49

Re: Chat with IdIrc
 
now its more then 24 hours :P


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:16 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz