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 

need to rehash bot to change log files for custom tcl?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
xcoldfyrex
Voice


Joined: 27 Jun 2005
Posts: 4

PostPosted: Sat Jul 01, 2006 4:26 pm    Post subject: need to rehash bot to change log files for custom tcl? Reply with quote

im sure the coding can be better
in order for it to start writing to a different file, the bot needs to be rehashed, and i dont want this, it should just log to a file based on the realtime date


Code:
###########################THIS TCL BY COLDFYRE
bind pubm - "*" save_message
bind join - "*" save_join
bind part - "*" save_part
bind sign - "*" save_sign
bind topc - "*" save_topc
bind kick - "*" save_kick
bind nick - "*" save_nick
bind mode - "*" save_mode
set date [clock format [clock seconds] -format "%d_%m_%y"]
set times [clock format [clock seconds] -format "%T"]
set thechan "#dialtone"
set joins "/www/htdocs/dialtone_radio/logs/irc_$date.log"

proc save_message {nick uhost handle chan text} {
        set date [clock format [clock seconds] -format "%d_%m_%y"]
        set times [clock format [clock seconds] -format "%T"]
        if {$chan == "#dialtone"} {
                set file [open $::joins a]
                puts $file "$times $nick: $text (00)"
                catch {close $file}
        }
}


proc save_join {nick uhost handle chan} {
        set date [clock format [clock seconds] -format "%d_%m_%y"]
        set times [clock format [clock seconds] -format "%T"]
        if {$chan  == "#dialtone"} {
                set file [open $::joins a]
                puts $file "$times JOIN $nick ($uhost)(00)"
                catch {close $file}
        }
}

proc save_part {nick uhost handle chan msg} {
        set date [clock format [clock seconds] -format "%d_%m_%y"]
        set times [clock format [clock seconds] -format "%T"]
        if {$chan == "#dialtone"} {
                set file [open $::joins a]
                puts $file "$times PART $nick ($uhost)(00)"
                catch {close $file}
        }
}

proc save_sign {nick uhost handle chan msg} {
        set date [clock format [clock seconds] -format "%d_%m_%y"]
        set times [clock format [clock seconds] -format "%T"]
        if {$chan == "#dialtone"} {
                set file [open $::joins a]
                puts $file "$times QUIT $nick ($uhost) REASON: $msg (00)"
                catch {close $file}
        }
}

proc save_topc {nick uhost handle chan topic} {
        set date [clock format [clock seconds] -format "%d_%m_%y"]
        set times [clock format [clock seconds] -format "%T"]
        if {$chan == "#dialtone"} {
                set file [open $::joins a]
                puts $file "$times $nick ($uhost) sets topic: $topic (00)"
                catch {close $file}
        }
}

proc save_kick {nick uhost handle chan target reason} {
        set times [clock format [clock seconds] -format "%T"]
        if {$chan == "#dialtone"} {
                set file [open $::joins a]
                puts $file "$times $nick ($uhost) kicked $target because $reason (00)"
                catch {close $file}
        }
}

proc save_nick {nick uhost handle chan newnick} {
        set date [clock format [clock seconds] -format "%d_%m_%y"]
        set times [clock format [clock seconds] -format "%T"]
        if {$chan == "#dialtone"} {
                set file [open $::joins a]
                puts $file "$times $nick changed nick to $newnick (00)"
                catch {close $file}
        }
}

proc save_mode {nick uhost handle chan mode victim} {
        set date [clock format [clock seconds] -format "%d_%m_%y"]
        set times [clock format [clock seconds] -format "%T"]
        if {$chan == "#dialtone"} {
                set file [open $::joins a]
                if {$victim == "" } {
                        puts $file "$times $nick sets mode: $mode (00)"
                } else {
                        puts $file "$times $nick sets mode $mode on $victim (00)"
}
                catch {close $file}
        }
}
Back to top
View user's profile Send private message
SaPrOuZy
Halfop


Joined: 24 Mar 2004
Posts: 75
Location: Lebanon

PostPosted: Thu Jul 06, 2006 2:10 am    Post subject: Reply with quote

put
Code:
set joins "/www/htdocs/dialtone_radio/logs/irc_$date.log"

before every
Code:
set file [open $::joins a]
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 -> Scripting Help 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