I'm currently trying to create a script that filters out bad words, but i'm a bit out of ideas how to do it.
Something like this for starters:
Code: Select all
bind pubm - "* $nick*" megahal:filter
setudef flag megahfilt
proc megahal:filter {nick uhost hand chan text} {
if {[lsearch -exact [channel info $chan] +megahfilt] != -1} {
} else { return 0 }
set filtered [filterproc text]
learn $filtered
set reply [filterproc [getreply $filtered]]
puthelp "PRIVMSG $chan :$nick\: $reply"
}
It needs to filter both input and output, my megahal.brn-file is already filled with profanity
* Strict: Put the words in a file ? ( badword|niceword )
* Random out of a few: Put the words in a file ? ( badword|niceword|niceword2|niceword3 )
* Read any random word from a file ?
What would be the nicest way to do it ?
Or maybe there is such a script somewhere already that i haven't found ?
Or even BarkerJr himself would like to code that into the module