egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Customizing public channel logs

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
inertia
Voice


Joined: 19 Nov 2006
Posts: 6

PostPosted: Tue Nov 21, 2006 6:21 am    Post subject: Customizing public channel logs Reply with quote

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
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Tue Nov 21, 2006 10:59 pm    Post subject: Reply with quote

Short of hacking the source? I don't believe so... You could always make a little script to basically do a custom log.
Back to top
View user's profile Send private message
inertia
Voice


Joined: 19 Nov 2006
Posts: 6

PostPosted: Wed Nov 22, 2006 12:08 am    Post subject: Reply with quote

yeah if I knew how to make it Very Happy
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Nov 22, 2006 10:28 am    Post subject: Reply with quote

So, what exactly do you want to log? (msgs, notices, parts, joins...etc).
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
inertia
Voice


Joined: 19 Nov 2006
Posts: 6

PostPosted: Wed Nov 22, 2006 11:13 am    Post subject: Reply with quote

just the public text and absolutely nothing else
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Nov 22, 2006 11:33 am    Post subject: Reply with quote

Code:
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.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
inertia
Voice


Joined: 19 Nov 2006
Posts: 6

PostPosted: Thu Nov 23, 2006 12:08 pm    Post subject: Reply with quote

oh wow! Surprised thanks a ton, man! Very Happy I'll try it soon!

:bowdown:
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber