All pastes #988180 Raw Edit

Stuff

public text v1 · immutable
#988180 ·published 2008-04-17 11:19 UTC
rendered paste body
<?php


	require ("libIRC.php");


	$JoinedChannel				=	0;
	$NickName				=	"sdsdsd";
	$Server					=	"irc.****";
	$Port					=	6667;
	$Channel				=	"#***";
	$To					=	"sdsd";



	$IRC = &New IRCConnection;

	$IRC->Connect($Server, $Port, $NickName);
	echo "[i] Client connected\n";	

	while ($Message = $IRC->Recieve()) {
		
		if (!$JoinedChannel) {
			$IRC->JoinChannel($Channel);
			$JoinedChannel		=	1;
			echo "[i] Joined Channel\n";
		}

		if (preg_match("/ PRIVMSG " . $To . " :/", $Message)) {
			$PrivateMessage = preg_split("/ PRIVMSG " . $To . " :/", $Message);
			$From = preg_split("/!~/", $PrivateMessage[0]);
			$Hostname = "~".$From[1];
			$From = str_replace(":", "", $From[0]);
			$Message = chop($PrivateMessage[1]);

			echo "[i] Got message and replied.\n";
			$IRC->SendPrivMessage($From, $Message);
		}

	}

	echo "[i] Client exited.\n";
?>