![]() |
|
07-17-2012
|
1 |
|
Nerd
Join Date: Sep 2011
Location: Berlin
Posts: 3,825
|
Script: Swear filter
This is a swear filter you can use on your Graal server to stop players chatting offensive or vulgar words. The words and rules are stored in a text document on your server. Features
Setting up 1) Upload the script to your server. 2) Edit all of the constants in the script. Here's what you can edit, and what effect they will have on the script.
4) Set up the rules.txt file. The server will have automatically created a rules.txt and put it in the folder you chose (RULES_PATH) To add a bad word to the file, add a new line and on it put badword:replacement. Obviously, you'll need to change badword and replacement to what you want it to be. To completely clear the sentence, set the rule to ERASE. Code Place this in a weapon NPC. PHP Code:
|
|
07-17-2012
|
2 |
|
Should be fixed.
Join Date: Aug 2011
Posts: 6,359
|
In my opinion censoring should be done clientside with the option to turn it on or off. Therefor it should be applied to OTHER player chat rather than your own(using I think it's onRemotePlayerChats() {}). This is because it discourages swear evasion. Those who feel comfortable with cursing can see/do it without feeling censored, so no need to evade it. Thus those who don't like cursing can have other chat censored and since they don't need to evade it remains far more accurate. Also it'd probably be better to just load them from the serveroptions rather than a file. |
|
07-17-2012
|
3 |
|
Not Banned
Join Date: Sep 2011
Location: Hell
Posts: 4,885
|
also if you are going to make it so there is no option make it so the word is replaced or censored, not the entire pm or text.
|
|
07-17-2012
|
4 | ||
|
Nerd
Join Date: Sep 2011
Location: Berlin
Posts: 3,825
|
Update I've added onRemotePlayerChats() and the ability to turn it on and off (thanks Dusty for the feedback) I don't currently have access to anywhere where I can play around with the server options (other than Delteria, but that's a no-go) so I'll have to find somewhere so I can add filter via server ops. I've also removed sending a message to RC and loggin vulgar language, since there's really no need for it in my opinion. PHP Code:
Last edited by Emera; 07-17-2012 at 06:58 PM.
|
||
|
07-17-2012
|
5 |
|
Should be fixed.
Join Date: Aug 2011
Posts: 6,359
|
Enabling/Disabling it won't work in this instance as it's only filtering your own text so it'll end up like this: PlayerA has censoring disabled. PlayerB has censoring enabled. PlayerA says <expletive>, but because he doesn't have censoring onPlayerChat() doesn't change his curse. PlayerB DOES have it enabled, but because it's not his chat, he still sees the player cursing. This is where onRemotePlayerChats() is needed. |
|
07-17-2012
|
6 |
|
Chilling Grallian
Join Date: Dec 2011
Location: United Kingdom
Posts: 7
|
Ok so this solves all of these words: -**** -**** -**** -Balls -***** -Knob -**** -***** -**** and so on :3 |
|
07-17-2012
|
7 |
|
Not Banned
Join Date: Sep 2011
Location: Hell
Posts: 4,885
|
|
|
07-17-2012
|
8 |
|
Registered User
Join Date: Sep 2011
Location: Germany
Posts: 6,122
|
|
|
07-24-2012
|
9 |
|
Circus
Join Date: Sep 2011
Location: London
Posts: 2,090
|
*looks through scripts desperately to see swear words, it's like p/o/r/n to kids with very strict parents*
|
|
07-25-2012
|
10 | |
|
zzz
Join Date: Sep 2011
Location: WA USA
Posts: 9,232
|
|
|
|
07-25-2012
|
11 |
|
Nerd
Join Date: Sep 2011
Location: Berlin
Posts: 3,825
|
|