Code: Select all
bind dcc n banx dcc_ban_duration
proc dcc_ban_duration {hand idx channel} {
set chan [lindex $channel 0]
if {![validchan $chan]} {
putidx $idx "um... I'm not in $chan... what are u thinking?"
} else {
bind raw - 367 Bans:Duration:OUtput
bind raw - 368 Bans:Duration:OUtput
putserv "mode $chan +b"
}
}
proc Bans:Duration:OUtput {from key text} {
switch -- $key {
367 {
lassign [split $text] bot chan mask
if {[lsearch $chan $mask] > -1} return
set banner2 "[lindex [split $text] 3]"
set banner "[lindex [split $banner2 "!"] 0]"
set banmask "[lindex [split $text] 2]"
set banduration2 "[lindex [split $text] 4]"
set banduration "[expr [clock seconds] - $banduration2]"
set currentTime "[clock seconds]"
set Ago [expr $currentTime - $banduration2]
incr BanListCounter 1
putlog "\00314,01 \[$BanListCounter\] - $banner - $chan - \00311 $mask - \00308 [duration $Ago] \017"
}
368 {
unset -nocomplain BanListCounter
unbind raw - 367 Bans:Duration:OUtput
unbind raw - 368 Bans:Duration:OUtput
}
}
}
here's an example of a test:
18:46:52 <EggBot> [18:46:54] [1] - Simo - *!*@77gd-9a2f-60ob-qqc-7s90.486.5739.IP - 19 minutes 34 seconds
18:46:52 <EggBot> [18:46:54] [1] - Simo - *!*@7ecg-tm1o-148-j0h-vt1.3634.774.IP - 19 minutes 34 seconds
18:46:52 <EggBot> [18:46:54] [1] - Simo - *!*@55z-9j7-l01w-819-5hzp.9315.873.IP - 19 minutes 34 seconds
18:46:52 <EggBot> [18:46:54] [1] - Simo - *!*@puy-9669-74m7-t2t-vt3.085.563.IP - 19 minutes 34 seconds
18:46:52 <EggBot> [18:46:54] [1] - Simo - *!*@i4mc-ao2c-m3t-zwa-g7o5.545.8772.IP - 19 minutes 34 seconds
18:46:52 <EggBot> [18:46:54] [1] - Simo - *!*@83p9-y8l-v018-7l7-8z5.869.849.IP - 19 minutes 34 seconds
18:46:52 <EggBot> [18:46:54] [1] - Simo - *!*@77c-nfc5-dlt-2m96-s56v.7116.3083.IP - 19 minutes 34 seconds
18:46:52 <EggBot> [18:46:54] [1] - Simo - *!*@768-829a-726-1arl-l0x.218.8911.IP - 19 minutes 34 seconds
18:46:52 <EggBot> [18:46:54] [1] - Simo - *!*@t6i-112-2gf-nvtp-3dxr.367.3724.IP - 19 minutes 34 seconds
18:46:52 <EggBot> [18:46:54] [1] - Simo - *!*@ldh3-owg6-1721-1q06-l05.903.267.IP - 19 minutes 34 seconds