NoSwear
#1
NoSwear
is usefull for admins who don't want their server with people who are constantly swearing.

Permissions:
  • NoSwear.Bypass
    If a player has this permission then he can swear whatever he wants. >.<

Config
  • There are two types of config files. there is the Config.ini where the color of the warning message and the warning message is and the BadWords.txt that contains all the words you want to get blocked.

    Config.ini
    • WarningColor
      is the color of the warning message you get. Default is rose
    • Warning
      is the warning the player gets. Default is "Bad, you may not swear"

    BadWords.txt
    • This file contains all the words you don't want people to say. If you want to add a word simply open the file press enter and type your new "banned" word. The words are not case sensitive


Attached Files
.zip   NoSwear.zip (Size: 1.46 KB / Downloads: 415)
Reply
Thanks given by: Antonio
#2
Can you add regular expression swear matching?
Reply
Thanks given by:
#3
I have no idea. WhatÅ› a regular expression?
Reply
Thanks given by:
#4
"regular expressions", or "regexps", is a technical way of specifying strings to search for. You most likely know "*.*", "*.exe" which is used for filename matching on windows, regexps are somewhat similar.

I believe Lua has regexp support built in (string.search(), string.gsub()), so this shouldn't be too difficult to make.
Reply
Thanks given by:
#5
I used string.find() with this plugin.
Reply
Thanks given by:
#6
So it should already support regexps:
http://lua-users.org/wiki/StringLibraryTutorial (s:find() section)
http://lua-users.org/wiki/PatternsTutorial (regexp format)
Reply
Thanks given by:
#7
Cool! It's great that Lua just supports that by default.
Reply
Thanks given by:
#8
Please update this plugin it is really good one, I'm planning on making 24/7 production server Smile. I got the following:

[01:18:52] Initialized ProtLimit
[01:18:52] Initialized ChatLog v.3
[01:18:52] Initialised Core v.14
[01:18:52] Initialized Coiny v6
[01:18:52] Initialized Blockchat v2
[01:18:52] Initialized Chatter v.1
[01:18:52] cPluginManager.AddHook(): Deprecated format used, use cPluginManager.AddHook(HOOK_TYPE, CallbackFunction) instead. Fixing the call for you.
[01:18:52] Stack trace:
[01:18:52] [C](-1): AddHook
[01:18:52] Plugins/NoSwear/main.lua(8): (no name)
[01:18:52] Stack trace end
[01:18:52] LUA: error in function 'new'.
argument #2 is 'string'; '[no object]' expected.

[01:18:52] Stack trace:
[01:18:52] [C](-1): (no name)
[01:18:52] [C](-1): (no name)
[01:18:52] [C](-1): cIniFile
[01:18:52] Plugins/NoSwear/main.lua(10): (no name)
[01:18:52] Stack trace end
[01:18:52] Error in plugin NoSwear calling function Initialize()
[01:18:52] Error in plugin NoSwear: Cannot call the Initialize() function. Plugin is temporarily disabled.
Reply
Thanks given by:
#9
STR, this seems to be only a problem with the cIniFile that has moved the filename from constructor to Read(), should be easy to fix. I'm wondering, if such a plugin should be in the mc-server github repos...
Reply
Thanks given by: Antonio
#10
I'll fix it now. I'm perfectly fine with my plugins moving to the mc-server repos.

I've fixed and uploaded it.
Reply
Thanks given by: Antonio




Users browsing this thread: 2 Guest(s)