08.10.2013, 06:49
(
Last edited by iZN; 14/07/2014 at 06:47 AM.
Reason: grammatical errors
)
Tutorial about IRC
by iZN
What is IRC? - Wikipediaby iZN
Internet Relay Chat (IRC) is a protocol for live interactive Internet text messaging (chat) or synchronous conferencing. It is mainly designed for group communication in discussion forums, called channels, but also allows one-to-one communication via private message as well as chat and data transfer, including file sharing.
More detail....
IRC Clients
Windows
mIRC
XChat
KVIrc
Kiwiirc
ChatZilla (Firefox Add-on)
HexChat
Online
Mibbit
Linux
XChat for Linux
HexChat for Linux
Pidgin
Konversation
Android
AndroIRC
AndChat
iOS
Colloquy
Windows Phone
IRC Free
IRC Info:
Server: irc.tl
Port (NON-SSL): 6667-6669 and 8067 (6667 is by default)
Port (SSL):* 6697
Official SA-MP channels: #sa-mp and #sa-mp.scripting
* SSL port means secure connection. The ports may vary on other servers.
More info can be found at SA-MP Wiki.
Scripting (Echo bot)
First of all, download Incognito's IRC Plugin.
There is an include file, plugin (.dll) or (.so) and irc.pwn located in filterscripts folder. Open irc.pwn with Pawno or any other IDE/editors you're using.
You can see the configuration:
pawn Code:
// Name that everyone will see
#define BOT_1_NICKNAME "BotA"
// Name that will only be visible in a whois
#define BOT_1_REALNAME "SA-MP Bot"
// Name that will be in front of the hostname (username@hostname)
#define BOT_1_USERNAME "bot"
#define BOT_2_NICKNAME "BotB"
#define BOT_2_REALNAME "SA-MP Bot"
#define BOT_2_USERNAME "bot"
#define IRC_SERVER "irc.tl" // IRC Server
#define IRC_PORT (6667) // default port
#define IRC_CHANNEL "#testchannel" // your channel here.
Username is the name which can be seen before your vhost (hostname)
Example of my whois:
Nickname (visible to all) | -- | User name | This is the hostname | Realname |
iZN | is | iZN | @this.is.a.vhost | *iZN |
Also set your channel. You can register your own channel by going to your channel by /join #yourchannelname
Then, you've to type /cs register #yourchannelname
It will be registered to your account, a 'ChanServ' network service bot will automatically join your channel after registration. You can perform several commands through the network bot, just type !help in your registered channel. (It may differ at different networks, I've only mentioned about FoCo network)
Setting maximum bots:
You can set maximum bots, default is 2.
pawn Code:
#define MAX_BOTS (2)
pawn Code:
botIDs[1] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_3_NICKNAME, BOT_3_REALNAME, BOT_3_USERNAME);
Registration and Identifying your bot
Manually
If you want to register, you can do it manually by changing your nick to your bot nick. Afterwards type this command:
Code:
/ns register yourpass youremailhere@whatever.com
Code:
/ns identify yourpass
Register your bot manually, because it is abit messy while doing in PAWN, so it is better to do it manually.
You can group several nicks by /ns group will group the nick to the first registered account.
You can identifying your bot easily by adding just some line of codes.
First of all, we will make a define of our bot's password.
pawn Code:
#define BOT_PASS "botpasswordhere"
pawn Code:
IRC_SendRaw(botid, "PRIVMSG NickServ :IDENTIFY "BOT_PASS"");
Finalizing
Compile your script. Then place irc.amx file at filterscripts folder, if you haven't done it. Now placing the .dll file or .so file in the plugins folder.
Open 'server.cfg' through Notepad, and add the following lines:
Code:
filterscripts irc plugin irc
Code:
*** IRC_OnConnect: Bot ID botidhere connected to IP:PORT
NickServ (/ns help) (registration of your nick, ghosting, grouping and other commands related to nick)
ChanServ (/cs help) (registration of channel, and commands related to channel)
HostServ (/hs help) (vhost related commands)
BotServ (/bs help) (assigning any network service bot and commands for bot)
OperServ (/os help) (Not needed, it is mainly for the network operator)
IRC Commands
Registeration of nick: /msg nickserv passwordhere emailhere OR /ns register passwordhere emailhere
Identify/Login: /msg nickserv identify passwordhere OR /ns identify passwordhere
Joining channel: /join #channelhere
Parting/leaving channel: /part #channelhere
Change nick: /nick nickhere
Registeration of channel: /msg chanserv register #channelhere OR /cs register #channelhere
Note: Some other networks needs extra information like 'password' and 'description'.
That's all you've to know, hope I explained it better than others.
Suggestions
If you have any more suggestion, please suggest and if you're still having issues, PM me.
If you have seen any mistake, please let me know.