Guest User

Untitled

a guest
Jun 24th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.02 KB | None | 0 0
  1. #!/usr/bin/perl
  2. # perl irc bot
  3. # @author
  4. # B.A.R.S
  5. # here you go syk you fucking faggot
  6. # ima do some chop($sideburns); for you
  7. #################
  8. use strict;
  9. use IO::Socket::INET;
  10.  
  11. # configuration data
  12. my ($server, $ident, $channel) = ('irc.gcode.biz', 'sykgondie', '#gcode');
  13.  
  14.  
  15. our $socket = IO::Socket::INET->new(PeerAddr => $server,
  16.                                     PeerPort => 6667,
  17.                                     Proto => 'tcp') or die "Could not establish connection to " . $server ."\n";
  18.  
  19.  
  20. print $socket "USER $ident $ident $ident $ident :$ident\n";
  21. print $socket "NICK $ident\n";
  22.  
  23. while(my $data = <$socket>) {
  24.     if($data =~ m/^PING (.*?)$/gi) {
  25.         $socket->send("PONG $1\n");
  26.     }
  27.  
  28.     if($data =~ /^:$ident/) {
  29.         $socket->send("JOIN $channel\r\n");
  30.     }
  31.  
  32.     if($data =~ /^\:(.*?)!(.*?)@(.*?) PRIVMSG (.*?) \:(.*?)/) {
  33.         my ($user, $id, $host, $chan, $msg) = ($_[1], $_[2], $_[3], $_[4], $_[5]);
  34.         $socket->send("PRIVMSG $channel :$user\r\n");
  35.     }
  36.     print $data;
  37. }
Add Comment
Please, Sign In to add comment