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 07-29-2003, 09:15 PM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Gift Script for all servers

With all the new servers, I am sure there is at least one that did not think about making a profanity filter. To save everyone some time, here is the one I made for Tribulation. A caveat: put longer swears first unless you don't want the whole word ***ed. Example, listing just the f-bomb would change what Oedipus was into mother****er, or listing an alternative name for a donkey would change another word for part of your posterior to ***hole. So put the longer words first if you don't like this solution. Without further ado, the script:

[edit]I realized that the original script had problems with words like assassin, so I changed it to check whole words only. Sorry, it means a much longer list of obscenities. On the bright side, it means you don't need to worry about putting longer swears first. The other option is to make a list of exception words, which I will post according to public demand[/edit]

[edit2]Fixed a bug where mASSive a** (and other such phrases)was not censored. [/edit2]

NPC Code:

// NPC made by gilt
//#CLIENTSIDE
if (created) {
setstring this.filter,your,words,here;
}
if (playerchats)
{
tokenize #c;
this.offset=0;
for (this.j=0;this.j<tokenscount;this.j++)
{
for (this.i=0;this.i<sarraylen(this.filter);this.i++)
{
this.index=indexof(#I(this.filter,this.i),#e(this. offset,-1,#c));
if (this.index!=-1&&(strequals(#e(this.index-1+this.offset,1,#c), )||this.index+this.offset==0)&&(strequals(#e(this. index+this.offset+strlen(#I(this.filter,this.i)),1 ,#c), )) )
{
setstring this.remainder,#e(this.index+this.offset+strlen(#I (this.filter,this.i)),-1,#c);
for (this.k=0;this.k<strlen(#I(this.filter,this.i));th is.k++)
{
setplayerprop #c,#e(0,this.index+this.offset+this.k,#c)*;
}
setplayerprop #c,#c#s(this.remainder);
}
}
this.offset+=strlen(#t(this.j))+1;
}

}

__________________


Help me keep scripting

Last edited by TribulationStaff; 07-30-2003 at 02:34 AM..
Reply With Quote
  #2  
Old 07-29-2003, 09:29 PM
Mykel Mykel is offline
:o
Mykel's Avatar
Join Date: May 2002
Location: Canton, Ohio.
Posts: 5,526
Mykel has a spectacular aura about
Send a message via AIM to Mykel Send a message via MSN to Mykel
Thanks dude.
__________________
(Married to Skyld)
Reply With Quote
  #3  
Old 07-29-2003, 09:32 PM
Qwert616 Qwert616 is offline
Possibly Possessed
Qwert616's Avatar
Join Date: Sep 2001
Posts: 4,694
Qwert616 is on a distinguished road
I'm not trying to start something (it's nice to donate a script), but isn't that what the Graal.net Code section is for?
Reply With Quote
  #4  
Old 07-29-2003, 09:34 PM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Oh, thanks, I was unaware that existed.

[edit] Although I wonder which way would get more hits, considering I didn't know about that. [/edit]
__________________


Help me keep scripting
Reply With Quote
  #5  
Old 07-29-2003, 09:34 PM
Mykel Mykel is offline
:o
Mykel's Avatar
Join Date: May 2002
Location: Canton, Ohio.
Posts: 5,526
Mykel has a spectacular aura about
Send a message via AIM to Mykel Send a message via MSN to Mykel
, is has the ****'s first for like a split second, then brings this up. o.o
Attached Thumbnails
Click image for larger version

Name:	graal1.png
Views:	306
Size:	41.8 KB
ID:	24619  
__________________
(Married to Skyld)
Reply With Quote
  #6  
Old 07-29-2003, 09:37 PM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Must be another NPC on your server, because it works fine on Tribulation.
__________________


Help me keep scripting
Reply With Quote
  #7  
Old 08-13-2003, 11:09 AM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Quote:
Originally posted by TribulationStaff
Must be another NPC on your server, because it works fine on Tribulation.
what about when people just put - or ( or something connected to the swear to avoid the filter (this is happening)

seems kinda teadius to add to the strings - and ( to every word to extra enforce it, there are a lot of symbols

Edit: Actually it seems somehow people are stepping all over the filter
Edit2: I found out how, thx to someone who cracked it, and its tricky, its cause of how graal internally reads messed up character map characters (in particlar an invisible space)
messes it ALL up
__________________

Last edited by Andy0687; 08-13-2003 at 11:22 AM..
Reply With Quote
  #8  
Old 08-14-2003, 02:43 AM
MoonStriKe MoonStriKe is offline
Registered User
Join Date: Jul 2003
Posts: 7
MoonStriKe is on a distinguished road
Hey, do apostrophes mess this filter up?
Reply With Quote
  #9  
Old 08-14-2003, 02:44 AM
Qwert616 Qwert616 is offline
Possibly Possessed
Qwert616's Avatar
Join Date: Sep 2001
Posts: 4,694
Qwert616 is on a distinguished road
Quote:
Originally posted by TribulationStaff
[edit] Although I wonder which way would get more hits, considering I didn't know about that. [/edit]
Hm. Fair enough.
Reply With Quote
  #10  
Old 08-14-2003, 06:36 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Quote:
I found out how, thx to someone who cracked it, and its tricky, its cause of how graal internally reads messed up character map characters (in particlar an invisible space)
Well, I can hardly be blamed if people are going to go out of their way to be profane. This is just a nice simple script to filter out the majority of obscenities.
__________________


Help me keep scripting
Reply With Quote
  #11  
Old 08-14-2003, 11:49 PM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Quote:
Originally posted by TribulationStaff


Well, I can hardly be blamed if people are going to go out of their way to be profane. This is just a nice simple script to filter out the majority of obscenities.
i wasnt blaming you, by far, its a really nice script
i was just letting everyone know that ANY Filter, not just yours in particular, could be overrode in such a manner
__________________
Reply With Quote
  #12  
Old 08-16-2003, 07:40 PM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
That was already mentioned. Please read the thread before posting.
__________________


Help me keep scripting
Reply With Quote
  #13  
Old 08-17-2003, 03:42 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
A swear filter... ::shivers::
It annoys me when servers do this. I don't like censorship, but rather than * out everyones, you could make something that checks the chat of players[i] and will put a showpoly block around the word maybe instead? Most people don't really mind a little swearing, and if they do, then they usually avoid people who do swear or tell on them... But it's up to the individual servers. You could always do an if (playerchats) statement that checks #I(this.swears,i) and does a for loop for strlen(#I(this.swears,i)) and checks to see if that word is contained... but then you get too much into it for a stupid script x.x
---Shifter
__________________
Who has time for life these days?
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 12:25 AM.


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