"protected" = 0;
"hide_networkname" = 0; //hide network name
"hide_botnick" = 0; //hide bot nick, ident, host
+ // "use_bot" = "BotNick"; //use this bot for the statistics
"hide_chancount" = 0; //hide joined channel count
"hide_usercount" = 0; //hide number of users the bot can see
};
if(get_int_field(tmp))
pkgpos += sprintf(pkgbuf + pkgpos, "*\n");
else {
- struct ClientSocket *bot, *bot1 = NULL, *bot2 = NULL, *bot3 = NULL;
+ sprintf(tmp, "modules/%s/use_bot", modname);
+ char *botname = get_string_field(tmp);
+ struct ClientSocket *bot, *bot1 = NULL, *bot2 = NULL, *bot3 = NULL, *bot4 = NULL;
for(bot = getBots(SOCKET_FLAG_READY, NULL); bot; bot = getBots(SOCKET_FLAG_READY, bot)) {
- if(bot->botid == 1 && (bot->flags & SOCKET_FLAG_PREFERRED))
+ if(botname && !stricmp(bot->nick, botname))
bot1 = bot;
- else if((bot->flags & SOCKET_FLAG_PREFERRED))
+ else if(bot->botid == 1 && (bot->flags & SOCKET_FLAG_PREFERRED))
bot2 = bot;
- else
+ else if((bot->flags & SOCKET_FLAG_PREFERRED))
bot3 = bot;
+ else
+ bot4 = bot;
}
if(bot1)
bot = bot1;
else if(bot2)
bot = bot2;
- else
+ else if(bot3)
bot = bot3;
+ else
+ bot = bot4;
if(bot) {
pkgpos += sprintf(pkgbuf + pkgpos, "%s!%s@%s %d\n", (bot->user ? bot->user->nick : "*"), (bot->user ? bot->user->ident : "*"), (bot->host ? bot->host : "*"), bot->port);
} else