Connecting IRC bots to .admins - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Connecting IRC bots to .admins (
/showthread.php?tid=446739)
Connecting IRC bots to .admins -
_Khaled_ - 27.06.2013
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?
AW: Connecting IRC bots to .admins -
BigETI - 27.06.2013
At
pawn Код:
public IRC_OnConnect(botid, ip[], port)
use
pawn Код:
IRC_JoinChannel(botid, const channel[], const key[] = "")
Re: Connecting IRC bots to .admins -
GeniusPobs - 27.06.2013
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;
}
Re: Connecting IRC bots to .admins -
_Khaled_ - 27.06.2013
@GeniusPobs I think that might be it, let me test it
Re: Connecting IRC bots to .admins -
GeniusPobs - 27.06.2013
Quote:
Originally Posted by _Khaled_
@GeniusPobs I think that might be it, let me test it
|
Sure ^^
btw BigETI replied first.