ID:265724
 
mob
proc
filter(string)
for(var/i in src.curses)
var/pos = src.case ? findText(string,i) : findtext(string,i)
while(pos)
string = copytext(string,1,pos) + stars(i) + copytext(string,pos+length(i))
pos = findtext(string,i)
return string
stars(string)
if(!istext(string)) return stars("[string]")
var/stars = ""
var/len = length(string)
for(var/i = 1 to len)
stars += "*"
return stars

mob
var
list
curses = list("Crap","Poo","Hilary Clinton")
case
filtering = 1
verb
Add_Word(t as text)
if(t in src.curses) return
src.curses += t
src << "You are now filtering [t] with a total of [src.curses.len] filtered words"
Remove_Word(i in src.curses)
src.curses -= i
src << "[i] is no longer filtered, you are now filtering [src.curses.len] words"
Toggle_Case_Sensitivity()
src.case = !src.case
src << "Your filter is [src.case ? "now" : "no longer"] case sensitive"
ToggleFilter()
src.filtering = !src.filtering
if(!src.filtering)
src.verbs -= /mob/verb/Add_Word
src.verbs -= /mob/verb/Remove_Word
src.verbs -= /mob/verb/Toggle_Case_Sensitivity
else
src.verbs += /mob/verb/Add_Word
src.verbs += /mob/verb/Remove_Word
src.verbs += /mob/verb/Toggle_Case_Sensitivity
Say(t as text)
for(var/client/C)
C << "[src.name] : [C.mob.filtering ? C.mob.filter(t) : (t)]"

Is that the best way to go about it? Like letting the user decide if he wants his messages filtered and to choose what words he wants filtered?
I don't think players should be able to choose exactly what words. Not much use in it either.

Consider this as well: shouldn't players always see the same output? One player may not see a word while another will, which might create confusion or misinterpretation, dependably.
In response to Kaioken
I think that's partly the intention -- where some players will censor words that offend them from appearing on their own screens, but not affect someone who isn't bothered by the words.

So if I were to say "firetruck, DbzFreak42", one person might opt to censor the word firetruck, so they would see "*****, DbzFreak42". Another player who isn't bothered by the word firetruck (because they're so helpful for fire prevention and all) would still see "firetruck, DbzFreak42".
In response to Jtgibson
I know. But it might be confusing. lol aside from my previous post's points, for example personally if I see "***** Kaioken" I would assume something ...worse than they having said "firetruck Kaioken", you see.
In response to Kaioken
Then don't censor 'firetruck', censor something that really offends you (such as 'ambulance', 'policecar', etc.).

That's the beauty of it- it effectively unloads moderation of swear words from the staff of the game to the players themselves. That way they can choose their own level of moderation and so can't complain ("you mods are too strict!" "you mods are too lax!").

It's a better system than the regular filters that automatically filter out everything (you could even make it so that new users logging in for the first time have a default set of words filtered and can fiddle with that to their personal tastes).
In response to Elation
Elation wrote:
Then don't censor 'firetruck', censor something that really offends you (such as 'ambulance', 'policecar', etc.).

Yes yes but there is the players-see-things-differently stuff. And if someone offends somebody a little and not the other, he will see teh **** and could think its something more serious but the other guy didn't even mean to offend and what he actually said is only little offending to the other guy.

and other guy.. and stuff.. and whatnot

ok ok, you win, you win, I'm too tired for this.
In response to Elation
Elation wrote:
That's the beauty of it- it effectively unloads moderation of swear words from the staff of the game to the players themselves. That way they can choose their own level of moderation and so can't complain ("you mods are too strict!" "you mods are too lax!").

Well, at least some of the load. You still will have people using things like 'f i r e t r u c k', 'FIRETRUCK', 'firetruk', etc. But it can definitely be a help.
In response to Flick
Flick wrote:
Well, at least some of the load. You still will have people using things like 'f i r e t r u c k', 'FIRETRUCK', 'firetruk', etc. But it can definitely be a help.

Aaah, but again, the subjectivity of the custom-filter system might even solve that problem. A guy who is going around yelling emergency service-related obscenities probably won't be censoring his own words so he'll see 'firetruck' appearing unfiltered.

He won't then bother to try and obscure those words to beat the filter- and he'd have no idea what words the person he's talking has filtered, so wouldn't go to the bother of trying to obscure various words that he can only guess might be filtered on the other end.
In response to Elation
Y0u ug1y, si11y fir3truck!
This looks good to me. For more humor I would have it do like pick("!","@","%","$","&") and add those, but that's more of a flavor thing then concept.
In response to LastTroubadour
LastTroubadour wrote:
This looks good to me. For more humor I would have it do like pick("!","@","%","$","&") and add those, but that's more of a flavor thing then concept.


http://gazoot.byondhome.com/bbash/?quote=4
Well, for me, I took advantage of Lummox's sWerd library. The text processing capabilities are simply perfect for such use. Users would be provided a text file that they could modify to suit their filtering needs. Do take note that such a system may be over-complex and may not appeal to certain communities.
In response to Xeal
I love your forum icon.
In response to Xeal
Xeal wrote:
http://gazoot.byondhome.com/bbash/?quote=4

Mertek is of course quite incorrect in his analogy (condoms work just fine - if they didn't, the birth rate would be much higher than it is, and AIDS would be just as much an epidemic in Western countries as it is in Africa). Though I agree that starring out curse words is a bit useless.