IRC Bot problem
#1

I have about 5 bots connected to the channel but only 1 communicates..
pawn Код:
public OnGameModeInit()
{
    for(new bot = 0; bot < MAX_BOTS; bot++)
    {
        new nickname[16], realname[16];
        format(nickname, sizeof(nickname), "%s", BotNames[bot]);
        format(realname, sizeof(realname), "BOT_%i", bot);
        irc_Bot[bot] = IRC_Connect(IRC_SERVER, IRC_PORT, nickname, realname, nickname);
    }
    irc_Group = IRC_CreateGroup();
}

public IRC_OnConnect(botid, ip[], port)
{
    IRC_JoinChannel(botid, IRC_CHANNEL);
    IRC_AddToGroup(irc_Group, botid);
    return 1;
}
Reply
#2

What do you mean my communicates? Wherever you have IRC_Say, it will determine which bot is supposed to be receiving things from the SA:MP server.
Reply
#3

Example:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128], name[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, name, sizeof(name));

    format(string, sizeof(string), ""IRC_ORANGE"%s"IRC_BLACK": %s", name, text);
    IRC_GroupSay(irc_Group, IRC_CHANNEL, string);
    return 1;
}
1 Bot sends everything, and recieves a flood kick after a while
I remember reading somewhere that it's supposed to distribute the messages to all the bots to prevent that.
Reply
#4

I think you can change the settings for IRC bots on your server so they are void from flood kicks...
Reply
#5

I'd rather distribute the messages for all the bots as i said, though.
I have seen it on other channels
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)