PDA

View Full Version : Bots keep disconnecting


Crazyboobs
22/06/2012, 02:03 AM
Hello!
I have a irc script, when i restart the server the bots will connect to irc but after sometimes it will keep spam like this

[02:14:00] *** IRC_OnDisconnect: Bot ID 310 attempting to reconnect...
[02:14:00] *** IRC_OnDisconnect: Bot ID 310 disconnected!
[02:14:00] *** IRC_OnDisconnect: Bot ID 579 attempting to reconnect...
[02:14:00] *** IRC_OnDisconnect: Bot ID 579 disconnected!
[02:14:00] *** IRC_OnDisconnect: Bot ID 93 attempting to reconnect...
[02:14:00] *** IRC_OnDisconnect: Bot ID 93 disconnected!
[02:14:00] *** IRC_OnDisconnect: Bot ID 515 attempting to reconnect...
[02:14:00] *** IRC_OnDisconnect: Bot ID 515 disconnected!
[02:14:00] *** IRC_OnDisconnect: Bot ID 45 attempting to reconnect...
[02:14:00] *** IRC_OnDisconnect: Bot ID 45 disconnected!
[02:14:00] *** IRC_OnDisconnect: Bot ID 493 attempting to reconnect...
[02:14:00] *** IRC_OnDisconnect: Bot ID 493 disconnected!
[02:14:00] *** IRC_OnDisconnect: Bot ID 296 attempting to reconnect...
Spamming like this is very annoying and makes the server log big (going to more than 500 MB).And at that time server lagging. Can anyone tell me a solution? no problem if the bots disconnect but i need to stop this spamming, thats all :S

Here is the code of that

public IRC_OnDisconnect(botid) {
printf("*** IRC_OnDisconnect: Bot ID %d disconnected!", botid);
if (botid == gBotID[0]) {
// Reset the bot ID
gBotID[0] = 0;
// Wait 20 seconds for the first bot
SetTimerEx("IRC_ConnectDelay", 50000, 0, "d", 1);}
else if (botid == gBotID[1]) {
// Reset the bot ID
gBotID[1] = 0;
// Wait 25 seconds for the second bot
SetTimerEx("IRC_ConnectDelay", 55000, 0, "d", 2);}
else if (botid == gBotID[2]) {
// Reset the bot ID
gBotID[2] = 0;
// Wait 30 seconds for the third bot
SetTimerEx("IRC_ConnectDelay", 50000, 0, "d", 3);}
printf("*** IRC_OnDisconnect: Bot ID %d attempting to reconnect...", botid);
// Remove the bot from the group
IRC_RemoveFromGroup(gGroupID, botid);
return 1;}

public IRC_OnJoinChannel(botid, channel[]) {
printf("*** IRC_OnJoinChannel: Bot ID %d joined channel %s!", botid, channel);
return 1;}

Littlehelper
22/06/2012, 02:09 AM
do you have maxnpc set to 1/amount of bots in your server.cfg?

Crazyboobs
22/06/2012, 02:11 AM
;1938306']do you have maxnpc set to 1/amount of bots in your server.cfg?

maxnpc 0

Littlehelper
22/06/2012, 02:15 AM
maxnpc number_of_bots_goes_here.

Crazyboobs
22/06/2012, 02:17 AM
;1938318']maxnpc number_of_bots_goes_here.

Ok and for a safety can i delete these 2 line?

printf("*** IRC_OnDisconnect: Bot ID %d disconnected!", botid);

printf("*** IRC_OnDisconnect: Bot ID %d attempting to reconnect...", botid);

Littlehelper
22/06/2012, 02:24 AM
You can if you want.

Crazyboobs
22/06/2012, 02:26 AM
;1938327']You can if you want.

If i do that, then any problem?