<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>D3scene - IRC</title>
		<link>http://www.d3scene.com/forum/</link>
		<description><![CDATA[IRC (Internet Relay chat) is a real-time Internet chat or also known as synchronous conferencing. It was mainly developed for group communication. Consequently it's very popular for Gamers.]]></description>
		<language>en</language>
		<lastBuildDate>Sat, 21 Nov 2009 02:17:52 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.d3scene.com/forum/images/bullet/misc/rss.jpg</url>
			<title>D3scene - IRC</title>
			<link>http://www.d3scene.com/forum/</link>
		</image>
		<item>
			<title>How to connect a bot via ur website</title>
			<link>http://www.d3scene.com/forum/irc/33390-how-connect-bot-via-ur-website.html</link>
			<pubDate>Wed, 04 Nov 2009 15:35:59 GMT</pubDate>
			<description>This script is written in perl language.U can connect ur bot via ur website.i added few commands so the bot can response in ur commands. 
TIP: the...</description>
			<content:encoded><![CDATA[<div>This script is written in perl language.U can connect ur bot via ur website.i added few commands so the bot can response in ur commands.<br />
TIP: the bot will be 24/7 online if ur website is running.U can close ur browser if u want after that the bot still running.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">--------------<br />
PERL CONNECT BOT IRC<br />
-------------------<br />
<br />
<br />
#!/usr/bin/perl<br />
use strict;<br />
use warnings;<br />
use IO::Socket::INET;<br />
<br />
#Autoflush the output buffer<br />
$| = 1;<br />
#Create child process<br />
my $pid = fork();<br />
#If program is child process connect to irc<br />
if ($pid == 0) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; my $socket = IO::Socket::INET-&gt;new(PeerAddr =&gt; 'global.irc.gr:6667');<br />
&nbsp; &nbsp; &nbsp; &nbsp; print $socket &quot;USER perl localhost global.irc.gr Celestrial\r\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; print $socket &quot;NICK Celestrial\r\n&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; my $time = time();<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; while (my $line = &lt;$socket&gt;) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chomp $line;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my @words = split (/\s+/, $line);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $nickname = shift @words;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $cmd = shift @words;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shift @words;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ((substr($nickname, 0, 6) eq ':Ginzo!') and ($cmd eq 'PRIVMSG')) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $message = join (' ', @words);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $message = substr($message, 1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print $socket &quot;$message\r\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #Send PING to server every 1 min<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (time() - $time &gt;= 60) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print $socket &quot;PING\r\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $time = time();&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
}</code><hr />
</div>global.irc.gr:6667 -&gt; load it in the server that u want<br />
Celestrial -&gt; its the name of the bot<br />
Ginzo -&gt; is the name that bot can understand who is his admin<br />
PRVMSG -&gt; its the command that bot can understand his admin</div>

]]></content:encoded>
			<category domain="http://www.d3scene.com/forum/irc/">IRC</category>
			<dc:creator>Ginzo</dc:creator>
			<guid isPermaLink="true">http://www.d3scene.com/forum/irc/33390-how-connect-bot-via-ur-website.html</guid>
		</item>
	</channel>
</rss>
