#!/usr/bin/perl # script was written ages ago (probably 2008 or earlier). use warnings; use strict; use Irssi qw/command command_bind/; our $VERSION = "0.1"; our %IRSSI = ( authors => 'Urchlay', contact => 'Urchlay on NewNet', name => 'jumble', description => 'Smiultae bad tpying', license => 'Same as Perl', url => 'none', ); sub jumble { my ($text, $srv, $chan) = @_; my @words = split /\s+/, $text; for(@words) { if(length($_) > 2) { /(\W*\w)(\w+)(\w\W*)/; if($2) { my $start = $1; my $middle = $2; my $end = $3; my @letters = split "", $middle; for(0..$#letters-1) { ($letters[$_], $letters[$_+1]) = ($letters[$_+1], $letters[$_]) if rand > 0.5; } $_ = $start . join("", @letters) . $end; } } } $chan->command('MSG ' . $chan->{name} . ' ' . join(" ", @words)); } command_bind("jumble", \&jumble);