This is our ongoing Censor snippet.

I got this idea from the RomList.
This is my first REAL development. Although I don't want credit, please drop 
me a line
letting me know that it brought some use to SOMEONE. :)

THIS IS AN ONGOING PROJECT. I DOUBT THIS WILL EVER BE COMPLETE

THIS IS MY FIRST ATTEMPT TO RELEASE CODE. IT'S NOT DIFFICULT, SO PLEASE 
DON'T LAUGH

We'll have to add to it as we come up with more ingeneous ways to prevent 
foul language.
I'm sure theres a better way to do this, but so far this is working for most 
things.
To make this work, slap this into act_comm.c in each of your channel 
functions right
after something that looks alot like this depending on your channels...

REMOVE_BIT(ch->comm,COMM_NOGOSSIP);
}

+if ((!str_infix(" fuck ", argument))
+	||  (!str_suffix(" fuck", argument))
+	||  (!str_suffix(" fuck.", argument))
+	||  (!str_suffix(" fuck!", argument))
+       ||  (!str_cmp("fuck", argument))
+	||  (!str_cmp("fuck.", argument))
+	||  (!str_cmp("fuck!", argument))
+       ||  (!str_infix(" bitch ", argument))
+	||  (!str_prefix("bitch ", argument))
+	||  (!str_suffix(" bitch", argument))
+	||  (!str_suffix(" bitch.", argument))
+	||  (!str_suffix(" bitch!", argument))
+	||  (!str_cmp("bitch", argument))
+	||  (!str_cmp("bitch.", argument))
+	||  (!str_cmp("bitch!", argument))
+       ||  (!str_infix(" cunt ", argument))
+	||  (!str_prefix("cunt ", argument))
+	||  (!str_suffix(" cunt", argument))
+	||  (!str_suffix(" cunt.", argument))
+	||  (!str_suffix(" cunt!", argument))
+	||  (!str_cmp("cunt", argument))
+	||  (!str_cmp("cunt.", argument))
+	||  (!str_cmp("cunt!", argument))
+       ||  (!str_infix(" ass ", argument))
+	||  (!str_prefix("ass ", argument))
+	||  (!str_suffix(" ass", argument))
+	||  (!str_suffix(" ass.", argument))
+	||  (!str_suffix(" ass!", argument))
+	||  (!str_cmp("ass", argument))
+	||  (!str_cmp("ass.", argument))
+	||  (!str_cmp("ass!", argument))
+       ||  (!str_infix(" pussy ", argument)
+       ||  (!str_prefix("pussy ", argument))
+	||  (!str_suffix(" pussy", argument))
+	||  (!str_suffix(" pussy.", argument))
+	||  (!str_suffix(" pussy!", argument))
+	||  (!str_cmp("pussy", argument))
+	||  (!str_cmp("pussy.", argument))
+	||  (!str_cmp("pussy!", argument))
+       ||  (!str_infix(" dick ", argument))
+	||  (!str_prefix("dick ", argument))
+	||  (!str_suffix(" dick", argument))
+	||  (!str_suffix(" dick.", argument))
+	||  (!str_suffix(" dick!", argument))
+	||  (!str_cmp("dick", argument))
+	||  (!str_cmp("dick.", argument))
+	||  (!str_cmp("dick!", argument))
+       ||  (!str_infix(" prick ", argument))
+	||  (!str_prefix("prick ", argument))
+	||  (!str_suffix(" prick", argument))
+	||  (!str_suffix(" prick.", argument))
+	||  (!str_suffix(" prick!", argument))
+	||  (!str_cmp("prick", argument))
+	||  (!str_cmp("prick.", argument))
+	||  (!str_cmp("prick!", argument))
+       ||  (!str_infix(" asshole ", argument))
+	||  (!str_prefix("asshole ", argument))
+	||  (!str_suffix(" asshole", argument))
+	||  (!str_suffix(" asshole.", argument))
+	||  (!str_suffix(" asshole!", argument))
+	||  (!str_cmp("asshole", argument))
+	||  (!str_cmp("asshole.", argument))
+	||  (!str_cmp("asshole!", argument))
+       ||  (!str_infix(" motherfucker ", argument))
+	||  (!str_prefix("motherfucker ", argument))
+	||  (!str_suffix(" motherfucker", argument))
+	||  (!str_suffix(" motherfucker.", argument))
+	||  (!str_suffix(" motherfucker!", argument))
+	||  (!str_cmp("motherfucker", argument))
+	||  (!str_cmp("motherfucker.", argument))
+	||  (!str_cmp("motherfucker!", argument))
+       ||  (!str_cmp("shit", argument))
+	||  (!str_cmp("shit.", argument))
+	||  (!str_cmp("shit!", argument))
+	||  (!str_infix(" shit ", argument))
+	||  (!str_prefix("shit ", argument))
+	||  (!str_suffix(" shit", argument))
+	||  (!str_suffix(" shit.", argument))
+	||  (!str_suffix(" shit!", argument)))
+	{
+	if (!IS_IMMORTAL(ch))
+	  {
+	  send_to_char("Your attempt at using profanity is being brought to the 
attention of the staff!\n\r",ch);
+	  return;
+	  }
+ }

The exception of course, is do_say. To get it to work in do_say and do_yell,
just slap it in after...

if ( arguement[0] == '\0' )
{
    sent_to_char( "Say what?\n\r", ch );
    return;
}

/*ADD CENSOR CODE HERE*/

If you want to add an alert for Wiznet, all you do is this...

add #define WIZ_CURSE to merc.h and assign a letter, with the rest of the 
wiznet flags.

add this to struct wiznet_type in const.c  before the NULL entry
     {    "curse",    WIZ_CURSE,    IM },

and last of all, modify the above code to look something like this...

<snip>
+        if (!IS_IMMORTAL(ch))
+          {
+          send_to_char("Your attempt at using profanity is being brought to 
the attention of the staff!\n\r",ch);
+          wiznet($N is making an attempt to curse in 'gossips.'", ch, NULL, 
WIZ_CURSE, 0, 0);
+          return;
+          }
+ }

Of course, change the channel name, and message however you like it.

I believe that to be all. It's pretty simple, but it has worked well for me 
so far. BUT
people have creative minds and will always find a way around. At least maybe 
you can identify
a problem person before it gets out of control.

No credit need be given for this, because none is taken for this. I'll be 
updating this
as I find new and improved ways of doing this.

Also, I haven't even a clue where to begin on how to prevent people from 
emoting garbage.
If you have any suggestions, please feel free to drop me a line.

If you have suggestions, comments, complaints, on how to improve this, 
please mail me at

                            arkaylis@hotmail.com

Enjoy,
Nathan
(no snazzy mudname or mudaddress as of yet, all offline dev)

