Advertisement
bssanchez93

Irssi - Convertir a l33t

Jun 19th, 2014
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.86 KB | None | 0 0
  1. use strict;
  2. use Irssi;
  3. use vars qw($VERSION %IRSSI);
  4.  
  5. $VERSION = "1.0";
  6. %IRSSI = (
  7.     authors     => "kid_goth",
  8.     contact     => "g0th4ck[at]gmail[dot]com",
  9.     name        => "leet",
  10.     licence     => "Pa todos y todas",
  11.     description => "Convierte el mensaje a lenguaje l33t, respetando url http y https",
  12.     changed     => "Jueves, 19 de junio del 2014"
  13. );
  14.  
  15. sub send_text {
  16.     my($data, $server, $witem) = @_;
  17.         return unless $witem;
  18.  
  19.     my $mensaje = "";
  20.     my $tmp;
  21.     my @datos = split(' ', $data); 
  22.  
  23.     foreach (@datos) {
  24.         $tmp = $_;
  25.  
  26.         if (!($tmp =~ /^(https?)/)) {
  27.             $tmp =~ s/a/4/gi;
  28.             $tmp =~ s/e/3/gi;
  29.             $tmp =~ s/i/1/gi;
  30.             $tmp =~ s/o/0/gi;
  31.             $tmp =~ s/u/v/gi;
  32.         }
  33.    
  34.         $mensaje .= $tmp . ' ';
  35.     }
  36.     chop $mensaje;
  37.  
  38.     $server->command("MSG $$witem{'name'} $mensaje");
  39.     Irssi::signal_stop();
  40. }
  41.  
  42. Irssi::signal_add_first('send text', 'send_text');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement