10-13-2009, 02:27 AM
Hello SF
This script is created to be used for connecting to IRC clients using PHP on a linux system.
That's it Enjoy
This script is created to be used for connecting to IRC clients using PHP on a linux system.
PHP Code:
<?
function phpbot($server, $port, $user, $nick, $realname, $channel) {
$sockname = fsockopen($server, $port, $errno, $errstr) or exit("$errno $errstr");
$repeat = "0";
while ($sockread = fgets($sockname, 512)) {
$sockread = explode(" ", $sockread);
if (!$repeat) {
fputs($sockname, "USER $user x x :$realname\n");
fputs($sockname, "NICK $nick\n");
}
if ($sockread[0] == "PING") {
fputs($sockname, "PONG :$sockread[1]\n");
}
if ($sockread[1] == "001") {
fputs($sockname, "JOIN $channel\n");
}
if (fnmatch("43?", $sockread[1])) {
fputs($sockname, "NICK $nick".str_repeat(mt_rand(0, 9), 3)."\n");
}
$repeat++;
}
}
?>
<html>
<center>
<input type="button" onclick="<?=phpbot("irc.kingskrown.com","6667","phpbot","phpbot","phpbot","#kingskrown");?>" value="Connect"/>
</center>
</html>
That's it Enjoy