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.

Customizing public channel logs

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
i
inertia
Voice
Posts: 6
Joined: Sun Nov 19, 2006 12:43 pm

Customizing public channel logs

Post by inertia »

Hello

I would like to know if there is a way to exclude timestamps and nicknames and /me's from being logged when logging public channels (p).

Thanks in advance.
Last edited by inertia on Wed Nov 22, 2006 12:07 am, edited 1 time in total.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Short of hacking the source? I don't believe so... You could always make a little script to basically do a custom log.
i
inertia
Voice
Posts: 6
Joined: Sun Nov 19, 2006 12:43 pm

Post by inertia »

yeah if I knew how to make it :D
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

So, what exactly do you want to log? (msgs, notices, parts, joins...etc).
i
inertia
Voice
Posts: 6
Joined: Sun Nov 19, 2006 12:43 pm

Post by inertia »

just the public text and absolutely nothing else
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

foreach logchan [channels] {
 set logchan [string tolower $logchan]
 if {[file exists logs/$logchan.pub.log]} {
  set publog($logchan) [split [read [set inf [open logs/$logchan.pub.log]]] "\n"][close $inf]
 }
}

setudef flag publog

bind pubm - * logtext
bind time - ?0* savelog

proc logtext {nick uhost hand chan arg} {
 global publog
 if {[channel get $chan publog]} {
  lappend publog([string tolower $chan]) $text
 }
}

proc savelog {m h args} {
 global publog
 foreach c [channels] {
  set c [string tolower $chan]
  if {[info exists publog($c)] && [channel get $c publog]} {
   if {[regexp {03:00} $h:$m]} {
    if {[file exists logs/$c.pub.log]} {
     set bla [open logs/$c.pub.log.yesterday w]
     foreach e $publog($c) {
      puts $bla $e
     }
     close $bla
     set publog($c) [list]
    }
   } {
    set bla [open logs/$c.pub.log w]
    foreach e $publog($c) {
     puts $bla $e
    }
    close $bla
   }
  }
 }
}
It will log only channels that have +publog chan setting. And the logs will be saved in the logs/ directory.
i
inertia
Voice
Posts: 6
Joined: Sun Nov 19, 2006 12:43 pm

Post by inertia »

oh wow! :o thanks a ton, man! :D I'll try it soon!

:bowdown:
Post Reply