Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
kangarko edited this page Apr 6, 2017 · 18 revisions

The rules are based on operators (things like 'match', 'then deny', basically those, who tell the program what to do - they all are located in the header of rules.txt for your convenience). They consist of two parts: rules and handlers. Rules catch one single message using regular expressions, and handlers are basically group of actions a to you can assign a rule to, to avoid the need of writing instructions twice or more.

Making Efficient Rules

Here is an example of a rule that catches 'jerk', even in forms like jeeerrk and so on.

match \b(j+(\W|\d|_)*e+(\W|\d|_)*r+(\W|\d|_)*k+(\W|\d|_)*)
handle as swear

The 'match' operator needs a regular expression that is evaluated against players' messages. If it matches, the rule applies. The latter operator, 'handle as', tells the program to do all the actions stated in the 'swear' section in handlers.yml file (you can make operators to all of them separately in the rule itself, if you want).

That example above matches the word 'jerk' even if its obfuscated like jeeerk or j.e-r_k, and it will be handled as a 'swear' (this you can configure in handlers.yml file, and it should be self explanatory as there is very good documentation to this).

Below is an example of a filter which blocks the word "fuck" and is also immune to some bypasses like "f.u.c.k" and even "fuuu-ck". It is simple to configure it to match other words, too.

rule image