Advertisement
shutdown57

chat

Oct 21st, 2016
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.46 KB | None | 0 0
  1. <?php
  2. $m="\033[1;31m";
  3. $n="\033[1;37m";
  4. $h="\033[1;32m";
  5. if(!file_exists('.shutdown57_irc.conf')){
  6. echo "$m Please input your nickname : $n"; $nick=trim(fgets(STDIN));
  7. if($nick){
  8.     $fp=fopen(".shutdown57_irc.conf","w");
  9.     if(fwrite($fp,$nick)){
  10.         echo "$h [+] $n DONE .. \n";
  11.         echo "$m [!] $n Please, Come back!\n";
  12.     }
  13.     @fclose($fp);
  14. }
  15. }else{
  16. function a_kirim($nick,$msg){
  17.     $c=curl_init();
  18.     curl_setopt($c,CURLOPT_URL,"http://achan48.com/irc/kirim.php");
  19.     curl_setopt($c,CURLOPT_RETURNTRANSFER,1);
  20.     curl_setopt($c,CURLOPT_POST,1);
  21.     curl_setopt($c,CURLOPT_POSTFIELDS,array(
  22.         "nickname"=>$nick,
  23.         "pesan"=>$msg,));
  24.     $e=curl_exec($c);
  25.     return preg_match("/berhasil/",$e);
  26.     curl_close($c);
  27. }
  28. function a_pesan(){
  29.     $c=curl_init();
  30.     curl_setopt($c,CURLOPT_RETURNTRANSFER,1);
  31.     curl_setopt($c,CURLOPT_URL,"http://achan48.com/irc/chat.php");
  32.     curl_setopt($c,CURLOPT_HEADER,0);
  33.     $e=curl_exec($c);
  34.     return $e;
  35. }
  36. function a_pisah($pemisah,$string){
  37.     return explode(chr(1),str_replace($pemisah,chr(1),$string));
  38. }
  39. function a_tampil(){
  40. $tampil = a_pisah(array('irc1','irc2'),a_pesan());
  41. print_r($tampil[1]);
  42. }
  43. function a_msg(){
  44. $m="\033[1;31m";
  45. $n="\033[1;37m";
  46. $h="\033[1;32m";
  47. echo "$m pesec@".$h.file_get_contents(".shutdown57_irc.conf").":/message $ $n"; $msg=trim(fgets(STDIN));
  48. if(a_kirim(file_get_contents(".shutdown57_irc.conf"),$msg)){
  49.     @system("clear");
  50.     a_tampil();
  51.     a_msg();
  52. }else{
  53.     echo "gagal\n";
  54.     a_msg();
  55. }
  56. }
  57. a_tampil();
  58. a_msg();
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement