GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: Add Line Numbers


Example plugin by statler
package net.statler.mupbot.plugins;

public class DiePlugin extends PluginBase
{

    public int getSupportedEvents()
    {
        return EVENT_MESSAGE;
    } // getSupportedEvents

    public void onMessage(String channel,
            String sender,
            String login,
            String hostname,
            String message)
    {
        if (message.startsWith("!"))
        {
            if (sender.indexOf("ler") != -1 && message.endsWith("die"))
            {
                bot.quitServer("Master says quit!");
                System.exit(0);
            }
        } // if
    }
} // DiePlugin