a script like this exists. i dunno where i have it from, but here it is:
Code: Select all
##########################################################################
#
# WordKick v1.50 by ccr/TNSP <ccr@tnsp.org>
# Based on original wordkick.tcl by Goblet <goblet@goblet.net>
#
##########################################################################
# Configure these as you like
## Kickword mask/message file
# (FORMAT: See the example file!)
set wc_badword_file "data.wordkick"
## "Random happy-joy-joy-messages file"
# (FORMAT: One message per line)
set wc_happy_msg_file "data.happymsg"
## Gentle mode:
# 0 = Kick with kickmessage, say happymsg just before kicking
# 1 = Don't kick, just say happymsg.
set wc_gentlemode 0
## Irritation treshold mode:
# 0 = Normal, immendiate kick on detected kickword.
# 1 = Irritation tresholded kick. See README.
set wc_irritationmode 0
# Treshold of irritation. If this many kickwords are said
# fast enough, bot starts kicking.
set wc_irritationtreshold 1
# Preferred message type ("PRIVMSG" and "NOTICE")
set wc_preferredmsg "NOTICE"
##########################################################################
# No need to look below this line
##########################################################################
set wc_message "WordKick v1.50 by ccr/TNSP & Goblet"
set wc_name "WKick"
###
### Read the bad-word file
###
catch {unset wc_bad_mask_list}
catch {unset wc_kick_msg_list}
set wc_badword_max 0
set fd [open $wc_badword_file r]
while {![eof $fd]} {
gets $fd foo
if {[string first # $foo] && ([lindex $foo 0] != "")} {
set foo [split $foo "$"]
lappend wc_bad_mask_list [lindex $foo 0]
lappend wc_kick_msg_list [lrange $foo 1 end]
incr wc_badword_max
}
}
close $fd
###
### Read the happy-message file
###
set wc_happy_msg_max 0
catch {unset wc_happy_msg_list}
set fd [open $wc_happy_msg_file r]
while {![eof $fd]} {
gets $fd foo
lappend wc_happy_msg_list $foo
incr wc_happy_msg_max
}
close $fd
###
### Initialize the script
###
bind time - "* % % % %" wc_timer
bind pubm - %* wc_check
bind ctcp - ACTION wc_check
putlog "$wc_message"
putlog "(maskfile: $wc_badword_file, $wc_badword_max // happymsg: $wc_happy_msg_file, $wc_happy_msg_max)"
if {$wc_irritationmode} {
putlog "(irritation mode, treshold: $wc_irritationtreshold)"
} else {
putlog "(normal wordkick mode)"
}
catch {unset wc_irritation}
set wc_irritation 0
###
### Change the irritation
###
proc wc_timer {umin uhour uday umonth uyear} {
global wc_irritation
if {$wc_irritation > 0} {
set wc_irritation [expr $wc_irritation - 1]
}
}
###
### Match the messages with bad-word list
###
proc wc_check {nick uhost hand chan args} {
global wc_bad_mask_list wc_kick_msg_list botnick wc_preferredmsg
global wc_happy_msg_list wc_happy_msg_max wc_name wc_gentlemode
global wc_irritation wc_irritationmode wc_irritationtreshold
# Convert to lower case
set args [string tolower $args]
# Go through the sentence
set kickit 0
set x 0
foreach foo $wc_bad_mask_list {
set foo2 [split $foo "|"]
foreach i $foo2 {
if {[string match $i $args]} {
putlog "$wc_name: $nick@$chan said a bad thing: $i"
if {[matchattr $hand "f" $chan]} { return 0 }
# Say happymsg
# if {[rand 100] > 40} {
putserv "$wc_preferredmsg $chan :$nick, [lindex $wc_happy_msg_list [rand $wc_happy_msg_max]]"
# }
# Check for gentle-mode
if {$wc_gentlemode || [matchattr $hand j]} { return 0 }
# Check for irritation mode
if {$wc_irritationmode} {
if {$wc_irritation > $wc_irritationtreshold} {
set kickit 1
} else {
incr wc_irritation
}
} else {
set kickit 1
}
# Kick the lamer
if {$kickit} {
putkick $chan $nick Badword Autokick ([lindex $wc_kick_msg_list $x]), Warnung -$x-
return 0
}
}
}
incr x
}
}
example for the 2 data. files:
Code: Select all
hentai nur jugendfreie Inhalte
fick schlecher Umgang
[censored] schlecher Umgang
nigger schlecher Umgang
porn nur jugendfreie Inhalte
p0rn nur jugendfreie Inhalte
pr0n nur jugendfreie Inhalte
warez keine illegale Software
crack keine illegale Software
arschloch schlecher Umgang
asshole schlecher Umgang
wixer schlecher Umgang
hure schlecher Umgang
nutte schlecher Umgang
bitch schlecher Umgang
Techno.gegen.Hiphop Execess Advertising
Code: Select all
lalalalala, ich liebe solche Worte.
Du hast einen Umgangston hier, tztztz.
man oh man, das war Dumm...
Hau... ruck! Und noch einer weniger.
PAAAARTYYYYY!!! und du fliegst...
this script worked, but seems it has problems with the kick reason, i didn't investigate it so long.
but perhaps the problem was only, the user alway singoff after spamming...
PS: the 4 stars are of course not in my files, it is called f-u-c-k
.