How to Create a Language and CAPS Filter

How to Create a Language and CAPS Filter

Postby LogicaLucidity » 05 Feb 2013, 03:43

How to create a Language and CAPS filter.

The following threads are all You need to do this:
viewtopic.php?f=12&t=1400
viewtopic.php?f=21&t=1009
viewtopic.php?f=21&t=984

All credit goes to Ultima and Dzienny.

If anyone can improve on what is in this thread I urge them to do so.
I am only passing on what I pulled from the above threads.

I have been using this for a several months and really think every server would benefit from having such a thing.

I have assisted Kozmik and Mendez with their filters on their servers and they have had no issues with these instructions.

Given how this operates, a word like 'ass' would make the word 'glass' appear like "gl***".
Knowing this fact, there are some words that you might want to not ban.
Keep this in mind. I have been tailoring my list for several months and feel that it is solid.

I started with the Google bad word list and worked it from there. Yes, the list is overkill and redundant.
Given that it is case sensitive, the list of bad words is in separate parts.
The top is all lowercase. The bottom is the same words with a single capital letter at the beginning of the word.
The CAPS filter will catch the all cap words and will, in turn, see them as all lowercase and censor them.
The code I use will be included below.

This is a command that is automatically executed upon server start.
If any message has more than 3 Caps in it then all text in that message is auto set to lower case.
If any word listed is used it changes it to *** no matter the length.

1. Go to http://www.microsoft.com/visualstudio/eng/downloads and download Visual C# 2010 Express.
2. Install Visual C# 2010 Express. You can register it for free. If you do not it will stop working and force you to register it for free.
3. Open Visual C# 2010 Express. Click the toolbar...Tools>Settings>Expert Settings.
4. Click on New project and select Class Library and click OK.
5. Copy the code below.

Code: Select all
using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using MCDzienny;

namespace MCDzienny
{
    public class CmdChatFilter : Command
    {
        public override string name { get { return "cf"; } }
        public override string shortcut { get { return ""; } }
        public override string type { get { return ""; } }
        public override bool museumUsable { get { return false; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }
        private static string Caps = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        private static int maxcaps = 3;

        public override void Init()
        {
            Player.PlayerChatEvent += FilterChat;
        }

        private void FilterChat(Player p, ref string message, ref bool stopIt)
        {

            //Check for caps
            int caps = 0;
            string changedMessage = message;
            foreach (char c in changedMessage)
            {
                foreach (char s in Caps)
                {
                    if (c == s)
                    {
                        caps++;
                    }
                }
            }

            string msg;
            if (caps > maxcaps)
            {
                msg = changedMessage.ToLower();
            }
            else
            {
                msg = changedMessage;
            }

            //Check for bad words
            string[] strBadWords = new string[] {
                            "4r5e",
                            "5h1t",
                            "5hit",
                            "a55",
                            "ar5e",
                            "arrse",
                            "arse",
                            "asshole",
                            "b!tch",
                            "b00bs",
                            "b17ch",
                            "b1tch",
                            "ballbag",
                            "balls",
                            "ballsack",
                            "bastard",
                            "basterd",
                            "basturd",
                            "beastial",
                            "beastiality",
                            "bestial",
                            "bestiality",
                            "bi+ch",
                            "biatch",
                            "biotch",
                            "bitch",
                            "blow job",
                            "blowjob",
                            "blowjobs",
                            "bollock",
                            "bollok",
                            "boner",
                            "boob",
                            "boobs",
                            "booobs",
                            "boooobs",
                            "booooobs",
                            "boooooobs",
                            "booooooobs",
                            "boooooooobs",
                            "booooooooobs",
                            "boooooooooobs",
                            "booooooooooobs",
                            "boooooooooooobs",
                            "booooooooooooobs",
                            "boooooooooooooobs",
                            "booooooooooooooobs",
                            "boooooooooooooooobs",
                            "booooooooooooooooobs",
                            "boooooooooooooooooobs",
                            "breasts",
                            "buceta",
                            "bugger",
                            "c0ck",
                            "carpet muncher",
                            "cawk",
                            "chink",
                            "cipa",
                            "cl1t",
                            "clit",
                            "clitoris",
                            "clits",
                            "cnut",
                            "cock",
                            "cokmuncher",
                            "coksucka",
                            "cox",
                            "cum",
                            "cumm",
                            "cumshot",
                            "cunilingus",
                            "cunillingus",
                            "cunnilingus",
                            "cunt",
                            "cuntlick",
                            "cuntlicker",
                            "cuntlicking",
                            "cyberfuc",
                            "d1ck",
                            "dick",
                            "dickhead",
                            "dildo",
                            "dlck",
                            "donkeyribber",
                            "doosh",
                            "duche",
                            "dumbass",
                            "dumass",
                            "dyke",
                            "ejaculate",
                            "ejaculated",
                            "ejaculates",
                            "ejaculating",
                            "ejaculatings",
                            "ejaculation",
                            "ejakulate",
                            "f u c k",
                            "f u c k e r",                           
                            "fag",
                            "fagging",
                            "faggitt",
                            "faggot",
                            "faggs",
                            "fagot",
                            "fagots",
                            "fags",
                            "fanny",
                            "fannyflaps",
                            "fannyfucker",
                            "fanyy",
                            "fatass",
                            "fcuk",
                            "fcuker",
                            "fcuking",
                            "feck",
                            "fecker",
                            "felching",
                            "fellate",
                            "fellatio",
                            "fingerfuck",
                            "fingerfucked",
                            "fingerfucker",
                            "fingerfuckers",
                            "fingerfucking",
                            "fingerfucks",
                            "fistfuck",
                            "fistfucked",
                            "fistfucker",
                            "fistfuckers",
                            "fistfucking",
                            "fistfuckings",
                            "fistfucks",
                            "flange",
                            "fook",
                            "fooker",
                            "fuck",
                            "fuuck",
                            "fuuuck",
                            "fuuuuck",
                            "fuuuuuck",
                            "fuuuuuuck",
                            "fuuuuuuuck",
                            "fuuuuuuuuck",
                            "fuuuuuuuuuck",
                            "fuuuuuuuuuuck",
                            "fuuuuuuuuuuuck",
                            "fuuuuuuuuuuuuck",
                            "fuuuuuuuuuuuuuck",
                            "fuuuuuuuuuuuuuuck",
                            "fuuuuuuuuuuuuuuuck",
                            "fuuuuuuuuuuuuuuuuck",
                            "fuuuuuuuuuuuuuuuuuck",
                            "fuuuuuuuuuuuuuuuuuuck",
                            "fucka",
                            "fucked",
                            "fucker",
                            "fuckers",
                            "fuckhead",
                            "fuckheads",
                            "fuckin",
                            "fucking",
                            "fuckings",
                            "fuckingshitmotherfucker",
                            "fuckme",
                            "fucks",
                            "fuckwhit",
                            "fuckwit",
                            "fudge packer",
                            "fudgepacker",
                            "fuhk",
                            "fuk",
                            "fuker",
                            "fukker",
                            "fukkin",
                            "fuks",
                            "fukwhit",
                            "fukwit",
                            "fux",
                            "fux0r",
                            "f_u_c_k",
                            "gangbang",
                            "gangbanged",
                            "gangbangs",
                            "gaylord",
                            "gaysex",
                            "goatse",
                            "god-dam",
                            "god dam",
                            "goddam",
                            "god-damned",
                            "goddamn",
                            "god damn",
                            "goddamned",
                            "god damned",
                            "hardcoresex",
                            "homo",
                            "horniest",
                            "horny",
                            "hotsex",
                            "idiot",
                            "1diot",
                            "id1ot",
                            "1d1ot",
                            "jack-off",
                            "jackoff",
                            "jerk-off",
                            "jism",
                            "jiz",
                            "jizm",
                            "jizz",
                            "kawk",
                            "knob",
                            "knobead",
                            "knobed",
                            "knobend",
                            "knobhead",
                            "knobjocky",
                            "knobjokey",
                            "kock",
                            "kondum",
                            "kondums",
                            "kum",
                            "kummer",
                            "kumming",
                            "kums",
                            "kunilingus",
                            "laag",
                            "laaag",
                            "laaaag",
                            "laaaaag",
                            "laaaaaag",
                            "laaaaaaag",
                            "laaaaaaaag",
                            "laaaaaaaaag",
                            "laaaaaaaaaag",
                            "laaaaaaaaaaag",
                            "laaaaaaaaaaaag",
                            "laaaaaaaaaaaaag",
                            "laaaaaaaaaaaaaag",
                            "laaaaaaaaaaaaaaag",
                            "laaaaaaaaaaaaaaaag",
                            "laaaaaaaaaaaaaaaaag",
                            "laaaaaaaaaaaaaaaaaag",
                            "l3i+ch",
                            "l3itch",
                            "labia",
                            "m0f0",
                            "m0fo",
                            "m45terbate",
                            "ma5terb8",
                            "ma5terbate",
                            "masochist",
                            "master-bate",
                            "masterb8",
                            "masterbat*",
                            "masterbat3",
                            "masterbate",
                            "masterbation",
                            "masterbations",
                            "masturbate",
                            "mo-fo",
                            "mof0",
                            "mofo",
                            "moron",
                            "mothafuck",
                            "mothafucka",
                            "mothafuckas",
                            "mothafuckaz",
                            "mothafucked",
                            "mothafucker",
                            "mothafuckers",
                            "mothafuckin",
                            "mothafucking",
                            "mothafuckings",
                            "mothafucks",
                            "mother fucker",
                            "motherfuck",
                            "motherfucked",
                            "motherfucker",
                            "motherfuckers",
                            "motherfuckin",
                            "motherfucking",
                            "motherfuckings",
                            "motherfuckka",
                            "motherfucks",
                            "muthafecker",
                            "muthafuckker",
                            "muther",
                            "mutherfucker",
                            "n1gga",
                            "n1gger",
                            "nazi",
                            "nigg3r",
                            "nigg4h",
                            "nigga",
                            "niggah",
                            "niggas",
                            "niggaz",
                            "nigger",
                            "niggers",
                            "nob jokey",
                            "nobhead",
                            "nobjocky",
                            "nobjokey",
                            "numbnuts",
                            "nutsack",
                            "orgasim",
                            "orgasims",
                            "orgasm",
                            "orgasms",
                            "p0rn",
                            "pecker",
                            "penis",
                            "penisfucker",
                            "phonesex",
                            "phuck",
                            "phuk",
                            "phuked",
                            "phuking",
                            "phukked",
                            "phukking",
                            "phuks",
                            "phuq",
                            "pigfucker",
                            "pimpis",
                            "piss",
                            "pissed",
                            "pisser",
                            "pissers",
                            "pissflaps",
                            "pissin",
                            "pissing",
                            "pissoff",
                            "porn",
                            "porno",
                            "pornography",
                            "pornos",
                            "prick",
                            "pricks",
                            "pron",
                            "pube",
                            "pusse",
                            "pussi",
                            "pussies",
                            "pussy",
                            "pussys",
                            "rectum",
                            "retard",
                            "rimjaw",
                            "rimming",
                            "s hit",
                            "s h i t",
                            "s.o.b.",
                            "schlong",
                            "screwing",
                            "scroat",
                            "scrote",
                            "scrotum",
                            "sh!+",
                            "sh!t",
                            "sh1t",
                            "shag",
                            "shagger",
                            "shaggin",                           
                            "shemale",
                            "shi+",
                            "shit",
                            "shiit",
                            "shiiit",
                            "shiiiit",
                            "shiiiiit",
                            "shiiiiiit",
                            "shiiiiiiit",
                            "shiiiiiiiit",
                            "shiiiiiiiiit",
                            "shiiiiiiiiiit",
                            "shitdick",
                            "shite",
                            "shited",
                            "shitey",
                            "shitfuck",                           
                            "shitfull",
                            "shithead",
                            "shiting",
                            "shitings",
                            "shits",
                            "shitted",
                            "shitter",
                            "shitters",
                            "shitting",
                            "shittings",
                            "shitty",
                            "skank",
                            "skull fuck",
                            "skullfuck",                           
                            "slut",
                            "sluts",
                            "smegma",
                            "smut",
                            "snatch",
                            "son-of-a-bitch",
                            "son of a bitch",
                            "suck",
                            "suck it",
                            "suckit",
                            "sucks",
                            "sux",
                            "s_h_i_t",
                            "t1tt1e5",
                            "t1tties",
                            "teets",
                            "testical",
                            "testicle",
                            "titfuck",
                            "tittie5",
                            "tittiefucker",
                            "titties",
                            "tittyfuck",
                            "tittywank",
                            "titwank",
                            "tosser",
                            "tw4t",
                            "twat",
                            "twathead",
                            "twatty",
                            "twunt",
                            "twunter",
                            "vagina",
                            "vulva",
                            "w00se",
                            "wang",
                            "wank",
                            "wanker",
                            "wanky",
                            "whoar",
                            "xrated",
                            "xxx",
                            "4r5e",
                            "5h1t",
                            "5hit",
                            "A55",
                            "Ar5e",
                            "Arrse",
                            "Arse",
                            "B!tch",
                            "B00bs",
                            "B17ch",
                            "B1tch",
                            "Ballbag",
                            "Balls",
                            "Ballsack",
                            "Bastard",
                            "Basterd",
                            "Basturd",
                            "Beastial",
                            "Beastiality",
                            "Bestial",
                            "Bestiality",
                            "Bi+ch",
                            "Biatch",
                            "Biotch",
                            "Bitch",
                            "Blow Job",
                            "Blowjob",
                            "Blowjobs",
                            "Bollock",
                            "Bollok",
                            "Boner",
                            "Boob",
                            "Boobs",
                            "Booobs",
                            "Boooobs",
                            "Booooobs",
                            "Boooooobs",
                            "Booooooobs",
                            "Boooooooobs",
                            "Booooooooobs",
                            "Boooooooooobs",
                            "Booooooooooobs",
                            "Boooooooooooobs",
                            "Booooooooooooobs",
                            "Boooooooooooooobs",
                            "Booooooooooooooobs",
                            "Boooooooooooooooobs",
                            "Booooooooooooooooobs",
                            "Boooooooooooooooooobs",
                            "Breasts",
                            "Buceta",
                            "Bugger",
                            "C0ck",
                            "Carpet Muncher",
                            "Cawk",
                            "Chink",
                            "Cipa",
                            "Cl1t",
                            "Clit",
                            "Clitoris",
                            "Clits",
                            "Cnut",
                            "Cock",
                            "Cokmuncher",
                            "Coksucka",
                            "Coon",
                            "Cumm",
                            "Cumshot",
                            "Cunilingus",
                            "Cunillingus",
                            "Cunnilingus",
                            "Cunt",
                            "Cuntlick",
                            "Cuntlicker",
                            "Cuntlicking",
                            "Cyberfuc",
                            "D1ck",
                            "Dick",
                            "Dickhead",
                            "Dildo",
                            "Dlck",
                            "Donkeyribber",
                            "Doosh",
                            "Duche",
                            "Dumbass",
                            "Dumass",
                            "Dyke",
                            "Ejaculate",
                            "Ejaculated",
                            "Ejaculates",
                            "Ejaculating",
                            "Ejaculatings",
                            "Ejaculation",
                            "Ejakulate",
                            "F U C K",
                            "F U C K E R",
                            "Fag",
                            "Fagging",
                            "Faggitt",
                            "Faggot",
                            "Faggs",
                            "Fagot",
                            "Fagots",
                            "Fags",
                            "Fatass",
                            "Fcuk",
                            "Fcuker",
                            "Fcuking",
                            "Feck",
                            "Fecker",
                            "Felching",
                            "Fellate",
                            "Fellatio",
                            "Fingerfuck",
                            "Fingerfucked",
                            "Fingerfucker",
                            "Fingerfuckers",
                            "Fingerfucking",
                            "Fingerfucks",
                            "Fistfuck",
                            "Fistfucked",
                            "Fistfucker",
                            "Fistfuckers",
                            "Fistfucking",
                            "Fistfuckings",
                            "Fistfucks",
                            "Flange",
                            "Fook",
                            "Fooker",
                            "Fuck",
                            "Fuuck",
                            "Fuuuck",
                            "Fuuuuck",
                            "Fuuuuuck",
                            "Fuuuuuuck",
                            "Fuuuuuuuck",
                            "Fuuuuuuuuck",
                            "Fuuuuuuuuuck",
                            "Fuuuuuuuuuuck",
                            "Fuuuuuuuuuuuck",
                            "Fuuuuuuuuuuuuck",
                            "Fuuuuuuuuuuuuuck",
                            "Fuuuuuuuuuuuuuuck",
                            "Fuuuuuuuuuuuuuuuck",
                            "Fuuuuuuuuuuuuuuuuck",
                            "Fuuuuuuuuuuuuuuuuuck",
                            "Fuuuuuuuuuuuuuuuuuuck",
                            "Fucka",
                            "Fucked",
                            "Fucker",
                            "Fuckers",
                            "Fuckhead",
                            "Fuckheads",
                            "Fuckin",
                            "Fucking",
                            "Fuckings",
                            "Fuckingshitmotherfucker",
                            "Fuckme",
                            "Fucks",
                            "Fuckwhit",
                            "Fuckwit",
                            "Fudge Packer",
                            "Fudgepacker",
                            "Fuhk",
                            "Fuk",
                            "Fuker",
                            "Fukker",
                            "Fukkin",
                            "Fuks",
                            "Fukwhit",
                            "Fukwit",
                            "Fux",
                            "Fux0r",
                            "F_u_c_k",
                            "Gangbang",
                            "Gangbanged",
                            "Gangbangs",
                            "Gaylord",
                            "Gaysex",
                            "Goatse",
                            "God-dam",
                            "God dam",
                            "Goddam",
                            "God-damned",
                            "Goddamn",
                            "God damn",
                            "Goddamned",
                            "God damned",
                            "Hardcoresex",
                            "Homo",
                            "Horniest",
                            "Horny",
                            "Hotsex",
                            "Idiot",
                            "1diot",
                            "Id1ot",
                            "1d1ot",
                            "Jack-off",
                            "Jackoff",
                            "Jerk-off",
                            "Jism",
                            "Jiz",
                            "Jizm",
                            "Jizz",
                            "Kawk",
                            "Knobead",
                            "Knobed",
                            "Knobend",
                            "Knobhead",
                            "Knobjocky",
                            "Knobjokey",
                            "Kock",
                            "Kondum",
                            "Kondums",
                            "Kum",
                            "Kummer",
                            "Kumming",
                            "Kums",
                            "Kunilingus",
                            "Laag",
                            "Laaag",
                            "Laaaag",
                            "Laaaaag",
                            "Laaaaaag",
                            "Laaaaaaag",
                            "Laaaaaaaag",
                            "Laaaaaaaaag",
                            "Laaaaaaaaaag",
                            "Laaaaaaaaaaag",
                            "Laaaaaaaaaaaag",
                            "Laaaaaaaaaaaaag",
                            "Laaaaaaaaaaaaaag",
                            "Laaaaaaaaaaaaaaag",
                            "Laaaaaaaaaaaaaaaag",
                            "Laaaaaaaaaaaaaaaaag",
                            "Laaaaaaaaaaaaaaaaaag",
                            "L3i+ch",
                            "L3itch",
                            "Labia",
                            "M0f0",
                            "M0fo",
                            "M45terbate",
                            "Ma5terb8",
                            "Ma5terbate",
                            "Masochist",
                            "Master-bate",
                            "Masterb8",
                            "Masterbat*",
                            "Masterbat3",
                            "Masterbate",
                            "Masterbation",
                            "Masterbations",
                            "Masturbate",
                            "Mo-fo",
                            "Mof0",
                            "Mofo",
                            "Moron",
                            "Mothafuck",
                            "Mothafucka",
                            "Mothafuckas",
                            "Mothafuckaz",
                            "Mothafucked",
                            "Mothafucker",
                            "Mothafuckers",
                            "Mothafuckin",
                            "Mothafucking",
                            "Mothafuckings",
                            "Mothafucks",
                            "Mother Fucker",
                            "Motherfuck",
                            "Motherfucked",
                            "Motherfucker",
                            "Motherfuckers",
                            "Motherfuckin",
                            "Motherfucking",
                            "Motherfuckings",
                            "Motherfuckka",
                            "Motherfucks",
                            "Muthafecker",
                            "Muthafuckker",
                            "Muther",
                            "Mutherfucker",
                            "N1gga",
                            "N1gger",
                            "Nazi",
                            "Nigg3r",
                            "Nigg4h",
                            "Nigga",
                            "Niggah",
                            "Niggas",
                            "Niggaz",
                            "Nigger",
                            "Niggers",
                            "Nob Jokey",
                            "Nobhead",
                            "Nobjocky",
                            "Nobjokey",
                            "Numbnuts",
                            "Nutsack",
                            "Orgasim",
                            "Orgasims",
                            "Orgasm",
                            "Orgasms",
                            "P0rn",
                            "Pecker",
                            "Penis",
                            "Penisfucker",
                            "Phonesex",
                            "Phuck",
                            "Phuk",
                            "Phuked",
                            "Phuking",
                            "Phukked",
                            "Phukking",
                            "Phuks",
                            "Phuq",
                            "Pigfucker",
                            "Pimpis",
                            "Piss",
                            "Pissed",
                            "Pisser",
                            "Pissers",
                            "Pissflaps",
                            "Pissin",
                            "Pissing",
                            "Pissoff",
                            "Porn",
                            "Porno",
                            "Pornography",
                            "Pornos",
                            "Prick",
                            "Pricks",
                            "Pron",
                            "Pube",
                            "Pusse",
                            "Pussi",
                            "Pussies",
                            "Pussy",
                            "Pussys",
                            "Rectum",
                            "Retard",
                            "Rimjaw",
                            "Rimming",
                            "S Hit",
                            "S H I T",
                            "S.o.b.",
                            "Schlong",
                            "Screwing",
                            "Scroat",
                            "Scrote",
                            "Scrotum",
                            "Sh!+",
                            "Sh!t",
                            "Sh1t",
                            "Shag",
                            "Shagger",
                            "Shaggin",                           
                            "Shemale",
                            "Shi+",
                            "Shit",
                            "Shiit",
                            "Shiiit",
                            "Shiiiit",
                            "Shiiiiit",
                            "Shiiiiiit",
                            "Shiiiiiit",
                            "Shiiiiiiiit",
                            "Shiiiiiiiiit",
                            "Shiiiiiiiiiit",
                            "Shitdick",
                            "Shite",
                            "Shited",
                            "Shitey",
                            "Shitfuck",                           
                            "Shitfull",
                            "Shithead",
                            "Shiting",
                            "Shitings",
                            "Shits",
                            "Shitted",
                            "Shitter",
                            "Shitters",
                            "Shitting",
                            "Shittings",
                            "Shitty",
                            "Skank",
                            "Skull Fuck",
                            "Skullfuck",                           
                            "Slut",
                            "Sluts",
                            "Smegma",
                            "Smut",
                            "Snatch",
                            "Son-of-a-bitch",
                            "Son Of A Bitch",
                            "Suck It",
                            "Suckit",
                            "Suck",
                            "Suck it",
                            "Suckit",
                            "Sucks",
                            "Sux",
                            "S_h_i_t",
                            "T1tt1e5",
                            "T1tties",
                            "Teets",
                            "Testical",
                            "Testicle",
                            "Titfuck",
                            "Tittie5",
                            "Tittiefucker",
                            "Titties",
                            "Tittyfuck",
                            "Tittywank",
                            "Titwank",
                            "Tosser",
                            "Tw4t",
                            "Twat",
                            "Twathead",
                            "Twatty",
                            "Twunt",
                            "Twunter",
                            "Vagina",
                            "Vulva",
                            "W00se",
                            "Wang",
                            "Wank",
                            "Wanker",
                            "Wanky",
                            "Whoar",
                            "Xrated",
                            "Xxx",
            };
            foreach (string badWord in strBadWords)
            {
                msg = msg.Replace(badWord, "***");
            }
            message = msg;
        }


        public override void Help(Player p)
        { }
        public override void Use(Player p, string message)
        { }
    }
}


6. Go to your New Project in Visual C# 2010 Express and delete everything that is already there.
7. Hit CTRL-V to paste what you copied from step 5 into your new project
8. Alter the bad words if you wish. Make sure to add the word with a capitalized first letter in the bottom half of the list.
9. Click on the toolbar...View>Output to open up the output window near the bottom.
10. Click the toolbar...Build>Build Solution
11. Check the Output window for the path to find your DLL file

Example:
C:\Users\LogicaLucidity\documents\visual studio 2010\Projects\ClassLibrary1\ClassLibrary1\bin\Release\ClassLibrary1.dll

12. Copy the dll file to your desktop. Rename the ClassLibrary1.dll to badwords.
13. If you have not done so...in your mcdzienny lava server folder....
- In the extra folder add a folder named 'commands'
- In the commands folder add a folder named 'dll' (that is DLL)
- In the dll folder add a folder named 'cmd'
- So the folder path would look like.... MCDzienny>extra>commands>dll>cmd

14. Place your new badwords.dll in the cmd folder from the last step.
15. You need to go to your text folder and find the 'cmdautoload' text file. Add the following line of text to the 'cmdautoload' text file: /badwords
16. Restart server.

You can always open your badwords.dll and alter the list at anytime, replace the dll in your cmd folder, and restart your server.

I hope this was helpful.

Please, if anyone wants to add or correct any of this, please do so.

- Logic
- [Logic] Lava Survival -
User avatar
LogicaLucidity
 
Posts: 104
Joined: 17 Oct 2011, 09:36

Re: How to Create a Language and CAPS Filter

Postby ismellike » 05 Feb 2013, 04:16

:0 nice, that list of bad words is way better than the one I have now.

How long did it take? xD
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas

Re: How to Create a Language and CAPS Filter

Postby LogicaLucidity » 05 Feb 2013, 05:22

Thank you. But again, I only took what Dzienny and Ultima had already provided.

I started off with the Google bad word list and then altered it. It is very redundant.

http://fffff.at/googles-official-list-of-bad-words/

From there I copied the list and capitalized the first letter of each word and pasted the list again at the bottom.

This is done so that when those who cuss and capitalize the first letter only get filtered. If not done, the CAPS filter will not catch it since it looks for 3 Capitalized letters and the single Cap'd letter will bypass the language filter since it is case sensitive. If they Capitalize the whole word then the filter will lowercase the entire word and the language filter will catch it since it is now lowercase.

Once I had the list transferred I let my users go at it and find all the words that were filtered that really did not need to be filtered. I also had a massive amount of words that were root words of other words that were common enough that they needed to be un-listed. Having a common word such as glass turning to 'gl***' over and over is really a bummer and makes it look like you do not know what you are doing as an owner.

The list I have posted above has been used for several months.
MY staff and I have hammered it out and I feel we have a solid list that everyone can use.
We have weeded out words that result in false positives.. (ass, glass, gl***)

I am positive that this system can be improved upon and probably already has been.
It is my hope that those who can, or have already done so, will speak up.

Thanks,
- Logic
- [Logic] Lava Survival -
User avatar
LogicaLucidity
 
Posts: 104
Joined: 17 Oct 2011, 09:36

Re: How to Create a Language and CAPS Filter

Postby LogicaLucidity » 05 Feb 2013, 07:43

If you do not want the hassle of useing MS Studio and only want to use the .dll I use then here you go.

Fast and easy...

NOTE: The following method will not allow you to alter the bad word list.
This is for those who only want to use what I use.
If you want to alter the list follow the first post.

1. Go to your text folder and find the 'cmdautoload' text file.
Add the following line of text with no spaces to the 'cmdautoload' text file : /badwords

2. Next you need to go to your extra folder and add some folders.
In the 'extra' folder add a folder named 'commands'
In the 'commands' folder add a folder named 'dll' (that is DLL)
In the 'dll' folder add a folder named 'cmd'
So the folder path would look like.... MCDzienny>extra>commands>dll>cmd

3. Next you will add the 'badwords.dll' file in the 'cmd' folder you just created.
You can get the badwords.dll file I use by extracting it form the following compressed file:

badwords.zip
(9.38 KiB) Downloaded 44 times

4. Restart server. Done.

- Logic
- [Logic] Lava Survival -
User avatar
LogicaLucidity
 
Posts: 104
Joined: 17 Oct 2011, 09:36

Re: How to Create a Language and CAPS Filter

Postby Conor » 05 Feb 2013, 19:25

If you want the ability to add/remove words easily via a text file then you can change the code to check for the bad words.
Instead of creating that new list containing all the words in the code, you just run a foreach loop through the contents of the text file. For example:

Code: Select all
using System.IO;


if (File.Exists("extra/filter.txt"))
{
   try
   {
      foreach (string badWord in File.ReadAllLines("extra/filter.txt"))
      {
           msg = msg.Replace(badWord, "&c<Removed>" + Server.DefaultColor);
      }
   }
   catch { }
}
message = msg;


Then you can simply make a filter.txt file in the extra folder, and put your badwords on seperate lines there.
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor

Re: How to Create a Language and CAPS Filter

Postby LogicaLucidity » 05 Feb 2013, 19:59

Thank you Conor. This is the kind of improvement that I was referring too.

Your work on this forum is invaluable. Thank you.

This is something that can and should be a default part of the server via an update.

I would like to think that the CAPS filter could be added via an update and have a simple box to check in the properties for on/off.

Having a simple blank text file for a language filter and a simple on and off for the CAPS filter would be great.

I am sure having the two features operate independently of each other would be ideal for some.

Dzienny, please consider making these features a part of your server be default.

These two features are essential in helping servers become more family friendly and less like a boys locker room.

Thanks,
- Logic
- [Logic] Lava Survival -
User avatar
LogicaLucidity
 
Posts: 104
Joined: 17 Oct 2011, 09:36

Re: How to Create a Language and CAPS Filter

Postby Conor » 06 Feb 2013, 16:30

I agree with you :)
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor

Re: How to Create a Language and CAPS Filter

Postby toystory_justin » 07 Feb 2013, 12:12

Conor wrote:If you want the ability to add/remove words easily via a text file then you can change the code to check for the bad words.
Instead of creating that new list containing all the words in the code, you just run a foreach loop through the contents of the text file. For example:

Code: Select all
using System.IO;


if (File.Exists("extra/filter.txt"))
{
   try
   {
      foreach (string badWord in File.ReadAllLines("extra/filter.txt"))
      {
           msg = msg.Replace(badWord, "&c<Removed>" + Server.DefaultColor);
      }
   }
   catch { }
}
message = msg;


Then you can simply make a filter.txt file in the extra folder, and put your badwords on seperate lines there.


Where to add this in? Never made/edited a command before;/
toystory_justin
 
Posts: 224
Joined: 11 Nov 2012, 07:12
Location: On a dark place

Re: How to Create a Language and CAPS Filter

Postby dzienny » 07 Feb 2013, 22:09

It's a very nice article. I haven't added a bad language filter yet, since there were other things I worked on and it could have been added manually anyway. But now I will fulfil the request. The chat filter should be included in the next release. Also, I will probably use this dirty list :)

@Conor
That's a simple and working solution. Still, constant reading from a hard drive is relatively costly. It'd be wise to implement some kind of caching to memory.
User avatar
dzienny
Administrator
 
Posts: 1181
Joined: 23 Jan 2011, 14:27

Re: How to Create a Language and CAPS Filter

Postby LogicaLucidity » 07 Feb 2013, 22:28

I, as well as many other owners, truly do appreciate it Dzienny.

Thank you,

- Logic
- [Logic] Lava Survival -
User avatar
LogicaLucidity
 
Posts: 104
Joined: 17 Oct 2011, 09:36

Next

Return to How-To

Who is online

Users browsing this forum: No registered users and 2 guests

cron