Connecting IRC bots to .admins
#1

pawn Код:
new gBotID[MAX_BOTS],gGroupID;

// 1st Echo Bot
#define BOT_1_NICKNAME "Jack"
#define BOT_1_REALNAME "Jack"
#define BOT_1_USERNAME "Jack"

// 2nd Echo Bot
#define BOT_2_NICKNAME "Ashley"
#define BOT_2_REALNAME "Ashley"
#define BOT_2_USERNAME "Ashley"

#define IRC_SERVER "irc.sa-irc.com"
#define IRC_PORT (6667)
#define IRC_CHANNEL "#trd.echo"
#define IRC_ADMINCHANNEL "#trd.admins"

#define MAX_BOTS (3)
//===========================================================//
//Under OnGameModeInIt
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, 2);
    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, 3);
    gGroupID = IRC_CreateGroup();
//==========================================================//
Under OnGameModeExit
IRC_Quit(gBotID[0], "Server Restarting");
    IRC_Quit(gBotID[1], "Server Restarting");
    IRC_DestroyGroup(gGroupID);
It connects to IRC_CHANNEL = trd.echo, but doesn't join trd.admins IRC_ADMINCHANNEL, guide?
Reply
#2

At
pawn Код:
public IRC_OnConnect(botid, ip[], port)
use
pawn Код:
IRC_JoinChannel(botid, const channel[], const key[] = "")
Reply
#3

Did u edit this public?
Код:
public IRC_OnConnect(botid, ip[], port)
{
	printf("» IRC_OnConnect: Bot ID %d connected to %s:%d", botid, ip, port);
	IRC_JoinChannel(botid, IRC_ADMINCHANNEL);
	IRC_AddToGroup(groupID, botid);
	return 1;
}
Reply
#4

@GeniusPobs I think that might be it, let me test it
Reply
#5

Quote:
Originally Posted by _Khaled_
Посмотреть сообщение
@GeniusPobs I think that might be it, let me test it
Sure ^^
btw BigETI replied first.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)