Hello guys i'm in need of chat plugin

Discussion in 'Plugin Requests' started by OnCoke, Dec 23, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    OnCoke

    Plugin for 1.8

    I want my players to have sence of freedom to type whatever they desire but also make it comfortable to another players to read the chat.I want it to silently replaces rude words with words you chouse in config.If player types profanity in chat he sees unedited massage, but all the other players see massage with replaced words.Also prevents chat bypass,caps and fixes grammar

    I had it on my previous server and i aware that this plugin is already existing somewhere in the depth of the internet i searched 35 pages of chat plugins and serched internet in general and there is no results that maches my description.I found someone on hypixel forums talking about this plugin
    https://hypixel.net/threads/all-servers-funny-censor-plugin.357457/

    Guys if you know what plugin i'm talking about please link it in response or if you willing to make this plugin by yourself let me know , i will be thankfull for it.If anything i'm sorry about my english
     
    Last edited: Dec 24, 2018
  2. Offline

    0-o

    You can use this plugin: https://drive.google.com/open?id=1vBbQ2HtH90ixMMbAmWvZsRxu6qefMGKX
    It's a regex evaluator. It suits what you want, and has the silent replace feature.

    Basically, for what you want to use it for, here is an example config.yml.

    replacements:
    stupid2smart:
    regex: stupid
    replacement: smart
    silent_replace: true
     
  3. Offline

    OnCoke

    Thank you <3
     
    Last edited: Dec 25, 2018
  4. Offline

    OnCoke

    Can you help me out?Basically this happens when i load the server.How do i fix it?
    Code:
    [22:22:29 INFO]: [CustomRegex] Enabling CustomRegex v0.0.3
    [22:22:29 WARN]: while scanning a double-quoted scalar
    in 'reader', line 36, column 16:
                regex: "(f+|(p|╨|Ё|\|o|\/o|\|o|\|D)+(\s ...
                       ^
    found unknown escape character |(124)
    in 'reader', line 36, column 29:
                regex: "(f+|(p|╨|Ё|\|o|\/o|\|o|\|D)+(\s|\.|-|=)*(h|═ ...
                                    ^
    
    [22:22:29 WARN]:        at org.yaml.snakeyaml.scanner.ScannerImpl.scanFlowScalarNonSpaces(ScannerImpl.java:1906)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.scanner.ScannerImpl.scanFlowScalar(ScannerImpl.java:1843)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.scanner.ScannerImpl.fetchFlowScalar(ScannerImpl.java:1029)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.scanner.ScannerImpl.fetchDouble(ScannerImpl.java:1011)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:396)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:586)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:143)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:132)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:229)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:155)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:229)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:155)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:229)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:155)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:120)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:450)
    [22:22:29 WARN]:        at org.yaml.snakeyaml.Yaml.load(Yaml.java:381)
    [22:22:29 WARN]:        at zerodasho.customregex.utils.YamlUtils.yamlToJson(YamlUtils.java:36)
    [22:22:29 WARN]:        at zerodasho.customregex.config.Config.reload(Config.java:37)
    [22:22:29 WARN]:        at zerodasho.customregex.config.Config.<init>(Config.java:19)
    [22:22:29 WARN]:        at zerodasho.customregex.Main.onEnable(Main.java:25)
    [22:22:29 WARN]:        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321)
    [22:22:29 WARN]:        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340)
    [22:22:29 WARN]:        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405)
    [22:22:29 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357)
    [22:22:29 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317)
    [22:22:29 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414)
    [22:22:29 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378)
    [22:22:29 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333)
    [22:22:29 WARN]:        at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263)
    [22:22:29 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525)
    [22:22:29 WARN]:        at java.lang.Thread.run(Unknown Source)
    [22:22:29 INFO]: Server permissions file permissions.yml is empty, ignoring it
    [22:22:29 INFO]: Done (8,696s)! For help, type "help" or "?"
    That's the config
    Code:
    #Commands: /cregex reload - reloads the config.yml
    #Permissions:
    #zerodasho.customregex.generic        - Allows usage of /cregex
    #zerodasho.customregex.generic.reload - Allows usage of /cregex reload
    
    replacements:
        # Name of Regular Expression
        howdy2hello:
            # Regular Expression - if a chat message matches this regex, it's replaced with the replacement message
            regex: Howdy (.*)!
            # Replacement Message
            replacement: Hello $1!
            #If true, the message changes for everyone except the sender. Useful for censor.
            silent_replace: true
            #Entire message must match the regex, not just a segment.
            must_match: true
            #Player must have this permission for message to be replaced
            permission: zerodasho.customregex.generic
            #  EXAMPLE:  
            # [Donator] Guy: Howdy Guy2!
            #  Becomes:
            # [Donator] Guy: Hello Guy2!
        h2ohello:
            # Regular Expression - if a chat message matches this regex, it's replaced with the replacement message
            regex: "(f+|(p|Р|р|\|o|\/o|\|o|\|D)+(\s|\.|-|=)*(h|Н|н|\|+[-~=\s]+\|+|\\+[-~=\s]+\\+|\/+[-~=\s]+\/+)+)+(\s|\.|-|=)*u*(\s|\.|-|=)*[cСс\(<]*(\s|\.|-|=)*[K|К|к|\|<|\/<|\|{]*[\s]?"
            # Replacement Message
            replacement: WALUIGI!
            #If true, the message changes for everyone except the sender. Useful for censor.
            silent_replace: true
            #Entire message must match the regex, not just a segment.
            must_match: true
            #Player must have this permission for message to be replaced
            permission: zerodasho.customregex.generic
     
     
    commands:
        # Name of Regular Expression
        broadcast:
            #Regular Expression - if a chat message matches this regex, the following commands are run
            regex: broadcast (.*)
            #If true, the chat message is cancelled.
            cancel_chat: true
            #Player must have this permission for commands to execute
            permission: zerodasho.customregex.generic.reload
            commands:
                  #Command to run
                - command: say $1
                  #If true, the player executes the command. If false, the server does.
                  is_player: false
            #  EXAMPLE:
            # [Donator] Guy: broadcast Hello everyone!
            #  Runs command:
            # [Server] Hello everyone!
          
    
    I've readed this post https://bukkit.org/threads/playerchatcommands.476393/#post-3594919
    and tryed to replace <([{\^-=$!|]})?*+.>: to \\< \\( \\[ \\{ \\\ \\^ \\- \\= \\$ \\! \\| \\] \\} \\) \\? \\* \\+ \\. \\> \\:
    I did it in three ways:
    in order that written above
    backslashes first
    backslashes in the end

    Tryed to put ' ' in the begining and end, tryed //,tryed " " that gave me error while it was loading config
    Tryed to put flags "g" and "i" to end
    ,but non of it gave me result.,config loading correctly, but filter not working at all
    My initial regex filter works correctly in regex test websites ,you can see it here > https://regex101.com/r/DAoIfL/2/
    Can you give me example how to put complex regex in correctly in config?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Dec 26, 2018
  5. Offline

    0-o

    I don't even understand what your regex is trying to do. What does it match with?
    The error is because you used '\' which is an escape character. Do a double slash '\\'
     
  6. Offline

    OnCoke

    You could clock on the link that lead to regex101.com is suppose to match f word.I tried to switch single backslash in meta characters for two but it gave me no results. In config you provide me with example Howdy (.*)! that matches Howdy any characters in amount from 0 or more and ! in the end right?I was trying to put pretty simple expression (\\d*) it suppose to detect any amount of numbers in chat is that correct? So what I type 0123456789 in chat it does not replace any of it.
     
Thread Status:
Not open for further replies.

Share This Page