All pastes #76559 Raw Edit

coldfyre

public text v1 · immutable
·published 2006-07-01 20:12 UTC
rendered paste body
###########################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}
        }
}