Code: Select all
function send($con, $msg)
{
fputs($con, $msg . "\r\n");
}
function join($con, $channel)
{
send($con, "JOIN $channel");
}
function op($con, $channel, $user)
{
send($con, "MODE $channel +o $user");
}
function unop($con, $channel, $user)
{
send($con, "MODE $channel -o $user");
}
function ban($con, $channel $user);
{
send($con, "MODE $channel +b $user");
}
function unban($con, $channel, $user)
{
send($con, "MODE $channel -b $user");
}
function kick($con, $channel, $user)
{
send($con, "KICK $channel $user");
}
function kb($con, $channel, $user)
{
send($con, "MODE $channel +b $user");
send($con, "KICK $channel $user");
}
function part($con, $channel)
{
send($con, "PART $channel");
}
function oper($con, $user, $password)
{
send($con, "OPER $user $password");
}
function say($con, $channel, $sentence)
{
send($con, "PRIVMSG $channel :$sentence");
}
function encrypt($method, $string)
{
if($method == "sha1")
{
$hash = sha1($string);
}
if($method == "md5")
{
$hash = md5($string);
}
if($hash == "ripemd128")
{
$hash = hash("ripemd128", $string);
}
if($method == "snefru")
{
$hash = hash("snefru", $string);
}
if($method == "gost")
{
$hash = hash("gost", $string);
}
if($method == "adler32")
{
$hash = hash("adler32", $string);
}
return $hash;
}
Note:
To add this into your bot, save it to a .php file and add the following line to the beginning of your bot:
Code: Select all
include("file.php");