Code: Select all
bind kick - * logit
bind mode - "* +b" logit
proc logit {nick uhost hand chan arg1 arg2} {
if {$arg1 == "+b"} {
set line "<pre>BAN: Set by $nick ($hand - $uhost) on channel $chan against $arg2 </pre>"
} else {
set line "<pre>KICK: Set by $nick ($hand - $uhost) on channel $chan against $arg1 for $arg2 </pre>"
}
set kickbanlog [open /path/to/my/kickban.log a]
puts $kickbanlog $line
catch {close $kickbanlog}
}
#antiwordwrap#########################################################################################################
Code: Select all
# ============================================================================
# KickBanLog.tcl v1.0 (12/Feb/2007) by Yxaaaaaaa & Tisho & Thanks to rosc2112
# -------------- COPYRIGHT C.LEONHARDT 2007 --------------------
# Original concept by rosc2112 (C.LEONHARDT)
# http://forum.egghelp.org/viewtopic.php?p=68656#68656
#
# Description:
# This tcl logs every Kick & Ban in chosen channel, and generates html file)
#
# Yxaaaaaaa UniBG @ #EggFAQ ( http://www.egghlep-bg.com )
# Tisho UniBG @ #DJ ( http://DjTisho.com )
# (Please e-mail us your suggestions and bugs - djtisho|at|gmail.com
# ============================================================================
# Starting configuration ...
# Channels (separated by space)
set kbechans "#channel1 #channel2"
# Main log dir (full path to your logs dir, e.g. /home/user/public_html/log )
set kbepath "/home/user/public_html/log"
# Setting the HTTP charset parameter ( http://www.w3.org/International/O-HTTP-charset )
set charset "windows-1251"
# Binds
bind kick - * e:log
bind mode - "* +b" e:log
# Start tcl script - DO NOT change anything below !
proc e:createpage c {
if {![string match *$c* $::kbechans]} {return}
set efile "$::kbepath/$c/index.html"
set fid [open $efile w]
puts $fid "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$::charset\" />\n
<body text=\"#FFFFFF\" bgcolor=\"#000000\" topmargin=\"0\" leftmargin=\"0\">\n
<p align=\"center\"><u><font size=\"5\" face=\"Verdana\">Channel #$c Kicks & Bans log</font></u></p>\n"
close $fid
}
proc e:log {n u h c w t} {
set c [string map [list "#" {}] [string tolower $c]]
if {![file isdir $::kbepath/$c]} { catch {[file mkdir $::kbepath/$c]}}
set efile "$::kbepath/$c/index.html"
if {![file exists $efile]} { e:createpage $c}
if {$w == "+b"} {
set line "<pre><font color='green'>BAN: [ctime [unixtime]] Set by $n ($h - $u) on channel #$c against $t</font></pre>"
} else {
set line "<pre><font color='red'><u>KICK:</u> [ctime [unixtime]] Set by $n ($h - $u) on channel #$c against $w for <u>$t</u> </font></pre>"
}
set kickbanlog [open $efile a]
puts $kickbanlog $line
catch {close $kickbanlog}
}
# putlog
putlog "KickBanLog.tcl v1.0 by <\002Yxaaaaaaa & Tisho & rosc2112\002> Loaded."
Hello to everyone!rosc2112 wrote:Should work, not tested..Obviously doesn't have the html header (which probably won't be necessary anyway.) That gives you the basics, modify to suit.Code: Select all
bind kick - * logit bind mode - "* +b" logit proc logit {nick uhost hand chan arg1 arg2} { if {$arg1 == "+b"} { set line "<pre>BAN: Set by $nick ($hand - $uhost) on channel $chan against $arg2 </pre>" } else { set line "<pre>KICK: Set by $nick ($hand - $uhost) on channel $chan against $arg1 for $arg2 </pre>" } set kickbanlog [open /path/to/my/kickban.log a] puts $kickbanlog $line catch {close $kickbanlog} } #antiwordwrap#########################################################################################################