Message-Plugin Version 0.2

  • Thanks to @Metachronism, I was able to create a mod/Plugin that sends a message to the server every nth minute. I did not use the EcoModKit to create this. I based it off AdminChatCommands.cs. Also as this place is for discussion of modding, if this is not the correct place to post plugins/mods, please move it to the right forum section.

    What is it?
    This is a small plugin that will auto send a message to your server every nth minute. You are able to change the time and message (as of Version 0.1) in MOTD.cs file on line 15 (for time) and line 14 for the message. Version 0.2 will include changing of the file time and message via commands. This plugin can be used to inform people what your team speak or discord channel is. It can also be used for a motd to be sent out every so often to remind people about things. The possibilities are endless.

    Please note that time is in milliseconds. 300000 ms = 5 minutes. So every 5 minutes the message is sent to everyone connected to your server.

    Features of Version 0.1:

    • Enable and Disable the automatic play of the message.
    • Uses commands to start and stop
    • Message is hard coded. You must edit the MOTD.cs file to change message.

    How to install and Use:
    Download attached file. Place MOTD.cs into the server folder/Mods/Misc. Once placed in the Misc folder restart server. This will enable the mod and compile it.

    Make sure you are flagged as an admin via the server. If you are not an admin the command will not work. Once flagged as an admin type /motd-on to enable the message. to disable it type /motd-off. The method of how to start and stop is not set in stone and could eventually change.

    MOTD.cs - Version 0.2
    @R4mbo Version - R4mbo Version (Check out his post about his version)

    Known Issues:

    Features to come:

    • Change the interval time via command
    • Change the MOTD via command
    • Save new MOTD to file
    • Load MOTD from file

    Thanks again to the following who helped me out throughout the process of making this small plugin.
    @NoBlackThunder - for helping with the known error.

  • did a quick look at your code.

    case "motdenable":
    var enable = args;

                if(enable == "1")
                    // Lets call enable the MOTD
                    // Lets disable it.
                return true;

    i suspect the issue you get with object refference might be that args = null. and therfor you dont have an instance of that object ? .. you could try do do the following :

        switch (command)
            case "motdenable":
                var enable = "0";
                if (!string.IsNullOrEmpty(args))
                    enable = args;
                if(enable == "1")
                    // Lets call enable the MOTD
                    // Lets disable it.
                return true;
        return false;

    maybe that helps?

  • @NoBlackThunder that is most likely the issue. I'll get that updated and tested and push out an update if correct.

    EDIT: V.0.2 is out for the fix with the error. As of now there are no more errors.

  • I just wanted to post a small update since its been about a week since I last uploaded anything.

    Version 0.3 is coming a long nice. I've added in support for loading messages via txt file along with them getting rotated ever 5 minutes or so. (I forgot what the default time span I've set.). With Version 0.3 the commands have changed again. I'm also working on creating config xml file instead of a txt document so it can also hold the amount of time to pass before the next message is sent in the queue. This is no longer a MOTD mod. This is more of a random message mod now.

    The Doctor

  • Greetings, Doc!

    I just updated your MOTD script.

    /motd-on = Activates MOTD and loads the messages from specified path
    /motd-off = Deactivates MOTD

    /motd-list = Show all Messages (Includes INDEX)
    Example for motd-list Output:
    0 Welcome!
    1 Test123
    2 Have Fun!

    /motd-remove X = Remove Message with INDEX X
    For example: /motd-remove 1 = Remove message Test123
    List will be saved after that.

    /motd-add MESSAGE
    Will add a Message to the List and save it.

    You can edit the Savepath if you open the Modfile with Notepad++
    Mod will crash the client if you do typing mistakes, for example: /motd-remove cwafasfa
    Handle with Care!


  • Ah yea, it can handle multiple messages now.

  • @R4mbo

    Nice additions. I'll have to get back into playing ECO. I took a break for college and work. I'll add your version to the main post.

  • Hi,

    I am hosting a Server with Pingperfect and tried it as you said. Unfortunately it has not worked.

    Could it be a problem with Version Alpha 5.5.4 or with the fact that I am hosting with a Server provider?

    Thanks for your help.



Log in to reply