Autor Beitrag
wolle-
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: So 13.02.05 20:27 
Hallo leute,
gibt es im idirc auch sowas wie im mIRC
ausblenden Quelltext
1:
on *:action:*:#: { msg $chan m00 $nick }					

Bin bisher nur soweit gekommen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.ircAction(Sender: TObject; AUser: TIdIRCUser;
  AChannel: TIdIRCChannel; Content: String);
begin
irc.action( '#server', 'poges '+ auser.nick +' in his ass' );
irc.action( '#server', 'findet dass' + auser.nick +' ein PVT benuzt :D');
end;


ist aber nich so das was ich will
sondern z.B.

Wenn man .help schreibt das er dadrauf antwortet
und sobald .sponsor was anderes ect!

Bitte helft mir

Vielen Dank
wolle
araX
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 36

Win XP +SP2, Gentoo & Debian
D7 Enterp
BeitragVerfasst: So 13.02.05 20:45 
Ich habe mal einen IRC-Bot geschrieben, da stand ich auch vor dem Problem.

Da wirst du wohl die Nachrichten die vom Server kommen auswerten müssen.(String zerlegen)
Sollte dann der von dir gewählte 'Befehl' geschrieben werden muss das dein Programm erkennen
und entsprechend reagieren.

mfg araX

_________________
Alles fängt mit Spagetti(-code) an und hört mit Bolognese auf.
wolle- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: So 13.02.05 21:07 
Örm das kann ich aber nicht dieses Parsen
kann mir mal jemand ein konkretes beispiel nennen? Ich komme aus dem problem nicht wirklich raus! wäre echt dankbar

mfg wolle
araX
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 36

Win XP +SP2, Gentoo & Debian
D7 Enterp
BeitragVerfasst: So 13.02.05 21:27 
Das ist garnicht so schwer.

Du hast ja ein Event das dir sagt das Text vom Server kommt. Den Text überprüfst du dann
auf deinen entsprechenden Befehl.

ausblenden Delphi-Quelltext
1:
i := Pos('.befehl', msg);					


Ist das Ergebins von Pos größer 0, dann weißt du das dieser Befehl im Text steht.

_________________
Alles fängt mit Spagetti(-code) an und hört mit Bolognese auf.
wolle- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: So 13.02.05 21:32 
Ja wie :D

Ich bin doch beginner .. später is das für mich auch easy
also so dann?

ausblenden Delphi-Quelltext
1:
2:
 i := Pos('.befehl', msg);
irc.action( '#server', 'findet dass' + auser.nick +' ein PVT benuzt :D');

_________________
Don`t eat yellow snow ;)!!
araX
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 36

Win XP +SP2, Gentoo & Debian
D7 Enterp
BeitragVerfasst: So 13.02.05 21:37 
Wie gesagt ich kenne das Nachrichten-Event von idIRC nicht. Ich habe die Sache anders gemacht.
Wenn aber Text ankommt dann musst du das in etwa so machen:

ausblenden Delphi-Quelltext
1:
if (Pos('.befehl', msg) > 0) then irc.action( '#server', 'findet dass' + auser.nick +' ein PVT benuzt :D');					


mfg araX

_________________
Alles fängt mit Spagetti(-code) an und hört mit Bolognese auf.
wolle- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: So 13.02.05 21:40 
Danke werde ich mal ausprobieren :lol:

_________________
Don`t eat yellow snow ;)!!
wolle- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: So 13.02.05 21:42 
Wäre auch zu schön gewesen um wahr zu sein :-)

:lol:

ausblenden Quelltext
1:
[Fehler] Unit1.pas(88): '(' erwartet, aber ')' gefunden					


Hab schon versucht die klammern zu verschieben
geht aber leider nicht :/

_________________
Don`t eat yellow snow ;)!!
araX
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 36

Win XP +SP2, Gentoo & Debian
D7 Enterp
BeitragVerfasst: So 13.02.05 21:44 
poste mal deinen quelltext bitte

_________________
Alles fängt mit Spagetti(-code) an und hört mit Bolognese auf.
wolle- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: So 13.02.05 21:46 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.ircAction(Sender: TObject; AUser: TIdIRCUser;
  AChannel: TIdIRCChannel; Content: String);
begin
if
(Pos('.befehl', msg) > 0) then irc.action( '#server', 'findet dass' + auser.nick +' ein PVT benuzt :D');
end;

_________________
Don`t eat yellow snow ;)!!
wolle- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: So 13.02.05 22:07 
Muss um halb 5 raus! Schaue morgen nochmal vorbei, würde mich über einen Antwort freuen :) Danke

_________________
Don`t eat yellow snow ;)!!
wolle- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: Do 03.03.05 15:22 
weiss wer warum das nicht funktioniert? Ich habs leider immernoch nicht rausgefunden!

Wäre echt supernett :|

Mfg wolle

Weiss das denn wirklich niemand?
Bitte :(

_________________
Don`t eat yellow snow ;)!!
wolle- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: Do 03.03.05 17:54 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.botAction(Sender: TObject; AUser: TIdIRCUser;
  AChannel: TIdIRCChannel; Content: String);
begin
if
(Pos('.befehl', Content) > 0) then bot.action( '#newgen', 'findet dass' + auser.nick +' ein PVT benuzt :D');

end;


In meinen augen muss das richtig sein oder?
aber:

ausblenden Quelltext
1:
2:
3:
[17:49:31] *** wolle- sets mode +o Trojan_Scan
[17:49:35] <wolle-> .befehl
[17:49:40] <wolle-> da kummt aber nix

_________________
Don`t eat yellow snow ;)!!
wolle- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: Do 03.03.05 17:57 
funktioniert xD einfach in on action :)

_________________
Don`t eat yellow snow ;)!!
Cyberaxx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 89



BeitragVerfasst: Fr 22.07.05 14:44 
HI,

Du kannst sowas auch in OnMessage oder in OnRecive setzen.

Bei OnMessage geht das alles direkt und Du kannst die Zeile so übernehmen.

Bei OnRecive musst du alles auf einem String heraus exportieren aber der liefert auch mehr Informationen.

_________________
Das Aufwachen aus einem boesen Traum muss einen nicht erleichtern. Es kann einen auch erst richtig gewahr werden lassen, was man Furchtbares getraeumt hat, vielleicht sogar welcher furchtbaren Wahrheit man im Traum begegnet ist!
wolle- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 128

XP Prof, Suse 9.2
D7
BeitragVerfasst: Fr 22.07.05 15:10 
öhmm..... jo :)

_________________
Don`t eat yellow snow ;)!!
Cyberaxx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 89



BeitragVerfasst: Fr 22.07.05 16:32 
Was mich an der Komp stört ist das OnMessage Ereignis es regiert gleich auf wenn einer in den Chan schreibt oder ein Qry öffnet. Nur das beim Qry kein Channel angegeben ist und da motzt die Komponente schon recht gut rum ansonsten bin ch damit recht zufrieden im Gegensatz zu dem was man teils über die Komponente hört.

_________________
Das Aufwachen aus einem boesen Traum muss einen nicht erleichtern. Es kann einen auch erst richtig gewahr werden lassen, was man Furchtbares getraeumt hat, vielleicht sogar welcher furchtbaren Wahrheit man im Traum begegnet ist!
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Fr 22.07.05 18:10 
user profile iconCyberaxx hat folgendes geschrieben:
Was mich an der Komp stört ist das OnMessage Ereignis es regiert gleich auf wenn einer in den Chan schreibt oder ein Qry öffnet. Nur das beim Qry kein Channel angegeben ist und da motzt die Komponente schon recht gut rum ansonsten bin ch damit recht zufrieden im Gegensatz zu dem was man teils über die Komponente hört.


Ich stieg dann irgendwann auf das onRaw-Ereignis um und zerschnipplte den String :D

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
Cyberaxx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 89



BeitragVerfasst: Fr 22.07.05 18:17 
Ich bin bereits dabei.

Hast Du Dir schonmal angesehen was oder wie ein recive String ausschaut?

Es ist ideal für einen Bot da man immer schon den Usernamen, Ident und Host mitgeliefert bekommt.

_________________
Das Aufwachen aus einem boesen Traum muss einen nicht erleichtern. Es kann einen auch erst richtig gewahr werden lassen, was man Furchtbares getraeumt hat, vielleicht sogar welcher furchtbaren Wahrheit man im Traum begegnet ist!
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Fr 22.07.05 18:34 
user profile iconCyberaxx hat folgendes geschrieben:
Hast Du Dir schonmal angesehen was oder wie ein recive String ausschaut?


keine Ahnung... hab mich schon länger nicht mehr damit beschäftigt... *coderauskram*
mh.. sieht so aus, als hätte ich onMessage für die Channelnachrichten und onRaw fürs Query verwendet :roll:

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)