int AnopeInit(int argc, char **argv) { moduleAddAuthor("Adam"); moduleAddVersion("1.0"); Command *c = createCommand("ROOT", do_root, is_services_root, -1, -1, -1, -1, -1); moduleAddCommand(OPERSERV, c, MOD_HEAD); moduleAddRootHelp(c, os_help_root); moduleSetOperHelp(os_help); return MOD_CONT; }
int AnopeInit(int argc, char **argv) /* This will be executed when the module is loaded */ { Command *c; /* Pointer to a Command */ int status = 0; /* the status of our new command */ c = createCommand("moo", hs_moo_show, NULL, -1, -1, -1, -1, -1); /* Create a new command "moo" pointing to hs_moo */ moduleAddHelp(c,myHostServMooHelp); /* add help for all users to this command */ moduleAddRegHelp(c,myHostServMooRegHelp); /* add extra regular-user only help to this command */ moduleAddOperHelp(c,myHostServMooOperHelp); /* add extra oper only help to this command */ moduleAddAdminHelp(c,myHostServMooAdminHelp); /* add extra admin only help to this command */ moduleAddRootHelp(c,myHostServMooRootHelp); /* add extra root only help to this command */ moduleSetHostHelp(myHostServHelp); /* add us to the .hs help list */ status = moduleAddCommand(HOSTSERV, c, MOD_HEAD); /* Add the command to the HOSTSERV cmd table */ /* Check if we have any argv's */ if(argc>0) { /* we do, the first will be the nick of the person modload'ing us */ /* or NULL if we were auto-loaded */ if(argv[0]) { alog("hs_moo was modloaded by: [%s]",argv[0]); } else { alog("hs_moo was automatically loaded by anope"); } } alog("hs_moo.so: Add Command 'moo' Status: %d",status); /* Log the command being added */ moduleAddCallback("test",time(NULL)+dotime("15s"),test,0,NULL); /* set a call-back function to exec in 3 mins time */ moduleDelCallback("test"); moduleAddAuthor(AUTHOR); /* tell Anope about the author */ moduleAddVersion(VERSION); /* Tell Anope about the verison */ if(status!=MOD_ERR_OK) { return MOD_STOP; } return MOD_CONT; }