mIrc Connecting to the Server.
#1

Hey all, i'm having a issue with mIrc for a quiete while now.
I have been looking around on the internet to search what the problem might be, but i couldn't find it.
I hope anyone here can help me with this problem.

The problem is that when i Open my server (samp-server.exe) it says the Filterscript: "irc" is loaded, which is all fine but yet its not doing anything.
Also when compiling the .pwn file its not giving any sort of errors, or warnings.
I'm pritty sure i have filled in the #define IRC_SERVER, and the #define IRC_CHANNEL correctly.
Currently this is how my pwn looks like:

PHP код:
#include <irc>
// sscanf2 include from the sscanf plugin
#include <sscanf2>
// Name that everyone will see
#define BOT_1_NICKNAME "BotA1"
// Name that will only be visible in a whois
#define BOT_1_REALNAME "SA-MP Bot1"
// Name that will be in front of the hostname (username@hostname)
#define BOT_1_USERNAME "bots1"
#define BOT_2_NICKNAME "BotB2"
#define BOT_2_REALNAME "SA-MP Bot2"
#define BOT_2_USERNAME "bots2"
#define IRC_SERVER "irc.focogaming.com"
#define IRC_PORT (6667)
#define IRC_CHANNEL "#realliferp"
// Maximum number of bots in the filterscript
#define MAX_BOTS (2)
#define PLUGIN_VERSION "1.4.2"
new gBotID[MAX_BOTS], gGroupID;
/*
    When the filterscript is loaded, two bots will connect and a group will be
    created for them.
*/
public OnFilterScriptInit()
{
    
// Connect the first bot
    
gBotID[0] = IRC_Connect(IRC_SERVERIRC_PORTBOT_1_NICKNAMEBOT_1_REALNAMEBOT_1_USERNAME);
    
// Set the connect delay for the first bot to 20 seconds
    
IRC_SetIntData(gBotID[0], E_IRC_CONNECT_DELAY20);
    
// Connect the second bot
    
gBotID[1] = IRC_Connect(IRC_SERVERIRC_PORTBOT_2_NICKNAMEBOT_2_REALNAMEBOT_2_USERNAME);
    
// Set the connect delay for the second bot to 30 seconds
    
IRC_SetIntData(gBotID[1], E_IRC_CONNECT_DELAY30);
    
// Create a group (the bots will be added to it upon connect)
    
gGroupID IRC_CreateGroup();
}
/*
    When the filterscript is unloaded, the bots will disconnect, and the group
    will be destroyed.
*/
public OnFilterScriptExit()
{
    
// Disconnect the first bot
    
IRC_Quit(gBotID[0], "Filterscript exiting");
    
// Disconnect the second bot
    
IRC_Quit(gBotID[1], "Filterscript exiting");
    
// Destroy the group
    
IRC_DestroyGroup(gGroupID);
}
/*
    The standard SA-MP callbacks are below. We will echo a few of them to the
    IRC channel.
*/
public OnPlayerConnect(playerid)
{
    new 
joinMsg[128], name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    
format(joinMsgsizeof(joinMsg), "02[%d] 03*** %s has joined the server."playeridname);
    
IRC_GroupSay(gGroupIDIRC_CHANNELjoinMsg);
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
leaveMsg[128], name[MAX_PLAYER_NAME], reasonMsg[8];
    switch(
reason)
    {
        case 
0reasonMsg "Timeout";
        case 
1reasonMsg "Leaving";
        case 
2reasonMsg "Kicked";
    }
    
GetPlayerName(playeridnamesizeof(name));
    
format(leaveMsgsizeof(leaveMsg), "02[%d] 03*** %s has left the server. (%s)"playeridnamereasonMsg);
    
IRC_GroupSay(gGroupIDIRC_CHANNELleaveMsg);
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    new 
msg[128], killerName[MAX_PLAYER_NAME], reasonMsg[32], playerName[MAX_PLAYER_NAME];
    
GetPlayerName(killeridkillerNamesizeof(killerName));
    
GetPlayerName(playeridplayerNamesizeof(playerName));
    if (
killerid != INVALID_PLAYER_ID)
    {
        switch (
reason)
        {
            case 
0reasonMsg "Unarmed";
            case 
1reasonMsg "Brass Knuckles";
            case 
2reasonMsg "Golf Club";
            case 
3reasonMsg "Night Stick";
            case 
4reasonMsg "Knife";
            case 
5reasonMsg "Baseball Bat";
            case 
6reasonMsg "Shovel";
            case 
7reasonMsg "Pool Cue";
            case 
8reasonMsg "Katana";
            case 
9reasonMsg "Chainsaw";
            case 
10reasonMsg "Dildo";
            case 
11reasonMsg "Dildo";
            case 
12reasonMsg "Vibrator";
            case 
13reasonMsg "Vibrator";
            case 
14reasonMsg "Flowers";
            case 
15reasonMsg "Cane";
            case 
22reasonMsg "Pistol";
            case 
23reasonMsg "Silenced Pistol";
            case 
24reasonMsg "Desert Eagle";
            case 
25reasonMsg "Shotgun";
            case 
26reasonMsg "Sawn-off Shotgun";
            case 
27reasonMsg "Combat Shotgun";
            case 
28reasonMsg "MAC-10";
            case 
29reasonMsg "MP5";
            case 
30reasonMsg "AK-47";
            case 
31reasonMsg "M4";
            case 
32reasonMsg "TEC-9";
            case 
33reasonMsg "Country Rifle";
            case 
34reasonMsg "Sniper Rifle";
            case 
37reasonMsg "Fire";
            case 
38reasonMsg "Minigun";
            case 
41reasonMsg "Spray Can";
            case 
42reasonMsg "Fire Extinguisher";
            case 
49reasonMsg "Vehicle Collision";
            case 
50reasonMsg "Vehicle Collision";
            case 
51reasonMsg "Explosion";
            default: 
reasonMsg "Unknown";
        }
        
format(msgsizeof(msg), "04*** %s killed %s. (%s)"killerNameplayerNamereasonMsg);
    }
    else
    {
        switch (
reason)
        {
            case 
53format(msgsizeof(msg), "04*** %s died. (Drowned)"playerName);
            case 
54format(msgsizeof(msg), "04*** %s died. (Collision)"playerName);
            default: 
format(msgsizeof(msg), "04*** %s died."playerName);
        }
    }
    
IRC_GroupSay(gGroupIDIRC_CHANNELmsg);
    return 
1;
}
public 
OnPlayerText(playeridtext[])
{
    new 
name[MAX_PLAYER_NAME], ircMsg[256];
    
GetPlayerName(playeridnamesizeof(name));
    
format(ircMsgsizeof(ircMsg), "02[%d] 07%s: %s"playeridnametext);
    
IRC_GroupSay(gGroupIDIRC_CHANNELircMsg);
    return 
1;
}
/*
    The IRC callbacks are below. Many of these are simply derived from parsed
    raw messages received from the IRC server. They can be used to inform the
    bot of new activity in any of the channels it has joined.
*/
/*
    This callback is executed whenever a bot successfully connects to an IRC
    server.
*/
public IRC_OnConnect(botidip[], port)
{
    
printf("*** IRC_OnConnect: Bot ID %d connected to %s:%d"botidipport);
    
// Join the channel
    
IRC_JoinChannel(botidIRC_CHANNEL);
    
// Add the bot to the group
    
IRC_AddToGroup(gGroupIDbotid);
    return 
1;
}
/*
    This callback is executed whenever a current connection is closed. The
    plugin may automatically attempt to reconnect per user settings. IRC_Quit
    may be called at any time to stop the reconnection process.
*/
public IRC_OnDisconnect(botidip[], portreason[])
{
    
printf("*** IRC_OnDisconnect: Bot ID %d disconnected from %s:%d (%s)"botidipportreason);
    
// Remove the bot from the group
    
IRC_RemoveFromGroup(gGroupIDbotid);
    return 
1;
}
/*
    This callback is executed whenever a connection attempt begins. IRC_Quit may
    be called at any time to stop the reconnection process.
*/
public IRC_OnConnectAttempt(botidip[], port)
{
    
printf("*** IRC_OnConnectAttempt: Bot ID %d attempting to connect to %s:%d..."botidipport);
    return 
1;
}
/*
    This callback is executed whenever a connection attempt fails. IRC_Quit may
    be called at any time to stop the reconnection process.
*/
public IRC_OnConnectAttemptFail(botidip[], portreason[])
{
    
printf("*** IRC_OnConnectAttemptFail: Bot ID %d failed to connect to %s:%d (%s)"botidipportreason);
    return 
1;
}
/*
    This callback is executed whenever a bot joins a channel.
*/
public IRC_OnJoinChannel(botidchannel[])
{
    
printf("*** IRC_OnJoinChannel: Bot ID %d joined channel %s"botidchannel);
    return 
1;
}
/*
    This callback is executed whenevever a bot leaves a channel.
*/
public IRC_OnLeaveChannel(botidchannel[], message[])
{
    
printf("*** IRC_OnLeaveChannel: Bot ID %d left channel %s (%s)"botidchannelmessage);
    
IRC_JoinChannel(botidchannel);
    return 
1;
}
/*
    This callback is executed whenevever a bot is kicked from a channel. If the
    bot cannot immediately rejoin the channel (in the event, for example, that
    the bot is kicked and then banned), you might want to set up a timer here
    for rejoin attempts.
*/
public IRC_OnKickedFromChannel(botidchannel[], oppeduser[], oppedhost[], message[])
{
    
printf("*** IRC_OnKickedFromChannel: Bot ID %d kicked by %s (%s) from channel %s (%s)"botidoppeduseroppedhostchannelmessage);
    
IRC_JoinChannel(botidchannel);
    return 
1;
}
public 
IRC_OnUserDisconnect(botiduser[], host[], message[])
{
    
printf("*** IRC_OnUserDisconnect (Bot ID %d): User %s (%s) disconnected (%s)"botiduserhostmessage);
    return 
1;
}
public 
IRC_OnUserJoinChannel(botidchannel[], user[], host[])
{
    
printf("*** IRC_OnUserJoinChannel (Bot ID %d): User %s (%s) joined channel %s"botiduserhostchannel);
    return 
1;
}
public 
IRC_OnUserLeaveChannel(botidchannel[], user[], host[], message[])
{
    
printf("*** IRC_OnUserLeaveChannel (Bot ID %d): User %s (%s) left channel %s (%s)"botiduserhostchannelmessage);
    return 
1;
}
public 
IRC_OnUserKickedFromChannel(botidchannel[], kickeduser[], oppeduser[], oppedhost[], message[])
{
    
printf("*** IRC_OnUserKickedFromChannel (Bot ID %d): User %s kicked by %s (%s) from channel %s (%s)"botidkickeduseroppeduseroppedhostchannelmessage);
}
public 
IRC_OnUserNickChange(botidoldnick[], newnick[], host[])
{
    
printf("*** IRC_OnUserNickChange (Bot ID %d): User %s (%s) changed his/her nick to %s"botidoldnickhostnewnick);
    return 
1;
}
public 
IRC_OnUserSetChannelMode(botidchannel[], user[], host[], mode[])
{
    
printf("*** IRC_OnUserSetChannelMode (Bot ID %d): User %s (%s) on %s set mode: %s"botiduserhostchannelmode);
    return 
1;
}
public 
IRC_OnUserSetChannelTopic(botidchannel[], user[], host[], topic[])
{
    
printf("*** IRC_OnUserSetChannelTopic (Bot ID %d): User %s (%s) on %s set topic: %s"botiduserhostchanneltopic);
    return 
1;
}
public 
IRC_OnUserSay(botidrecipient[], user[], host[], message[])
{
    
printf("*** IRC_OnUserSay (Bot ID %d): User %s (%s) sent message to %s: %s"botiduserhostrecipientmessage);
    
// Someone sent the first bot a private message
    
if (!strcmp(recipientBOT_1_NICKNAME))
    {
        
IRC_Say(botiduser"You sent me a PM!");
    }
    return 
1;
}
public 
IRC_OnUserNotice(botidrecipient[], user[], host[], message[])
{
    
printf("*** IRC_OnUserNotice (Bot ID %d): User %s (%s) sent notice to %s: %s"botiduserhostrecipientmessage);
    
// Someone sent the second bot a notice (probably a network service)
    
if (!strcmp(recipientBOT_2_NICKNAME))
    {
        
IRC_Notice(botiduser"You sent me a notice!");
    }
    return 
1;
}
public 
IRC_OnUserRequestCTCP(botiduser[], host[], message[])
{
    
printf("*** IRC_OnUserRequestCTCP (Bot ID %d): User %s (%s) sent CTCP request: %s"botiduserhostmessage);
    
// Someone sent a CTCP VERSION request
    
if (!strcmp(message"VERSION"))
    {
        
IRC_ReplyCTCP(botiduser"VERSION SA-MP IRC Plugin v" #PLUGIN_VERSION "");
    
}
    return 
1;
}
public 
IRC_OnUserReplyCTCP(botiduser[], host[], message[])
{
    
printf("*** IRC_OnUserReplyCTCP (Bot ID %d): User %s (%s) sent CTCP reply: %s"botiduserhostmessage);
    return 
1;
}
/*
    This callback is useful for logging, debugging, or catching error messages
    sent by the IRC server.
*/
public IRC_OnReceiveRaw(botidmessage[])
{
    new 
File:file;
    if (!
fexist("irc_log.txt"))
    {
        
file fopen("irc_log.txt"io_write);
    }
    else
    {
        
file fopen("irc_log.txt"io_append);
    }
    if (
file)
    {
        
fwrite(filemessage);
        
fwrite(file"\r\n");
        
fclose(file);
    }
    return 
1;
}
/*
    Some examples of channel commands are here. You can add more very easily;
    their implementation is identical to that of ZeeX's zcmd.
*/
IRCCMD:say(botidchannel[], user[], host[], params[])
{
    
// Check if the user has at least voice in the channel
    
if (IRC_IsVoice(botidchanneluser))
    {
        
// Check if the user entered any text
        
if (!isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02*** %s on IRC: %s"userparams);
            
IRC_GroupSay(gGroupIDchannelmsg);
            
format(msgsizeof(msg), "*** %s on IRC: %s"userparams);
            
SendClientMessageToAll(0x0000FFFFmsg);
        }
    }
    return 
1;
}
IRCCMD:kick(botidchannel[], user[], host[], params[])
{
    
// Check if the user is at least a halfop in the channel
    
if (IRC_IsHalfop(botidchanneluser))
    {
        new 
playeridreason[64];
        
// Check if the user at least entered a player ID
        
if (sscanf(params"dS(No reason)[64]"playeridreason))
        {
            return 
1;
        }
        
// Check if the player is connected
        
if (IsPlayerConnected(playerid))
        {
            
// Echo the formatted message
            
new msg[128], name[MAX_PLAYER_NAME];
            
GetPlayerName(playeridnamesizeof(name));
            
format(msgsizeof(msg), "02*** %s has been kicked by %s on IRC. (%s)"nameuserreason);
            
IRC_GroupSay(gGroupIDchannelmsg);
            
format(msgsizeof(msg), "*** %s has been kicked by %s on IRC. (%s)"nameuserreason);
            
SendClientMessageToAll(0x0000FFFFmsg);
            
// Kick the player
            
Kick(playerid);
        }
    }
    return 
1;
}
IRCCMD:ban(botidchannel[], user[], host[], params[])
{
    
// Check if the user is at least an op in the channel
    
if (IRC_IsOp(botidchanneluser))
    {
        new 
playeridreason[64];
        
// Check if the user at least entered a player ID
        
if (sscanf(params"dS(No reason)[64]"playeridreason))
        {
            return 
1;
        }
        
// Check if the player is connected
        
if (IsPlayerConnected(playerid))
        {
            
// Echo the formatted message
            
new msg[128], name[MAX_PLAYER_NAME];
            
GetPlayerName(playeridnamesizeof(name));
            
format(msgsizeof(msg), "02*** %s has been banned by %s on IRC. (%s)"nameuserreason);
            
IRC_GroupSay(gGroupIDchannelmsg);
            
format(msgsizeof(msg), "*** %s has been banned by %s on IRC. (%s)"nameuserreason);
            
SendClientMessageToAll(0x0000FFFFmsg);
            
// Ban the player
            
BanEx(playeridreason);
        }
    }
    return 
1;
}
IRCCMD:rcon(botidchannel[], user[], host[], params[])
{
    
// Check if the user is at least an op in the channel
    
if (IRC_IsOp(botidchanneluser))
    {
        
// Check if the user entered any text
        
if (!isnull(params))
        {
            
// Check if the user did not enter any invalid commands
            
if (strcmp(params"exit"true) != && strfind(params"loadfs irc"true) == -1)
            {
                
// Echo the formatted message
                
new msg[128];
                
format(msgsizeof(msg), "RCON command %s has been executed."params);
                
IRC_GroupSay(gGroupIDchannelmsg);
                
// Send the command
                
SendRconCommand(params);
            }
        }
    }
    return 
1;

So ye.. when i run my server nothing at all is shown off in my mIrc channel, completly nothing.
I also don't see that the Bots are connecting or anything else.
If you know how to fix this, please tell me so!

Thanks in advance.
Reply
#2

Still not fixed :/. I realy, realy would appreciate some help.
Reply
#3

Post your log please. <- Nevermind


Download Icognito's IRC Plugin (I guess your using his plugin), then place the .dll in the folder, .so if linux, open up the server.cfg, edit the plugins lines and add plugins irc.dll (irc.so if linux), and It should connect to the IRC server and then channel (you;d get spam :P)
Reply
#4

i have the same problemzz
Reply
#5

maybe your ip has been banned from the irc server, do the bots attempt to connect at all?
Reply
#6

Quote:
Originally Posted by (*|Flake|*)
Посмотреть сообщение
maybe your ip has been banned from the irc server, do the bots attempt to connect at all?
I'm not IP banned for, i already maked channels on other mIrc servers, but nothing happend.
As i said, if i turn the server on nothing shows up, so i guess the bots aint even making an attempt to connect.
Reply
#7

Quote:
Originally Posted by Riddy
Посмотреть сообщение
Post your log please. <- Nevermind


Download Icognito's IRC Plugin (I guess your using his plugin), then place the .dll in the folder, .so if linux, open up the server.cfg, edit the plugins lines and add plugins irc.dll (irc.so if linux), and It should connect to the IRC server and then channel (you;d get spam :P)
I am using that IRC plugin already, i placed the .dll at Plugins folder.
This is how it looks at the momentL



Reply
#8

The IRC bots connect using the IP of your server. Therefore, you cannot know if they are banned or not (unless you homehost).

Connect to irc.tl, join channel #operhelp and ask if the IP is banned.

Another problem might be that some other server is already using the server IP to host its bots on - likely when you use a host. Then you will have to ask on #operhelp to raise the limit of incoming connections from that IP.

I cannot help nor check the scripting part.
Reply
#9

man! is there any problem with the script or something i used every irc script on samp forum but failed!
wtf! why is this hell happening

is there any problem in 0.3e or something
Reply
#10

I literally installed a IRC script to a certain gamemode yesterday and it worked perectly, so its either the IRC has a connection limit and the bots are going over that limit, or the IP address is banned from connecting to the server, or maybe, the IRC plugin may need updating, so recompile with the latest include and replace irc.dll with the latest version, then try it..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)