##############
#- BAN Type -#
##############
# Set the banmask type to use in banning the IPs
# Currently BAN Type is set to 1 (*!*@some.domain.com),
# BAN Types are given below;
# 1 - *!*@some.domain.com
# 2 - *!*@*.domain.com
# 3 - *!*ident@some.domain.com
# 4 - *!*ident@*.domain.com
# 5 - *!*ident*@some.domain.com
# 6 - *nick*!*@*.domain.com
# 7 - *nick*!*@some.domain.com
# 8 - nick!ident@some.domain.com
# 9 - nick!ident@*.host.com
set lt_btype 1
#################
#- Ban timeout -#
################
set ban_timeout 300
################
#- the script -#
################
BIND PUBM - * wb_proc
# not sure how to get the text from the bind to the $string var :S
proc wb_proc {nick uhost hand chan txt} {
# string = a line in mirc
if {regexp {.*(Wb|wB|wb|WB|GREETINGS|...)(!!| )?(\(|\*).*\)?(!!| )?(Wb|wB|wb|WB|FECKER|... remember this?|\|\|\|).*} $txt == 1} {
# do the ban things in here
set banmask [lt:banmask $uhost $nick]
putquick "MODE $chan +b $banmask"
putserv "KICK $chan $nick Please do not use wbs in this channel, temp ban $ban_timeout sec"
utimer $ban_timeout putquick "MODE $chan -b $banmask"
}
}
proc lt:banmask {uhost nick} {
global lt_btype
switch -- $lt_btype {
1 { set banmask "*!*@[lindex [split $uhost @] 1]" }
2 { set banmask "*!*@[lindex [split [maskhost $uhost] "@"] 1]" }
3 { set banmask "*!*$uhost" }
4 { set banmask "*!*[lindex [split [maskhost $uhost] "!"] 1]" }
5 { set banmask "*!*[lindex [split $uhost "@"] 0]*@[lindex [split $uhost "@"] 1]" }
6 { set banmask "*$nick*!*@[lindex [split [maskhost $uhost] "@"] 1]" }
7 { set banmask "*$nick*!*@[lindex [split $uhost "@"] 1]" }
8 { set banmask "$nick![lindex [split $uhost "@"] 0]@[lindex [split $uhost @] 1]" }
9 { set banmask "$nick![lindex [split $uhost "@"] 0]@[lindex [split [maskhost $uhost] "@"] 1]" }
default { set banmask "*!*@[lindex [split $uhost @] 1]" }
return $banmask
}
}