PDA

View Full Version : swear filter


04-24-2008, 10:12 PM
talking to someone about it earlier, was fun to try out he he


function onCreated() {
temp.chat = "Hello you ****ing queer ****! I hope that you****ing die!!";
temp.illegal = {"****ing", "queer", "****"};

temp.token = chat.tokenize();
temp.len = null;
temp.res = "";

for (temp.i: token) {
if (i in illegal) {
for (len = 0; len < i.length(); len++)
res @= randomstring("$", "", "#");
} else
for (temp.c: illegal) {
if (i.starts(c)) {
for (len = i.charat(c); len < c.length(); len++)
res @= randomstring("$", "", "#");
res @= i.substring(c.length());
} else if(i.ends(c)) {
res @= i.substring(0, i.length() - c.length());
for (len = i.charat(c); len < c.length(); len++)
res @= randomstring("$", "", "#");
}
}
if (len == null)
res @= i;

temp.output @= res.trim() @ " ";
res = "";
len = null;
}

echo(output);
}

Programmer
04-24-2008, 10:17 PM
talking to someone about it earlier, was fun to try out he he


function onCreated() {
temp.chat = "Hello you ****ing queer ****!";
temp.illegal = {"****ing", "queer", "****"};

temp.token = chat.tokenize();
temp.len = null;
temp.res = "";

for (temp.i: token) {
if (i in illegal) {
for (len = 0; len < i.length(); len++)
res @= randomstring("$", "", "#");
} else
for (temp.c: illegal) {
if (i.starts(c)) {
for (len = i.charat(c); len < c.length(); len++)
res @= randomstring("$", "", "#");
res @= i.substring(c.length());
}
}
if (len == null)
res @= i;

temp.output @= res.trim() @ " ";
res = "";
len = null;
}

echo(output);
}


Looks good, but I highly suggest you not use the Euro sign ... its not supported on some machines.

Crow
04-24-2008, 10:40 PM
Looks good, but I highly suggest you not use the Euro sign ... its not supported on some machines.

That's not the Euro sign ._.'

04-24-2008, 10:42 PM
whats the euro sign...? lol.......

Programmer
04-24-2008, 10:47 PM
That's not the Euro sign ._.'

Pound sign, sorry.

Crow
04-24-2008, 10:47 PM
whats the euro sign...? lol.......

This is Euro -> €
But I guess Programmer was referring to .

Edit: :)

Desear
04-24-2008, 11:04 PM
Would be nice if their could actually be an option to disable the swear filter for more mature players, and such. That way it will satisfy the trash talkers, and the people who don't want to see it.

By any chance is that scripting making curse words appear like this, "@$$#" or something?

04-24-2008, 11:12 PM
yes

Tigairius
04-24-2008, 11:20 PM
It's okay, but why not just use:
http://graal.net/index.php/Creation/Dev/Word_Filter

cbk1994
04-25-2008, 03:00 AM
Swear filters are useless, there are any number of ways to get past them.