Post "match" Operators
About Post Match Operations
PwnFilter makes use of several post match operators, to react to positive matches from your regular expressions rules. Here we will cover these operators and show you how they can be used to make PwnFilter the most powerful chat filter plugin available. These rules are applied in your rules.txt after the "match".
NOTE: Rules are applied in the order they are listed in this file. Using the "then abort" action will stop further rule processing. So, if you want a rule to take priority over the others, list it first in this file. If you want a rule to stop further processing, use "then abort" as an action to that rule.
Variables
%world% ,%player%, %string%, %rawstring%, %event%, %ruleid%, %ruledescr% Detailed info coming soon.
Post Match List
- ignore user <username1 username2> - rule will ignore any users defined separated by spaces.
- require user <username1 username2> - rule will require any users defined separated by spaces.
- ignore permission <permission.node1 permission.node2> - rule will ignore players with permissions defined separated by spaces. (Available in 1.3)
- require permission <permission.node1 permission.node2> - rule will require players with permissions defined separated by spaces. (Available in 1.3)
- ignore command <command1|command2> - rule will ignore defined commands from a pipe separated list. (Available in 2.3.4)
- require command <command1|command2> - rule will required defined commands from a pipe separated list. (Available in 2.3.4)
- ignore string <string1|string2|string3> - rule will ignore matches containing defined strings from a pipe separated list. (Available in 1.4)
ignore signs - rule will ignore matches on signs. (Available in 2.4.0)(Removed in 3.0)
- events <chat,command,sign> Only apply this rule to the events listed (default = all events) (Available in 3.0) OR
- events not <chat,command,sign> Apply this rule to ALL events, -except- those listed after the "not" keyword (Available in 3.0)
- then abort - stop processing any rules after this one.
- then replace <optional string> - replace match with defined string or nothing at all. Best for swear filters, etc.
- then rewrite <optional string> - like replace, only does not filter color codes. Best for fun filters. (Available in 1.3)
- NOTE As of 3.0.0, the filter will now preserve color codes that are not part of the match. Also, we will insert any color codes in replace or rewrite strings.
- then randrep <string1|string2|string3> - replace matches randomly from the pipe separated list of words. (Available in 2.0.0)
- then warn <optional string> - send user warning message after match.
- then command <optional string> - if left empty it will use your chat message
- variables: (Available in 1.3)
- %player%: returns the player name
- %world%: returns the player world
- %string%: returns the chat message (as modified by any previous rules)
- %rawstring%: returns the original unfiltered message
- %event%: returns the type of event that was triggered (eg: sign, item, chat, command)
- variables: (Available in 1.3)
- then cmdchain (command string1|command string2) - Run chained commands as player from pipe separated list.
- variables: (Available in 2.1.0)
- %player%: returns the player name
- %world%: returns the player world
- %string%: returns the chat message (as modified by any previous rules)
- %rawstring%: returns the original unfiltered message
- %event%: returns the type of event that was triggered (eg: sign, item, chat, command)
- variables: (Available in 2.1.0)
- then console <string> - executes string as console. Useful for connecting with punishment plugins to mute or ban someone. Very Powerful - Be Careful!
- variables: (Available in 1.3)
- %player%: returns the player name
- %world%: returns the player world
- %string%: returns the chat message (as modified by any previous rules)
- %rawstring%: returns the original unfiltered message
- %event%: returns the type of event that was triggered (eg: sign, item, chat, command)
- variables: (Available in 1.3)
- then conchain (command string1|command string2) - Run chained console commands.
- variables: (Available in 2.1.4)
- %player%: returns the player name
- %world%: returns the player world
- %string%: returns the chat message (as modified by any previous rules)
- %rawstring%: returns the original unfiltered message
- %event%: returns the type of event that was triggered (eg: sign, item, chat, command)
- variables: (Available in 2.1.4)
- then debug - prints debug information to console for development purposes.
- then deny - complete cancels the matching message so it never appears in chat.
- then kick <optional string> - kicks player from server with optional kick message.
- then burn <optional string> - burns player with optional burn message. (Available in 1.9.3)
- then kill <optional string> - kills player with optional kill message. (Available in 1.9.3)
- then fine <amount> <string> - removes <amount> from the player's balance and sends <string> as a message to the player. ( New in 3.1 )
- then lower - used alone paired with the proper regex, this operator will replace any match with all lower case letters. Great for anti-caps replacement instead of just warning or blocking. (Available in 2.0.0)
- then log - Will cause this match to be logged to the server log, regardless of loglevel setting. (Updated in 3.0)
Those are all the post match operators the plugin uses? Is there a way to replace the whole message?
@Marium0505
i'm doing it by matching whole message:
i.e. my IP filter:
match ^.*(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\s?(\.|,|-|dot)\s?){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\s?(\:|\-|port)\s?[0-9]+)?(?![0-9])).*$ then randrep \[\[This is great server\]\]|\[\[My server is not so good as this one\]\]|\[\[I want own so good server as this\]\] then log
simpler:
match ^.*what you want match.*$
but after update and matching in commands, i'm trying to implement this also into /whisper /tell /msg etc... but still unsuccessful
@Marium0505
a "then replacemsg" might come in handy I guess to replace the entire string.
also I think an &match might be useful too, for logging/warning purposes..
What would be the code for it to give the player a potion effect?
(sorry for bad english)
i dont know what to do...
i have version 3.1.1
This run perfect:
# Extreme Schimpfwörter
match s+c+h+w+a+n+z+l+u+t+sc+h+e+r|h+u+r+e+n+s+o+h+n
then replace *Sowas wird bestraft*
then console tempban &player 1d Schimpfwort - 1 Tag Ban
then kick Benimm dich!
then log
And This run NOT perfect -.-
# Heil Hitler|Sieg Heil
match h+e+i+l h+i+t+l+e+r|h+e+i+l+h+i+t+l+e+r|s+i+e+g h+e+i+l|s+i+e+g+h+e+i+l|n+i+g+g+e+r|n+i+g+g+a
then replace *Ich bin ein dummer Rasisst*
then console ban &player Grund - Im Chat geschrieben: (&rawstring)
then kick Keine Chance dem Rasissmus
then log
Run not the string replace and kick
when i ONLY make the string replace - it run!
when i first make kick and then ban and no more... it run...
when i first make ban and then kick and no more... only run ban.
i need the kick.
why run all in example 1 and not in example 2 ???
i giving crazy in my head -.- AHHHHHH
pls help me
http://pastebin.de/35775
@BuildingDave
Try:
You'll need a plugin with a /kick command for it to work I think. I know the Essentials plugin has a /kick command. I assume you might already have something like that since you have a /tempban command in your other filter~
<<code # REPLACE AN IP ADDRESS / DOMAIN NAME and IGNORE ones you don't want to block, replace it with your url, kick the player with a message and log the event. match \b\d{1,3}+\p{P}*\d{1,3}+\p{P}*\d{1,3}+\p{P}*\d{1,3}+\b|([\w-\.]+)((?:[\w]+\.)+)([a-zA-Z]{2,4}) ignore string 192.168.1.1|74.34.194.98|google.com|youtube.com|bukkit.org|minecraft.net|minecraftwiki.net|pwn9.com then replace Pwn9.com then kick Do Not Advertise On Our Server then log>>
<</code>>
Would minecraftwiki.net be whitelisted totally in this example?
So if someone posted minecraftwiki.net = no kick
But what about if they posted http://www.minecraftwiki.net/wiki/Stone_Brick?
@Prominentc
I wonder that too...
Also, what happened to 'then notify', 'actions' and 'rule'?
Hi there.
Is it possible with this plugin to stop a plugin from writing to the chat?
A plugin I use says in the chat "this server is running {PLUGINNAME} created by {CREATOR}"
I cant remove this from the plugin so want to stop it being announced into the chat. Any ideas?
Is it possible so when a player types @(Player name) it comes up in yellow? If so please let me know ;) Thanks!
I am trying to just warn the user when is a word is matched, not replace it or modified it. However everytime I try to get it to work, it cancels the message. Please help. This is the chat filter:
Every way I try to write this, it only comes up as