欢迎来到Minecraft插件百科!
对百科编辑一脸懵逼?
帮助:快速入门
带您快速熟悉百科编辑!
因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289
查看“ChatControl Pro/WIKI/规则”的源代码
←
ChatControl Pro/WIKI/规则
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于这些用户组的用户执行:
用户
、
自动确认用户
、
巡查者
您可以查看和复制此页面的源代码。
规则系统是ChatControl最有用的系统: 你可以设置基于正则表达式的过滤器来捕获消息. 规则基于运算符 (想 'match', 'then deny'这样的东西, 这些运算符决定编程内容 - 你可以在 rules.txt 的顶部看到所有的运算符). 它们由两部分组成:规则和处理器. 规则可以使用正则表达式来捕获一条消息, 处理器则为一组行为. == 任何添加新规则 / 过滤器? == 打开你的 rules/ 文件夹,打开你想要编辑的规则文件 (rules.txt 应用于游戏的所有元素, 而 commands.txt 只对指令有效, chat.txt 只对聊天有效等.)然后用合适的文本编辑器进行编辑即可. 每条规则开头都要有 "match" ,结尾都有 "then" 运算符. 你可以查看已存在的规则,复制粘帖它们并进行修改. == 制作有效的规则 == 以下示例为 "fuck" 的过滤器,它可以防止 <code>f.u.c.k</code> 甚至是 <code>fuuu-ck</code>. 使其匹配并捕获这类词语很简单. ----Here is an example of a rule that catches 'jerk', even in forms like jeeerrk and so on. <code>match \b(j+(\W|\d|_)*e+(\W|\d|_)*r+(\W|\d|_)*k+(\W|\d|_)*) handle as swear</code> The 'match' operator has 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 instructions stated in the 'swear' section in <code>handlers.yml</code> file. You can write all the operators manually to the rule itself, if you want, but in case you wish to handle multiple swear words the same way, it becomes more convenient to store the instructions in one place. The example above matches the word 'jerk' even if its obfuscated like <code>jeeerk</code> or <code>j.e-r_k</code>, and it will be handled as a 'swear' (you can configure this in handlers.yml file). == 禁止如 <code>sh*t</code> 和 <code>shi*t</code> 这样的单词== By default, our filters like the one above already do block shi*t, shi_t and other obfuscated alternatives, but they do not catch the word when letters in the center are replaced. See my answer from a private PM below to fix that. == 白名单/允许的链接或IP == To allow your server's IP address or website, open rules/rules.txt and use the 'ignore string' operator as per lines 71 and 85, explained under the image. a) To whitelist an IP, locate the IP filter above and add the IP address literally as per the image above. b) To whitelist a dommand, locate the domain filter above and add the domain by adding | and the domain itself at the end of the 'ignore string' operator that is there already. If your domain is "craftblock.com", you would add it as "|craftblock.com" == 白名单语法 == Some rules such as "tits" may catch messages such as "but its" or similar. You can fix this in two ways: a) Add the \b characters in the match rule. This makes the rule only match if the message does not have a whitespace either in front (if you put \b in front) or at the end (if you put \b as the last thing in the match): <code>match \btits</code> This will match "tits" but not "but its". Similarly, you can add also add \b at the end to make it only match when it ends with a whitespace. Be aware that such rules are easier to bypass. b) Use "ignore string" operator. This is the best solution to allow certain words and won't make the rule easier to bypass: <code>match anal ignore string analog|an all</code> This will prevent the two phrases 'analog' and 'an all' being blocked. == 空格文字白名单 == If you wish to block a message containing spaces inside ("f u c k", or "come to m y s e r v e r . c o m"), use the 'before strip' operator. Insert it under each rule you want to affect and all whitespaces will be removed: <code>match <your rule> before strip \s* [...]</code> == 防止想Ⓝ Ⓞ Ⓟ Ⓠ Ⓡ Ⓢ Ⓣ 这样的 unicode字符== Below you will find a rule that denies all special, unicode characters. Those are misused to bypass filters. Please keep in mind that non-english languages might use them as well. You can past it directly to rules/rules.txt. <code>match [^\u0000-\u007F]+ then warn Unicode is prohibited then deny</code>
返回
ChatControl Pro/WIKI/规则
。
导航菜单
个人工具
登录
命名空间
页面
讨论
大陆简体
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
编辑相关
百科公告
编辑帮助
互助客栈
贡献分数
测试沙盒
发布条目
插件分类
管理
安全
聊天
编程
经济
修正
娱乐
综合
信息
机械
角色
传送
网页
整地
创世
付费
其它
工具
链入页面
相关更改
特殊页面
页面信息
相关网站
MCMOD百科
Minecraft中文百科
Minecraft纪念论坛
Minecraft百度贴吧
虚无世界Wiki