示例#1
0
void lua_startbot(void *arg) {
  channel *cp;

  myureconnect = NULL;

  if(!luabotnick)
    luabotnick = getcopyconfigitem("lua", "botnick", "U", NICKLEN);

  lua_nick = registerlocaluser(luabotnick->content, "lua", "quakenet.department.of.corrections", LUA_FULLVERSION, "U", UMODE_ACCOUNT | UMODE_DEAF | UMODE_OPER | UMODE_SERVICE, &lua_bothandler);
  if(!lua_nick) {
    myureconnect = scheduleoneshot(time(NULL) + 1, &lua_startbot, NULL);
    return;
  }

  cp = findchannel(LUA_OPERCHAN);
  if(cp && localjoinchannel(lua_nick, cp)) {
    localgetops(lua_nick, cp);
  } else {
    localcreatechannel(lua_nick, LUA_OPERCHAN);
  }

  cp = findchannel(LUA_PUKECHAN);
  if(cp && localjoinchannel(lua_nick, cp)) {
    localgetops(lua_nick, cp);
  } else {
    localcreatechannel(lua_nick, LUA_PUKECHAN);
  }

  myublip = schedulerecurring(time(NULL) + 1, 0, 60, &lua_blip, NULL);
  myutick = schedulerecurring(time(NULL) + 1, 0, 1, &lua_tick, NULL);

  lua_registerevents();
}
示例#2
0
void _init(void) {
  registercontrolhelpcmd("patroljoin", NO_OPER, 1, &pc_cmd_patroljoin, "Usage: patroljoin <channel>\nJoins a patrol client to a channel.");
  registercontrolhelpcmd("patrolpart", NO_OPER, 1, &pc_cmd_patrolpart, "Usage: patrolpart <#id>\nRemoves a patrol client from a channel.");
  registercontrolhelpcmd("patrollist", NO_OPER, 0, &pc_cmd_patrollist, "Usage: patrollist\nLists patrol channels.");

  schedulerecurring(time(NULL) + 5, 0, 10, &pc_sched_check, NULL);
}
示例#3
0
void _init()
{
    settime_schedule = schedulerecurring(time(NULL) + 300, 0, 1800, &settime_sendsettime, NULL);
    registercontrolhelpcmd("settime",NO_DEVELOPER,0,&settime_cmd,"Usage: settime\nForce send a settime to network.");

}