IRC bots are response-less
#1

Hey, I've been trying to connect my IRC bots to the IRC server (Tried mibbit, SA-IRC, and others aswell). They worked well before and are also working when I connect them via localhost. I just bought a host at SAMP4YOU, and these bots aren't even connecting. I also noticed that the bots are connected exactly after 5 minutes after server start, but when you enter any command - they're not responding at all.

This is how I connect them (OnGameModeInit)
pawn Код:
gBotID[0] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_1_NICKNAME, BOT_1_REALNAME, BOT_1_USERNAME);
    IRC_SetIntData(gBotID[0], E_IRC_CONNECT_DELAY, 5);

    gBotID[1] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_2_NICKNAME, BOT_2_REALNAME, BOT_2_USERNAME);
    IRC_SetIntData(gBotID[1], E_IRC_CONNECT_DELAY, 10);

    gBotID[2] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_3_NICKNAME, BOT_3_REALNAME, BOT_3_USERNAME);
    IRC_SetIntData(gBotID[2], E_IRC_CONNECT_DELAY, 15);

    gBotID[3] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_4_NICKNAME, BOT_4_REALNAME, BOT_4_USERNAME);
    IRC_SetIntData(gBotID[3], E_IRC_CONNECT_DELAY, 20);

    gBotID[4] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_5_NICKNAME, BOT_5_REALNAME, BOT_5_USERNAME);
    IRC_SetIntData(gBotID[4], E_IRC_CONNECT_DELAY, 25);

    gGroupID = IRC_CreateGroup();
    gGroupAdminID = IRC_CreateGroup();
And IRC_OnConnect callback
pawn Код:
public IRC_OnConnect(botid, ip[], port)
{
    new rawdata[70];
    // Join the channel
    if(botid == 1 || botid == 2 || botid == 3)
    {
        format(rawdata,sizeof(rawdata),"PRIVMSG NickServ identify %s",BOTS_PASS);
        IRC_SendRaw(botid,rawdata);
        IRC_JoinChannel(botid,IRC_CHANNEL);
        IRC_AddToGroup(gGroupID,botid);
    }
    else if(botid == 4 || botid == 5)
    {
        format(rawdata,sizeof(rawdata),"PRIVMSG NickServ identify %s",BOTS_PASS);
        IRC_SendRaw(botid,rawdata);
        IRC_AddToGroup(gGroupAdminID, botid);
        /*format(rawdata, 70, "JOIN %s %s", IRC_ADMIN, A_PASS);
        IRC_SendRaw(botid, rawdata);*/

        IRC_JoinChannel(botid, IRC_ADMIN, A_PASS);
    }
    return 1;
}
Please help me in solving this, I got no idea why this occurs.
Reply
#2

IRC servers regularly limit the amount of connections from a single IP. If you're connecting more than three clients you should probably ask a network operator to add an exception.

Also this:
PHP код:
if(botid == || botid == || botid == 3
Should be replaced with the variables.
PHP код:
if(botid == gBotID[0] || botid == gBotID[1] || botid == gBotID[2]) 
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
IRC servers regularly limit the amount of connections from a single IP. If you're connecting more than three clients you should probably ask a network operator to add an exception.

Also this:
PHP код:
if(botid == || botid == || botid == 3
Should be replaced with the variables.
PHP код:
if(botid == gBotID[0] || botid == gBotID[1] || botid == gBotID[2]) 
I also noticed that most of the IRC servers limit the connections to like 3 or 4 and hence I had chosen Mibbit, as they allow my 5 bots to connect without a problem. And I trust what you've asked me to edit isn't the problem. Because the admin bots are actually working well, they respond to the commands. The main bots (gBotID[0,1,2]), aren't responding for unknown reason. Where as gBotID[3,4] work perfectly. But when I connect all the bots via localhost, they connect immediately and all the bots respond. When I connect them via host, it takes 5 minutes to connect - and the main bots don't respond, whereas the admin bots do.
Reply
#4

Local server = localhost -> IRC server (live)
When the server is running on localhost, the bots are responding to the commands, but when they are connected through the server host - it doesn't respond (especially bots in gGroupID). I'm using IRC.TL now, and the IRC operators have increased max. connections to 11 for my server IP address. And if you didn't go through the post clearly, I said that "BOTS CONNECT AFTER 5 MINUTES" resulting the bots to become IDLE, and response-less. But I don't know how to fix that shit..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)