This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

outputing raw server msgs in realtime

Old posts that have not been replied to for several years.
S
SmokeyOne
Halfop
Posts: 69
Joined: Tue Jan 14, 2003 6:04 am

outputing raw server msgs in realtime

Post by SmokeyOne »

i need al ittle help with this one, i'm wanting to take raw server msgs and output them to a channel. What would be the best way to go about doing that?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

I suggest you ead about bind raw in the tcl-commands.doc, and take a look at this page: http://www.irchelp.org/irchelp/rfc/rfc.html

should give you some answers
Elen sila lúmenn' omentielvo
S
SmokeyOne
Halfop
Posts: 69
Joined: Tue Jan 14, 2003 6:04 am

Post by SmokeyOne »

ya i know its

bind raw numhere kill_phrase

proc kill_phrase { key from text} {



its just after that I'm not sure how to get the text i need =/
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

It's all dependent on the command you are seding to the server.

The RFC will not just give you the RAW codes, but also the format of any data returned.

Unless we know what code you are expecting, and what details from it you need, we can't help further.
S
SmokeyOne
Halfop
Posts: 69
Joined: Tue Jan 14, 2003 6:04 am

Post by SmokeyOne »

from what i read in the rfc this is the only thing about kill msgs i can find
361 IEUD RPL_KILLDONE

the out put after a oper issuses a /kill username [reason] the server should send a msg like
Recived kill msg from blah. From operman path irc.someserver.com! irc2.someothererver.com!balh!operman (reasonhere)

what I'm wanting is to extract this information into something shorter like : Userkill for $victum from $oper reason : $reason

and outputing this to the channel i have setup. I'm not sure on the code I'm woundering if its just like
bind raw 361 kill_phrase
proc kill_phrase { from key text} {
set $victum [lindex $arg 5]
set $oper [lindex $arg 6]
set $server [lindex $arg 10]
set $reason [lindex $arg 16]
putchan $chan "Userkill for $victum from $oper reason :$reason"
}

Thi sis my thought on how it would go
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

The RAW code you have seen, is the reply sent to the OPER.

Eggdrop will not see this.

From what I understand, messages like these are sent in a SNOTICE
S
SmokeyOne
Halfop
Posts: 69
Joined: Tue Jan 14, 2003 6:04 am

Post by SmokeyOne »

so i would have to use [lindex [split $arg == "KILL"] ]

and make a bind raw - NOTICE


or something to that effect
d
dexter

Post by dexter »

[edit]heh, wrong smokey :/[/edit]
Last edited by dexter on Sat Feb 01, 2003 3:29 am, edited 2 times in total.
S
SmokeyOne
Halfop
Posts: 69
Joined: Tue Jan 14, 2003 6:04 am

Post by SmokeyOne »

lying??? what part of my posts was i lying? do I know you or something?
S
SmokeyOne
Halfop
Posts: 69
Joined: Tue Jan 14, 2003 6:04 am

Post by SmokeyOne »

i don't think that will work, and I'm still haveing trouble trying to get any or all server msgs from the server =/
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Easiest way is to modify the eggdrop source code. If you want to make this tcl-only, it will be pretty hard. Use the raw bind, but you have to bind every single irc message type. Numerics too. It's not hard, really, but it is time consuming!

bind raw - 001 yourproc
bind raw - 002 yourproc
...

proc yourproc {from key text} {
putlog "$from $key $text"
return 0
}

Based on that you should be able to do whatever you want! To output them to a channel, change the putlog line to, putserv "privmsg #sheep :$from $key $text" (notice the : before $from, it's important).
S
SmokeyOne
Halfop
Posts: 69
Joined: Tue Jan 14, 2003 6:04 am

Post by SmokeyOne »

so in other words, I'll have to make a 40k proc basicly just over retriveing klines, glines, kills, or what ever else is vital information ?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Yes and no. It all depends how much, and what information you want.

Some scripts are large yes. I would greatfully love for the programming language that reuires only 3 lines of code, to do everything I ever dreamed of.

But thats silly talk.

First, you should start from the begining, as most of this thread no seems to be bits thrown here and there, then a comment from you, and we don't know what it relates to.

You need to find out how the server sends the information about K, G and whatever information you are beind sent.

Without this, it's pointless even attempting to make a bind. It's simalar to not knowing how to cook baked beans, so you turns the deep-fat-fryer on in preoperation (note the trend on food here).

Now you need to know what format each of the lines come in. One could have a totaly different set of text ot the next. This is needed, so we know how to parse out the information we need to forward.

Depending on the two above, we can now think about the design of the script. Can it be one proc? Does it have to use multiple procs everywhere? Is there any common ifnormation? Howe do we want it displayed, and can we use one format for this?

Wihtout this sort of information, we aint gonna have a clue what sort of sized script is needed.
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

SmokeyOne wrote:so in other words, I'll have to make a 40k proc basicly just over retriveing klines, glines, kills, or what ever else is vital information ?
Let us see. You started the thread 4 days ago with:
SmokeyOne wrote: i need al ittle help with this one, i'm wanting to take raw server msgs and output them to a channel. What would be the best way to go about doing that?
This is a completely non specific and general question. So yes, if you want to catch all raw server messages then you make the RAW binds and call a proc that outputs the messages to your channel. If you need only specific RAW's then you only bind to those specific RAW's. Easy as that.

The answer was already given to you by stdragon. So, why are you re-iterating the answer, instead of starting to just create the Tcl?
How difficult can it be to look up the rfc and create the RAW bindings you need?
S
SmokeyOne
Halfop
Posts: 69
Joined: Tue Jan 14, 2003 6:04 am

Post by SmokeyOne »

okay i have it working, though it now displays ever server msgs, and then Displays in the channel the output style i have. I'm not sure on the right sntax on how to ge it to only look for "KILL"

I was thinking [lindex [split $arg == "KILL" 0]]

would this be right ?
Locked