MessageFilter
MessageFilter
This plugin brings to you ability to control message in your chat provided from any source. You can hide annoying message of plugin (forever or using cooldown to display it), change any message to another. You can even use MessageFilter as translation tool for plugins that not provides translation mechanics by itself.
Video
Why I need this plugin?
- You would like to hide some spamming message print by plugin you use at your server;
- You would like to replace one message to another;
- You going to translate message of plugin but that plugin is not providing you language-file to edit;
Features
- Hiding messages
- Replacing messages
- Cooldown for message (for example, you don't like to lot of same message, and going to see only one of them during one minute)
- Regex (and other types of string comparison) supported
How it works
All rules added to MessageFilter store in files in "MessageFilter/rules" folder. You can add, modify or remove rules using command or by editing rule files.
Every rule base on some parameters:
- Type — defines the method which will used to determine text in message (before display it on screen). There are five types:
- EQUAL — case insensitive compare (Example: "Aaaa Bbbb" will be equal to "aaaa bbbb")
- CONTAINS — find substring in input-message
- START — check if message starts with provided text
- END — check if message ends with provided text
- REGEX — using regular expression to find matches
- message-mask — defines input mask, that will used to find matches in original message
- replace-to — defines replacement. Replacements supports placeholders %word1% ... %wordN% the will be replaced with conforming word from original message
- cooldown-time — time defined in format similar to time format used in ReActions plugin. Cooldown used to set up time-limit for displaying annoying message. For example, if cooldown time is set to 5 seconds. And "replace-to" mask is empty. Annoying message will displayed only once per five seconds.
When plugin (or other source) is sending message, this message is controlled by MessageFilter and changed according to defined rules. Player will see replaced message instead of original. This methods allows even to translate a plugins that not provides built-in translation for your language. You just need to find messages and create rules to replace it. Here is rule file example: http://dev.bukkit.org/bukkit-plugins/message-filter/pages/main/rule-file-example/
Commands
Main command of plugin is msgfilter (aliases: mfilter, filter).
- /msgfilter help — hmm... h
- /msgfilter add <RuleId> [GroupId] — create new rule
- /msgfilter set <RuleId> type|input|output|cooldown|group <Value> — set parameter (type, input mask, output mask, cooldown time or group) to <Value>
- /msgfilter remove <RuleId> — remove rule
- /msgfilter list [Mask] [PageNumber] — show list of rules
- /msgfilter info <RuleId> — display rule parameters
- /msgfilter save <GroupId> [<Number>|<Time>] — save message into file <GroupId>.yml.
- /msgfilter reload — reload rules
- /msgfilter test — test MessageFilter.
Creating rules
You can create new rules using: command line, incoming chat message and manully editing file.
Examples:
Using commands
- /msgfilter add newrule
- /msgfilter set newrule type EQUAL
- /msgfilter set newrule input this is the input message
- /msgfilter set newrule output &6this is the output message
Save incoming chat message
- /msgfilter save test1 — save next (only one) incoming message to file test1.yml
- /msgfilter save test2 15 — save next 15 incoming messages to file test1.yml
- /msgfilter save test2 10m — save all incoming messages during the 10 minutes to file test1.yml
Manual configuration
MessageFilter supports multiple rules definition files. It's a "YAML" fie (*.yml) located in "rules" folder. You can edit (or create new) this files manually. Here is example:
roadprotector: # rule Id type: EQUAL # rule type message-mask: '&3[RP] &cThis place is protected!' # incoming message (with color code) replace-to: '&6Здесь нельзя ломать и строить!' #outgoing (translated) message cooldown-time: '' # cooldown time use-formating: true # use formatting (colors) removejoing: # rule Id type: REGEX #rule type message-mask: '\w+ joined the server\.' # incoming message, I'm going to hide it replace-to: '' # Empty line cooldown-time: '' use-formating: false # ignore formatting annoying: type: EQUAL message-mask: 'You can\'t build here!' replace-to: '' # Empty line cooldown-time: '5s' #You will see this message only once during the five seconds use-formating: false # ignore formatting
MessageFilter self-test
You can use command /msgfilter test to be sure that MessageFilter works fine. Just type this command in chat. If you receive message "MessageFilter test failed!" usually you need to install or update ProtocolLib.
Permissions
- messagefilter.config — only one permission to access commands.
- messagefilter.test — perform test of MessageFilter when player joins the server.
Dependencies
This plugin requires ProtocoLib installed on your server.
Update checker
MessageFilter includes a update checker that use your server internet connection. Update checker will every hour check the dev.bukkit.org to find new released version of plugin and you can easy disable it: just set parameter "version-check" to "false" in config.yml.
I try 1000000000000000000000 but it wont work...
So, i have two areas in this areas some special groups are not permitted to enter... so i try:
This is a WG message and is the same: You are not permitted to enter this area.
i try: START,END,EQUAL,CONTAINS with different texts but it only displayed '&aFinde das Schild, um Bewohner zu werden.' the first one -.- I despair... any help?
@fromgate
Yes thanks! Sometimes he displayed not the correct message...
Example:
He displayed only the message-mask: 'chestcommands.open.kauf-menu.yml' ....
The other thing, i have two special regions to deny enter so:
So i try Type: START / message-mask: You or with the END Type but nothing work to display two different replaced text...
Hard to expalin xD
@fromgate
Thanks, sorry before I was busy and forgot pay attention on this page. :)
@NoHoPeLess @z65703071
I hope newer version will help you. Sometimes MessageFilter fails to determine chat-packet verision and turned to older chat packet instead of 1.7.x
v0.2.0 Uploaded, waiting for approval
@NoHoPeLess It seems that your bug-report is not quite complete. Can you provide more information?
.... This plugin work not correctly...
@z65703071
Hello!
What craftbukkit version you using? And... ProtocolLib?
It's a normal message if you not using craftbukkit 1.7x
@fromgate
[16:03:49] [Server thread/INFO]: [MessageFilter] Failed ot parse 1.7.x chat-packet. Will use old version chat-packets
That error like this plugin before : http:dev.bukkit.org/bukkit-plugins/inme (Now fixed)
This plugin kind of inme to control the chat packet. Whenever I use some command(/hd , /info-board , /f map, etc...). Not all the command! This plugin would send this message to console after didn't work anymore. I guess it related with the plugin return messages too.
@z65703071
What did you try to do?
I tested latest version with: 1.5.2, 1.6.2, 1.7.2, 1.7.9 and 1.7.10
It doesnt work on 1.7.2!
Ok i solved this by:
Sry im soo bad xD
Wont work for me...
Situation:
Player will use an command /rang (he has not the permission to do this - it comes from chestcommands) in the chat: You dont´t have permission chestcommands.open.kauf-menu.yml
So i set:
Now when he write /rang results in: You dont´t have permission chestcommands.open.kauf-menu.yml
I try all Types but nothing happens...
dafuqqq xD can you pls help? Is this an bug?
@fungreenfox
And I have another tool that allows to link actions to worldguard regions (enter region, leave region, staying in region) - ReActions, http://dev.bukkit.org/bukkit-plugins/reactions/
Now I'm working on update for ReActions that will implement all features of MessageFilter and MessageCommander and allows to link more actions to it.
@fungreenfox
You can try MessageCommander. http://dev.bukkit.org/bukkit-plugins/message-commander/
@NoHoPeLess
You need to remove cooldown
@fromgate
If for example worldguard says to a player "you cant exit this area", the filter response could be "you will be moved to area B" and execute a TP session command, but a simple way of putting a second config / command input to set the command for what to do upon a specific message.
its working a little bit... i change the worldguard message to enter a region.. but it spams me with the original and the one i set ...
@fungreenfox
I'm now working on a new plugin, that will be able to execute command when it find message in chat message (any source, including messages of other plugins), server log, console or chat input.
v0.1.1 Uploaded. Waiting for approval...
@fungreenfox
Thanks! I will modify this message in next version.
There's no way to execute command (using this plugin) when you find a message in chat. Can you describe more about what you need? I have another plugin, that was not uploaded to BukkitDev because I think it's will not be interesting for anyone. That plugin is executing command when meet predefined text in player chat, plugin messages or console log.