[RP] Filter Script. [SLEDMORE]

Status
Not open for further replies.

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Hey guys,

I haven't really done a nice release in a while, So today here is a little filter script. Which will make words like, "tbh" come out as "To be honest".

I know there is easier ways, but you do have to keep rebooting your emulator doing it the other way. Whereas this way you don't!

Anyway here we go;


1) Open stringManager.cs
2) Search for this; "private static string filterCensor;" (with no quotations).
3) Change it to "private static string[] filterCensor;" (with no quotations).
4) Search for this; "public static void initFilter(bool Update)" (with no quotations).
5) Under "swearWords = dataHandling.dColToArray(dCol);" (with no quotations).
6) Add this:
Code:
                DataColumn dCol2;
                using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
                {
                    dCol2 = dbClient.getColumn("SELECT wordfilter_censor FROM wordfilter");
                }
                filterCensor = dataHandling.dColToArray(dCol2);
7) Find this:
Code:
Text = Strings.Replace(Text, swearWords[i], filterCensor, 1, -1, Constants.vbTextCompare);
8) Replace with this:
Code:
Text = Strings.Replace(Text, swearWords[i], filterCensor[i], 1, -1, Constants.vbTextCompare);
9) Upload this SQL to your database:
Code:
CREATE TABLE IF NOT EXISTS `wordfilter` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `word` varchar(100) COLLATE latin1_general_ci NOT NULL,
  `wordfilter_censor` varchar(100) COLLATE latin1_general_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=12 ;

10) Reboot your emulator, When you add data to it, make sure you do :refresh filter (if you have the command).

This does work, If not tell me the error (As I had to guess what I had done cause I had done this ages ago lol).
 

Thomas

Member
Oct 25, 2010
270
5
Brilliant release Craig. I will hopefully put it on my hotel when you release HoloRP - Lmao.
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Brilliant release Craig. I will hopefully put it on my hotel when you release HoloRP - Lmao.

It's already on there, Thatis how I figured it out, And thanks!
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
But, I hate that you have to keep rebooting emulator and it looks messy lol.
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
But then, It gets annoying cause some noob says another word lolol, But anyway's you like your way and I like my way xD.
 

Tr0ll.

Member
Nov 20, 2010
99
5
Well which one is best to use?

It doesn't matter ;3
mine is just..

Code:
string Message = currentPacket.Substring(4);
                                            Message = stringManager.filterSwearwords(Message);
                                            if (Message == "lol")
                                            {
                                                Message = "*laughs*";
                                            }

Something like that, which doesn't involve db work
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
There ain't no other released but that's like, if (MESSAGE) etc.. This one is easier as it updates.
 

Jo$h

Posting Freak
Jul 7, 2010
1,030
79
Very nice, This would have been very useful to me if I had an RP hotel!
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Thanks? Didn't ask for a rating.
 
Status
Not open for further replies.

Users who are viewing this thread

Top