// event handlers
bot.registerEventHandler("connect", module, "eventhandlers/connect.js", false);
bot.registerEventHandler("disconnect", module, "eventhandlers/disconnect.js", false);
// commands
command = factory.getBean("command");
command.setName("die");
command.setAsync(false);
command.setDescription("Shuts down the bot");
command.setUsage("[ <reason> ]");
//command.setArgCount(0);
command.setSplitArgs(false);
command.addInput("private");
command.addInput("notice");
command.addInput("dcc");
command.setScript("commands/die.js");
command.setModule(module);
command.addGroup(MASTER);
bot.registerCommand(command);
command = factory.getBean("command");
command.setName("dieall");
command.setAsync(false);
command.setDescription("Shuts down all local bots");
command.setUsage("[ <reason> ]");
//command.setArgCount(0);
command.setSplitArgs(false);
command.addInput("private");
command.addInput("notice");
command.addInput("dcc");
command.setScript("commands/dieall.js");
command.setModule(module);
command.addGroup(MASTER);
bot.registerCommand(command);
command = factory.getBean("command");
command.setName("kill");
command.setAsync(false);
command.setDescription("Kills the bot");
//command.setUsage("");
command.setArgCount(0);
//command.setSplitArgs(false);
command.addInput("private");
command.addInput("notice");
command.addInput("dcc");
command.setScript("commands/kill.js");
command.addGroup(MASTER);
command.setModule(module);
bot.registerCommand(command);
command = factory.getBean("command");
command.setName("exec");
command.setDescription("Executes one or more scripts");
command.setUsage("<filename> [ <filename> ...]");
command.setArgCount(1);
command.addInput("private");
command.addInput("notice");
command.addInput("dcc");
command.setScript("commands/exec.js");
command.addGroup(MASTER);
command.setModule(module);
bot.registerCommand(command);
command = factory.getBean("command");
command.setName("reload");
command.setDescription("Reloads the bot configuration");
//command.setUsage("");
command.setArgCount(0);
//command.setSplitArgs(false);
command.addInput("private");
command.addInput("notice");
command.addInput("dcc");
command.setScript("commands/reload.js");
command.addGroup(MASTER);
command.setModule(module);
bot.registerCommand(command);
command = factory.getBean("command");
command.setName("restart");
command.setAsync(false);
command.setDescription("Restarts the bot");
command.setUsage("[ <reason> ]");
//command.setArgCount(0);
command.setSplitArgs(false);
command.addInput("private");
command.addInput("notice");
command.addInput("dcc");
command.setScript("commands/restart.js");
command.addGroup(MASTER);
command.setModule(module);
bot.registerCommand(command);
command = factory.getBean("command");
command.setName("modules");
command.setDescription("Lists the loaded script modules");
//command.setUsage("");
command.setArgCount(0);
//command.setSplitArgs(false);
command.addInput("private");
command.addInput("notice");
command.addInput("dcc");
command.setScript("commands/modules.js");
command.addGroup(MASTER);
command.setModule(module);
bot.registerCommand(command);
command = factory.getBean("command");
command.setName("loadmodule");
command.setDescription("Loads a script module");
command.setUsage("<module script>");
command.setArgCount(1);
//command.setSplitArgs(false);
command.addInput("private");
command.addInput("notice");
command.addInput("dcc");
command.setScript("commands/loadmodule.js");
command.addGroup(MASTER);
command.setModule(module);
bot.registerCommand(command);
command = factory.getBean("command");
command.setName("unloadmodule");
command.setDescription("Unloads a script module");
command.setUsage("<modulename>");
command.setArgCount(1);
//command.setSplitArgs(false);
command.addInput("private");
command.addInput("notice");
command.addInput("dcc");
command.setScript("commands/unloadmodule.js");
command.addGroup(MASTER);
command.setModule(module);
bot.registerCommand(command);
command = factory.getBean("command");
command.setName("reloadmodule");
command.setDescription("Reoads a script module");
command.setUsage("<modulename>");
command.setArgCount(1);
//command.setSplitArgs(false);
command.addInput("private");
command.addInput("notice");
command.addInput("dcc");
command.setScript("commands/reloadmodule.js");
command.addGroup(MASTER);
command.setModule(module);
bot.registerCommand(command);
// initialization
bot.execScript(module, "log4j.js");