Code: Select all
<nick> Who is from location location location location location location location
Code: Select all
bind pubm - "#channel *" dududu
proc dududu {nick uhost hand chan sentence} {
array set wordcount {}
if {([llength $sentence] < 5)||([llength $sentence] > 25)} {return 0}
foreach e [split $sentence] {
if {[llength [split $e ""]] < 4} {return 0};#ignore 'ha ha ha ha ha' etc
if {![info exists wordcount($e)]} {
set wordcount($e) 1
} elseif {[info exists wordcount($e)]} {
incr wordcount($e)
}
}
set output ""
foreach {x y} [array get wordcount] {
if {[string is integer -s $y]} {
lappend score [list $x $y]
}
}
set {e} [lsort -decreasing -integer -index 1 $score]
if { [lindex [lindex $e 0] 1] > 5 } {
putlog "[lindex [lindex $e 0] 0] used [lindex [lindex $e 0] 1] times";#kick or ban goes here
}
}