[Any] Regex Trigger (v2.5.2)
1 Attachment(s)
Regex Trigger v2.5.2. Only works with SM 1.10 https://i.imgur.com/Sl3L9VA.png Description: Serves as a regex trigger/filter for names, chat, and commands. This plugin is pretty much a direct upgrade to this: https://forums.alliedmods.net/showthread.php?t=71867. Check out the documentation there, since I feel they've done a nice job of detailing it. One difference is that this plugin allows the use of "namefilter" and "commandfilter" in the config file, not just "chatfilter" If you'd like to see a demo of the discord relay, pm me for an invite to my discord. For more information, please see the post below, or visit my github repo for this project: https://github.com/JoinedSenses/SM-Regex-Trigger What this plugin does: Serves as a trigger/filter for names, chat, and commands using a config which allows for regex. Only tested in TF2 and CSS If you are unfamilair with regex, read through the attached RegexExplanation.txt or check out these websites: http://www.rexegg.com/regex-quickstart.html https://www.regular-expressions.info/ https://regex101.com Code:
[\s\W_]*(?:s|scrap|ref|crate|selling|[0-9]+)\s*(?:to|\W|\W*[0-9]+)\s*(?:unusuals*|unu)[\s\W_]*\b Relay Integration Included IRC/Discord Features: * Method to relay 'connect' messages to a main IRC channel * Method to relay triggered names and chat/command messages to discord channels for debugging/analysis. https://i.imgur.com/1W56bqA.png ConVars: sm_regex_allow "1" Status of the plugin. (1 = on, 0 = off) sm_regex_config_path "configs/regextriggers/" Location to store the regex triggers at. sm_regex_check_chat "1" Filter out and check chat messages. sm_regex_check_commands "1" Filter out and check commands. sm_regex_check_names "1" Filter out and check names. sm_regex_prefix "" Prefix for random name when player has become unnamed sm_regex_irc_enabled "0" Enable IRC relay for SourceIRC. Sends messages to flagged channels" sm_regex_channelname "" Key name from discord.cfg for name relay" sm_regex_channelchat "" Key name from discord.cfg for chat relay" Installation: * Install regexfiltering.smx into your plugins folder. * Create a key values config at addons/sourcemod/configs/regextriggers/regextriggers.cfg. Use the available config for reference if need. * Optional: SourceIRC for multi-server relay functionality * Optional #2: modified version of SourceIRC * Optional #3: Discord API and configure discord.cfg and cfg/sourcemod/plugin.regextrigger.cfg. * Load the plugin once and edit cfg/sourcemod/plugin.regextrigger.cfg as needed. Reload plugin if changes were made. To compile, you will need sourceirc.inc and discord.inc Config Keys Warn: Display a warning message to the player Code:
"warn" "msg" Action: Executed if a pattern matches Code:
"action" "rcon action" %n, %i, and %u will be replaced with the clients name, index, or userid, respectively, if they are in the command string. Block: Block the text absolutely (Does not work for names) Code:
"block" "1" Limit: Limit the amount of times the matched action can occur Code:
"limit" "number" Forgive: Forgives one indiscretion every x seconds Code:
"forgive" "x" Punish: executes a punishment command if limit is exceeded Code:
"punish" "cmd" %n, %i, and %u will be replaced with the clients name, index, or userid, respectively, if they are in the command string. Replace: Replaces matched text with a value. Code:
"replace" "with" Supports use of capture groups greater than 0 by using \#, such as \1 or \2 Relay: Relays information to the related discord channel Code:
"relay" "1" GITHUB - Changelog . |
Re: Regex Filtering
Quote:
|
Re: [TF2/CSS/Any?] Regex Filter (redux)
A good plugin, but as for me it lacks whitelists for each rule.
Let's say I want to block all domains except certain. |
Re: [TF2/CSS/Any?] Regex Filter (redux)
Quote:
http://www.rexegg.com/regex-lookarounds.html Lets say you wanted to add an exemption for google.com in names here is the original Code:
[\W\s]*[\w\-\.]+[,.]+(?:de|com|co|org|trade|me|ru|gg|tf|net)[\/]*\W* Code:
[\W\s]*[\w\-\.]+(?<!google)[,.]+(?:de|com|co|org|trade|me|ru|gg|tf|net)[\/]*\W* Make sure you check out the links I attached in the original post if you're interested in learning how regex works so that maybe you can write your own .cfg file or modify the one I attached. |
Re: [TF2/CSS/Any?] Regex Filter (redux)
In my opinion it will complicate the rules and not all users will understand how to do it...
|
Re: [TF2/CSS/Any?] Regex Filter (redux)
Regex is a powerful tool, but it's up to the users of this plugin whether or not they want to learn how it works.
If you have any specific questions regarding configuration creation, feel free to add me on steam. As I said, the attached configuration is just an example and doesn't need to be used - you can create your own config. Something as simple as this can be used: Code:
"Censor" |
Re: [TF2/CSS/Any?] Regex Filter (redux)
I have attached RegexExplanation.txt, which details what the config does and how it works.
|
Re: [TF2/CSS/Any?] Regex Filter (redux)
Awesome! Thanks for this :)
|
Re: [TF2/CSS/Any?] Regex Filter (redux)
Updated to v.2.1.1
Added list of random names to choose from if player name is 'unnamed' after passing through filters. Added sm_regexfilters_prefix cvar to add a prefix to a players randomly generated name. You can view the changes here: https://github.com/JoinedSenses/TF2-...ec7a61b344e39c https://i.imgur.com/qhP0VwZ.png |
Re: [TF2/CSS/Any?] Regex Filter (redux)
Plugin has been updated to version 2.4.3. - Mostly includes bug fixes on name checking.
|
All times are GMT -4. The time now is 09:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.