Author Topic: [XP] RMX-OS Chat Filter  (Read 7049 times)

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
[XP] RMX-OS Chat Filter
« on: January 08, 2011, 04:08:56 PM »
RMX-OS Chat Filter
Authors: Nathmatt
Version: 2.2
Type: Message Filter
Key Term: RMX-OS Plugin

Introduction

filters game messages

Features

  • Easy to add words to filter
  • Easy to add word to filter it with
  • Now removes any indication of the word

Screenshots

not really needed

Demo

no demo

Script

(click to show/hide)

Instructions

just place this below RMX-OS and above main


Compatibility

no issues known

Credits and Thanks

  • Nathmatt

Author's Notes

if a word includes the filtered word the entire word is replaced unless it is included in the Non_Filtered array

post any bugs or suggestions here
« Last Edit: January 27, 2011, 01:59:59 AM by nathmatt »
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script
(click to show/hide)

Offline Noob

  • Transcended Spirit
  • ***
  • Posts: 139
  • LV: 0
    • View Profile
Re: [XP] RMX-OS Chat Filter
« Reply #1 on: January 08, 2011, 04:36:16 PM »
Thanks very much for making this:)! I'll be sure to try it out and tell you about any problems I find.

Offline Noob

  • Transcended Spirit
  • ***
  • Posts: 139
  • LV: 0
    • View Profile
Re: [XP] RMX-OS Chat Filter
« Reply #2 on: January 08, 2011, 06:09:48 PM »
Ok, just a few problems and suggestions for improvement: first of all, if you say the word within another then it isn't filtered (doesn't really matter, and I didn't specify it, just pointint it out). Also, now whenever the player talks a small non-game info box comes up telling them each word they say. This causes great inconvenience during gameplay, because it goes one word at a time. This is especially inconvenient when the player types /cmd, because it tells them all the commands one word at a time, and in the actual chatbox they are all jumbled together into one unreadable streak of gray text. As for the text in the chatbox, it is all squeezed into one line now, whereas beforehand it was split into different lines so it was readable. Also, when the server gives the player a message, such as "Bob has join the party," there are no spaces, so it looks like "Bobhasjoinedtheparty."

Offline Wizered67

  • Astral Trancist
  • *****
  • Posts: 512
  • LV: 16
    • View Profile
Re: [XP] RMX-OS Chat Filter
« Reply #3 on: January 08, 2011, 06:24:07 PM »
The reason the things pop up is because nathmatt left debug stuff in. Just delete the lines that only say
Code: [Select]
p whatevericantremember. The other problems I don't know. Oh, and one bug I found is that if you put an exclamation point after a word it gets through.
Edit: I'm not getting the no space error so I'm not sure why you are.... Did you do anything weird to the script....
« Last Edit: January 08, 2011, 06:32:44 PM by Wizered67 »

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
Re: [XP] RMX-OS Chat Filter
« Reply #4 on: January 08, 2011, 09:39:12 PM »
update 1.5 it now removes any indication of the word in that capitalization i hope to figure out a way to fix that
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script
(click to show/hide)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] RMX-OS Chat Filter
« Reply #5 on: January 08, 2011, 09:50:07 PM »
Code: [Select]
text.downcase.gsub!Just have all the bad words you define be in all lower case.

You could also include a few regular expessions to not have it replace words that are with in other words.

ex. "ass" is a bad word.

the word "assisstance" would look like this: "***isstance"


EDIT: Nevermind the capitilization. I see you said you fixed that. oops.
« Last Edit: January 08, 2011, 09:51:08 PM by ForeverZer0 »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
Re: [XP] RMX-OS Chat Filter
« Reply #6 on: January 08, 2011, 09:58:37 PM »
i thought of using.downcase but then nothing you typed would every be capitalized
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script
(click to show/hide)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3255
  • LV: 298
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] RMX-OS Chat Filter
« Reply #7 on: January 08, 2011, 10:05:48 PM »
Don't use downcase!, use downcase.
If you scripted it right it would not modify the original string, but only scan it for bad words in all lower case. It won't actually change it unless you are doing something like this.

Code: [Select]
old_string = 'HEY THIS IS CAPS'
new_string = old_string.downcase.gsub('caps') { '***' }

This returns: "hey this is ***"

If you simply do this, the capitilization remains the same:

Code: [Select]
old_string = 'HEY THIS IS CAPS'
old_string.downcase.gsub!('caps') { '***' }

This returns: "HEY THIS IS ***"
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
Re: [XP] RMX-OS Chat Filter
« Reply #8 on: January 08, 2011, 10:23:25 PM »
update 2.0 fixed it the entire word gets replaced unless it is included in the Non_Filtered array
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script
(click to show/hide)

Offline mroedesigns

  • Ethereal Devastator
  • ****
  • Posts: 394
  • LV: 31
  • Gender: Male
  • I seeee you
    • View Profile
    • MRoe Designs
Re: [XP] RMX-OS Chat Filter
« Reply #9 on: January 09, 2011, 01:13:50 AM »
Hey, awesome script!

I found an issue though. If the string is multiple words, and the first word is filtered, it crashes on line 61 with 'ArgumentError Occurred'.

Code: [Select]
text.each(' '){|word|Chat_Filter::Flitered_Words.each{|filter|

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
Re: [XP] RMX-OS Chat Filter
« Reply #10 on: January 09, 2011, 02:53:52 AM »
update 2.1 fixed above error had to do with editing the string i was going trough so i just duplicated it using .dup
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script
(click to show/hide)

Offline Noob

  • Transcended Spirit
  • ***
  • Posts: 139
  • LV: 0
    • View Profile
Re: [XP] RMX-OS Chat Filter
« Reply #11 on: January 09, 2011, 10:01:21 PM »
Thanks, everything seems to work now!

Offline Noob

  • Transcended Spirit
  • ***
  • Posts: 139
  • LV: 0
    • View Profile
Re: [XP] RMX-OS Chat Filter
« Reply #12 on: January 27, 2011, 01:35:18 AM »
Hey I've got a minor issue with this, nothing horrible, but i was wondering if it's fixable. When a user types /cmd to see the commands, certain ones are blotted out if "ass" is a bad word. For instance, /newpass. Even if I make it a non-filtered word, it's still blotted out in /cmd. Any ideas?

Offline nathmatt

  • Chaos User
  • ******
  • Posts: 1289
  • LV: 114
  • Gender: Male
  • The Add_on King
    • View Profile
    • Nathmatt Productions
Re: [XP] RMX-OS Chat Filter
« Reply #13 on: January 27, 2011, 02:00:28 AM »
update 2.2 fixed above bug
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script
(click to show/hide)