01.08.2016, 18:42
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)
And IRC_OnConnect callback
Please help me in solving this, I got no idea why this occurs.
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();
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;
}