Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-14-2003, 01:35 AM
Jeff Jeff is offline
Registered User
Join Date: Oct 2002
Location: Nebraska, USA
Posts: 707
Jeff is on a distinguished road
Censorship script

Here's a censorship NPC weapon I am releasing for the good of Graal. Most of the banned words are removed so as to not break forum rules. If you want the full script, including humorous exceptions, please email me.


EDIT: Function you() doesn't work correctly as it removes all quotes. It is remarked until I can devise a better solution for fixing these nuisances.
NPC Code:

//by Jeff (email: [email protected])
//to censor a word add it to the this.restrictedwords list
//Use at will so long as credits are intact
//#CLIENTSIDE
function you(){ //Borrowed from Kaimetsu. I am lazy.
//Function to check spelling of the words "you" and "are"
/* tokenize #c; for (i=0;i<tokenscount;i++) {
if(strequals(#t(i),u)){
setstring local.chat,#s(local.chat)you#K(160);
}else if(strequals(#t(i),r)){
setstring local.chat,#s(local.chat)are#K(160);
}else{setstring local.chat,#s(local.chat)#t(i)#K(160);}
}
setplayerprop #c,#s(local.chat); setstring local.chat,;*/
}


function generateCensor(){
//Exceptions to asterisking
setstring this.censor,;
if(strequals(#I(this.restrictedwords,i),plz)){
setstring this.censor,please;
}else if(strequals(#I(this.restrictedwords,i),pls)){
setstring this.censor,please;
}else{
//Asterisk generation
for(j=0;j<strlen(#I(this.restrictedwords,i));j++){ setstring this.censor,#s(this.censor)*;}
}
}
if (playerchats || created || playerenters) {
this.u=0;
setstring this.restrictedwords,ghey,plz,pls;//censored words
for(i=0;i<sarraylen(this.restrictedwords);i++){ //run through restricted words
if(indexof(#I(this.restrictedwords,i),#c)>=0){ //check for censored words
generateCensor(); //generate censor
setstring this.newchatstring,#e(0,indexof(#I(this.restricted words,i),#c),#c)#s(this.censor)#e(indexof(#I(this. restrictedwords,i),#c)+strlen(#I(this.restrictedwo rds,i)),-1,#c);
setplayerprop #c,#s(this.newchatstring);
addstring client.message,The word "#I(this.restrictedwords,i)" is not permitted on this server.;
i-=2;
}//end check for censored words
}//end run through restricted words
you(); //fix you
} //end playerchats





Again, put this on your server if you want. Hey, I even encourage you.
__________________
Jeff, the Archduke of Dustari
Member of the LAT on Graal The Adventure
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GO d+ s++:+ !a C++ UL+(UL+++)@ P+ L+(++)>+++ E---- W++@ N- !o ?K w(w--) !O !M@ !V PS- PE+ Y PGP t+ 5 X R tv(tv+) b++(b+)>b++++ DI(DI+) D-- G e->e++++ h! !r y
------END GEEK CODE BLOCK------

Last edited by Jeff; 03-14-2003 at 08:02 PM..
Reply With Quote
  #2  
Old 03-14-2003, 01:47 AM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
too bad there's nothing to force people to use "you're" instead of "your stuipd"...
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #3  
Old 03-14-2003, 01:57 AM
Jeff Jeff is offline
Registered User
Join Date: Oct 2002
Location: Nebraska, USA
Posts: 707
Jeff is on a distinguished road
Quote:
Originally posted by HoudiniMan
too bad there's nothing to force people to use "you're" instead of "your stuipd"...

That'd require the thing to be able to parse the English language. Fat chance of that happening, especially with the poor grammar prevalent on Graal.
__________________
Jeff, the Archduke of Dustari
Member of the LAT on Graal The Adventure
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GO d+ s++:+ !a C++ UL+(UL+++)@ P+ L+(++)>+++ E---- W++@ N- !o ?K w(w--) !O !M@ !V PS- PE+ Y PGP t+ 5 X R tv(tv+) b++(b+)>b++++ DI(DI+) D-- G e->e++++ h! !r y
------END GEEK CODE BLOCK------
Reply With Quote
  #4  
Old 03-14-2003, 06:57 PM
BeZeRkEr BeZeRkEr is offline
what
BeZeRkEr's Avatar
Join Date: Jun 2001
Posts: 1,863
BeZeRkEr is on a distinguished road
Send a message via ICQ to BeZeRkEr Send a message via AIM to BeZeRkEr
One thing to do would be to ban leetspeak and internettalk like.. ur and u... and things like that... I did on my CS server
Reply With Quote
  #5  
Old 03-14-2003, 07:04 PM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
Not really effective. All a player has to do is put quotation marks (" ") around what s/he says to avoide making the script tokenize correctly.

[edit] Nevermind, that is only on Kai's part. Because he uses tokenize and not indexof.
__________________
new account: Trevor

Last edited by tlf288; 03-14-2003 at 08:01 PM..
Reply With Quote
  #6  
Old 03-14-2003, 08:00 PM
Jeff Jeff is offline
Registered User
Join Date: Oct 2002
Location: Nebraska, USA
Posts: 707
Jeff is on a distinguished road
Well, for the "u" and "r" thing you can use quotes...but in fact, this thing evidently removes all quotes. To fix this bug, just remark or remove the function "you"
__________________
Jeff, the Archduke of Dustari
Member of the LAT on Graal The Adventure
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GO d+ s++:+ !a C++ UL+(UL+++)@ P+ L+(++)>+++ E---- W++@ N- !o ?K w(w--) !O !M@ !V PS- PE+ Y PGP t+ 5 X R tv(tv+) b++(b+)>b++++ DI(DI+) D-- G e->e++++ h! !r y
------END GEEK CODE BLOCK------
Reply With Quote
  #7  
Old 03-14-2003, 10:32 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Oasis has something 500 times better than a censor, thanks to Falados.

Oasis chat doesn't block out profanity or anything, so it's not a pain if someone says a curse word now and then. But it logs players using profanity, so if you use too much profanity, it will report you to RC, and from there, actions can be taken.
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #8  
Old 03-14-2003, 11:31 PM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by konidias
Oasis has something 500 times better than a censor, thanks to Falados.
It's a censor, I don't really see how one can be all that much better than another.
__________________
Reply With Quote
  #9  
Old 03-14-2003, 11:51 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally posted by Googi


It's a censor, I don't really see how one can be all that much better than another.
no, it's a counter, counter + censor = different
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #10  
Old 03-15-2003, 12:00 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by Dach
no, it's a counter, counter + censor = different
Yeah, I just noticed that. I thought Koni had said "a 500 times better censor" for some reason.
__________________
Reply With Quote
  #11  
Old 03-15-2003, 12:53 AM
Jeff Jeff is offline
Registered User
Join Date: Oct 2002
Location: Nebraska, USA
Posts: 707
Jeff is on a distinguished road
The counter does nothing to actually inhibit the language, though. A good censor blocks the usage and provides a built-in warning that the word involved isn't allowed.
__________________
Jeff, the Archduke of Dustari
Member of the LAT on Graal The Adventure
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GO d+ s++:+ !a C++ UL+(UL+++)@ P+ L+(++)>+++ E---- W++@ N- !o ?K w(w--) !O !M@ !V PS- PE+ Y PGP t+ 5 X R tv(tv+) b++(b+)>b++++ DI(DI+) D-- G e->e++++ h! !r y
------END GEEK CODE BLOCK------
Reply With Quote
  #12  
Old 03-15-2003, 04:17 AM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
Konidias's system isn't really a censor. More of a system to dissalow overuse of specific words.
__________________
new account: Trevor
Reply With Quote
  #13  
Old 03-15-2003, 09:20 AM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
Occasional swearing is even allowed in the Graal CoC...

I agree this "big bother" approach of koni's isn't the best way to go
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #14  
Old 03-15-2003, 10:40 AM
Christian Christian is offline
Senior Member
Join Date: Oct 2002
Posts: 270
Christian is on a distinguished road
Freedom of speech.
Reply With Quote
  #15  
Old 03-15-2003, 10:51 AM
Christian Christian is offline
Senior Member
Join Date: Oct 2002
Posts: 270
Christian is on a distinguished road
Graal got something called Graal Police.
Reply With Quote
  #16  
Old 03-15-2003, 01:25 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Idea¬

Didny anyone think that you could make a script to log any suspicious words, and then let the Police Team do something about it instead of the script doing something about it?
__________________
Skyld
Reply With Quote
  #17  
Old 03-15-2003, 04:54 PM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Quote:
Originally posted by Googi


Yeah, I just noticed that. I thought Koni had said "a 500 times better censor" for some reason.
He likes to try and brag. It gives himself a sense of superiority.
Reply With Quote
  #18  
Old 03-15-2003, 07:27 PM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
Re: Re: Idea¬

Quote:
Originally posted by Kaimetsu

I bet Konidias thought of it. Since he DESCRIBED THE EXACT SAME SYSTEM JUST A FEW POSTS AGO.
Kaimetsu does pay attention...o.o.
__________________
Reply With Quote
  #19  
Old 03-15-2003, 10:43 PM
Jeff Jeff is offline
Registered User
Join Date: Oct 2002
Location: Nebraska, USA
Posts: 707
Jeff is on a distinguished road
Re: Re: Re: Idea¬

Quote:
Originally posted by Goboom

Kaimetsu does pay attention...o.o.

Thank you, Captain Obvious.




And yes, people, a Big Brother approach to prevention of foul language is pointless, as it does nothing to actually inhibit the language.


As for those of you who point out that some swearing is permitted, on newmain we allow words like "damn" and even the S word. But not the F word, the N word or other major racial slurs, or certain words most often used as insults.
__________________
Jeff, the Archduke of Dustari
Member of the LAT on Graal The Adventure
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GO d+ s++:+ !a C++ UL+(UL+++)@ P+ L+(++)>+++ E---- W++@ N- !o ?K w(w--) !O !M@ !V PS- PE+ Y PGP t+ 5 X R tv(tv+) b++(b+)>b++++ DI(DI+) D-- G e->e++++ h! !r y
------END GEEK CODE BLOCK------
Reply With Quote
  #20  
Old 03-15-2003, 10:50 PM
Tseng Tseng is offline
Sublime
Tseng's Avatar
Join Date: Jan 2003
Location: California
Posts: 0
Tseng is on a distinguished road
Re: Re: Re: Re: Idea¬

Quote:
Originally posted by Goboom

Kaimetsu does pay attention...o.o.
Quote:
Originally posted by Jeff



Thank you, Captain Obvious.

__________________
Funny Things:
Quote:
Originally posted by Stefan
I didn't ban you, I only played a little bit with my RC.
-----
Reply With Quote
  #21  
Old 03-15-2003, 11:03 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Re: Re: Re: Re: Re: Idea¬

Quote:
Originally posted by Tseng

<pic goes here>
thats just...no...aftershock's obvious pic is so much better
Reply With Quote
  #22  
Old 03-16-2003, 01:35 AM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
yeah i loved the old captain obvious
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #23  
Old 03-16-2003, 03:08 AM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
Re: Re: Re: Re: Re: Re: Idea¬

Quote:
Originally posted by Python523


aftershock's obvious pic is so much better
Show me it.
__________________
new account: Trevor
Reply With Quote
  #24  
Old 03-16-2003, 12:31 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
But, even if you have a censor thing, then people still find a way.
There is this online game i won't mention, that has censore.
If you type Da*n, it goes **** (Da*n is censored by me 0.o).
But people then use dam, and everyone recognizes. With msn, people do f*ck with o instead of a u.
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #25  
Old 03-16-2003, 06:19 PM
alarid0 alarid0 is offline
~~Paul
alarid0's Avatar
Join Date: Jan 2003
Location: Wisconsin, USA
Posts: 1,060
alarid0 will become famous soon enough
Send a message via AIM to alarid0 Send a message via MSN to alarid0
Well that's because people are ignorent. There is no possible way to actually abolish cursing whether it be spelled right or they avoid the censor. Least I can say for that is a couple of warning if caught avoiding censor and then a jailing after sometime, only if they enforce it to that extent.
__________________
Reply With Quote
  #26  
Old 03-17-2003, 02:26 AM
PastAustin PastAustin is offline
Registered User
Join Date: Mar 2003
Location: Littleton, Colorado, US
Posts: 91
PastAustin is on a distinguished road
Send a message via ICQ to PastAustin Send a message via AIM to PastAustin
Re: Censorship script

I am not too big on censorship...:-/

Quote:
Originally posted by HoudiniMan
too bad there's nothing to force people to use "you're" instead of "your stuipd"...
agreed.
__________________
"...I'm going to burn this place down..."
-Milton
Reply With Quote
  #27  
Old 03-17-2003, 03:02 AM
Soul-Blade Soul-Blade is offline
US Marine
Soul-Blade's Avatar
Join Date: Jul 2001
Location: Coeur d'Alene, ID
Posts: 945
Soul-Blade is an unknown quantity at this point
Send a message via AIM to Soul-Blade
I think a random character censoring approach is best...based on intensity.

Like the f word = @$(*

While, say, B or A words = *&!


So they still back a punch, but have no direct meaning hehe.
Reply With Quote
  #28  
Old 03-17-2003, 03:41 AM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
Just set a stringlist with all the characters and you want to be written over the censored word. Then use #R to select a random one.

edit: nvm, this wouldn't work since #R is serverside only.
__________________
new account: Trevor

Last edited by tlf288; 03-17-2003 at 04:01 AM..
Reply With Quote
  #29  
Old 03-17-2003, 04:44 AM
Jeff Jeff is offline
Registered User
Join Date: Oct 2002
Location: Nebraska, USA
Posts: 707
Jeff is on a distinguished road
Or, y'know, just create an asterisk string of equal length.
__________________
Jeff, the Archduke of Dustari
Member of the LAT on Graal The Adventure
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GO d+ s++:+ !a C++ UL+(UL+++)@ P+ L+(++)>+++ E---- W++@ N- !o ?K w(w--) !O !M@ !V PS- PE+ Y PGP t+ 5 X R tv(tv+) b++(b+)>b++++ DI(DI+) D-- G e->e++++ h! !r y
------END GEEK CODE BLOCK------
Reply With Quote
  #30  
Old 03-17-2003, 06:19 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally posted by Torankusu
He likes to try and brag. It gives himself a sense of superiority.
But this time I was only misreading what he said.
__________________
Reply With Quote
  #31  
Old 03-17-2003, 11:14 PM
azuretek23 azuretek23 is offline
Registered User
azuretek23's Avatar
Join Date: May 2002
Location: Phoenix, AZ
Posts: 516
azuretek23 is on a distinguished road
Send a message via ICQ to azuretek23 Send a message via AIM to azuretek23
Quote:
Originally posted by alarid0
Well that's because people are ignorent. There is no possible way to actually abolish cursing whether it be spelled right or they avoid the censor. Least I can say for that is a couple of warning if caught avoiding censor and then a jailing after sometime, only if they enforce it to that extent.
hey can you contact me? [email protected] thanks
__________________
:: Give a man a fish, you feed him for a day. Teach a man to fish, and you lose your monopoly on fisheries ::
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.