Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Gift Script for all servers (https://forums.graalonline.com/forums/showthread.php?t=46612)

TribulationStaff 07-29-2003 09:15 PM

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;
}

}


Mykel 07-29-2003 09:29 PM

Thanks dude. :)

Qwert616 07-29-2003 09:32 PM

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?

TribulationStaff 07-29-2003 09:34 PM

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]

Mykel 07-29-2003 09:34 PM

1 Attachment(s)
:(, is has the ****'s first for like a split second, then brings this up. o.o

TribulationStaff 07-29-2003 09:37 PM

Must be another NPC on your server, because it works fine on Tribulation.

Andy0687 08-13-2003 11:09 AM

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

MoonStriKe 08-14-2003 02:43 AM

Hey, do apostrophes mess this filter up?

Qwert616 08-14-2003 02:44 AM

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.

TribulationStaff 08-14-2003 06:36 AM

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.

Andy0687 08-14-2003 11:49 PM

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

TribulationStaff 08-16-2003 07:40 PM

That was already mentioned. Please read the thread before posting.

Projectshifter 08-17-2003 03:42 AM

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


All times are GMT +2. The time now is 07:22 AM.

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