Creation/Dev/Troubleshooting Graal v4 IRC
Written by Skyld, 28/08/2005.
Introduction
After a rising number of people are having problems using the IRC and events system in their scripting, I have decided to write this document to assist in troubleshooting problems.
No IRC server connection
If you are finding that commands like:
sendtext("irc", "login", "EventsBot"); sendtext("irc", "privmsg", {"IRCBot", "!resetevents"});
... in your events bots are not returning any responses, your gserver may not be equipped with the ability to access IRC. There are two important factors to a capable server:
- Gscript2 must be enabled
- The server must be able to connect to the IRC server
In the case that you cannot connect to the IRC server, then you should try restarting your gserver using the GraalOnline ADCP.
EventsBot is registered, but no admin control is available in the serverlist
When you receive a PRIVMSG from IRCBot saying "!eventsbotlogin", you must provide two important details about your setup.
- Send the account names of those who should have admin access:
sendtext("irc", "privmsg", {"IRCBot", {"!eventadmins", "AccountName", "AccountName2"}});
- Send the discussion channel for your events:
sendtext("irc", "privmsg", {"IRCBot", {"!eventchannel", "#ChannelName"}});
When the EventsBot logs in, after sending the above data, the listed account names should have access to the Admin tab for events when they log onto the game server.
My IRC bot occasionally disappears and does not reappear until script update
This could be for a couple of reasons:
- The IRC server was reloaded and connections were reset
- The IRC server fails or a problem arises
- The gserver/npcserver has been restarted
To ensure that the IRC bot always restores it's connection, you should put your connect routine in a seperate function, and use something like this:
function onCreated() IRCConnect(); function onInitialized() IRCConnect(); function onServerListerConnect() IRCConnect();
Also, ensure that the IRC bot is correctly resetting it's connection by logging out in your connect routine:
sendtext("irc", "logout", ""); sendtext("irc", "login", "nickname");
My IRC bot does not accept name changes properly on script update
This occurs because you have tried to use a new name without freeing your previous one. Just logging in again with a new name will not work. Instead, you have to log out and then log in using the new name.
sendtext("irc", "logout", ""); sendtext("irc", "login", "Nickname");
In fact, it's probably a good idea to make your IRC bot log out and in again on every connection.
Randomly, my IRC bot reports everyone in the channel joining again
ADDCHANNELUSER is sent to IRC scripts every time a user joins a channel that you or your IRC bot is also in. This allows making of a user list for that channel, or simply monitoring who joins and leaves. It has been known for this to occasionally occur, listing everyone in the channel at once. This could happen for a number of reasons:
- You have reset your connection to the IRC server, maybe by a script update, and the IRC server is telling you again who is in the channel
- The IRC server has been reloaded, and as a result, connections have been dropped
This is not a problem as such, but if this is a problem for you specifically, consider removing any messages that occur on this event, or if you are listing users, make sure your list does not show any user more than once.
My IRC bot is not setting it's name correctly
You may find that in an attempt to set your IRC bot's name, it may be named IRCBot_N instead. There is a simple reason for this. IRC connections from the serverside demand the nickname to begin with the following:
- IRCBot_
- EventsBot_
- Graal_
Any other nicknames will not be accepted.
Note: This is not the case with IRC connections from the clientside.
Other problems
If you are having a problem that is not listed here, Skyld may be able to help you. Contact details are available on Skyld's user page, and may be able to help solve the problem. New problems will also be added here when found.