This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Megahal - how to filter badwords ?

Old posts that have not been replied to for several years.
Locked
b
b34r
Voice
Posts: 35
Joined: Wed Jun 18, 2003 4:09 pm

Megahal - how to filter badwords ?

Post by b34r »

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: 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"
}
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 :wink:
Locked