[Tutorial] About IRC (Internet Relay Chat)
#1

Tutorial about IRC
by iZN
What is IRC? - Wikipedia
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.
Bot nickname is visible to everyone, so just set any nick you want. Real name is the name which can be seen while doing /whois [nick] (without [ ])
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
vHost can be requested by doing /hs request your.vhost.here

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)
If you're adding more bots, you've to add more connection in OnFilterScriptInit callback or else your other bots will not connect
pawn Code:
botIDs[1] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_3_NICKNAME, BOT_3_REALNAME, BOT_3_USERNAME);
All change botIDs and add more define 'BOT_3_NICKNAME' and 'BOT_3_REALNAME'

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
Then identifying it by
Code:
/ns identify yourpass
Automatically
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"
Now placing this at IRC_OnConnect callback.
pawn Code:
IRC_SendRaw(botid, "PRIVMSG NickServ :IDENTIFY "BOT_PASS"");
Your bot will now identify (if there is a account exist)

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
Save it and launch your server, if your bot is successfully connected, the server console will give a following message:

Code:
*** IRC_OnConnect: Bot ID botidhere connected to IP:PORT
Types of IRC Services

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.
Reply
#2

Does MicroIRC actually keep you connected when it's running in the background, unlike pretty much every other IRC app on WP8?
Reply
#3

Quote:
Originally Posted by Hiddos
View Post
Does MicroIRC actually keep you connected when it's running in the background, unlike pretty much every other IRC app on WP8?
Yes. It will get minimized, unless sometime the connection may time out due to dynamic IP or downtime of the internet.
Reply
#4

Quote:
Originally Posted by iZN
View Post
Yes. It will get minimized, unless sometime the connection may time out due to dynamic IP or downtime of the internet.
Cool, could you get me a working link D: ?
---edit; link works, just doesn't take you to the right page

Also, IRC app tip for Android users
Reply
#5

http://www.windowsphone.com/en-us/st...5-a329c4b2395d
Reply
#6

Nice
Reply
#7

XChat & HexChat are available for some Linux distros as well
Reply
#8

Hey iZN its me Joe
Nice Tutorial for Beginners
in my look mIRC IRC Client for Windows
download : www.mirc.com
Reply
#9

Quote:
Originally Posted by HuntingMan
View Post
Hey iZN its me Joe
Nice Tutorial for Beginners
in my look mIRC IRC Client for Windows
download : www.mirc.com
Thanks and I've already made mIRC to the top.
Reply
#10

http://www.qwebirc.org/ this??
Reply
#11

ircCloud is an online IRC client too.
Reply
#12

Is this legit & working 100%? I will be using this tutorial to create my own IRC system on my stunt gamemode.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)