b34r Voice
Joined: 18 Jun 2003 Posts: 35
|
Posted: Tue Feb 17, 2004 5:45 am Post subject: Megahal - how to filter badwords ? |
|
|
Hi...
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: |
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"
}
|
So you see, the filterproc is what i need. But how?
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  |
|