# $Id: $ # # {{{ use use strict; use Irssi qw(settings_add_str signal_add settings_get_str signal_add_first signal_stop); use vars qw($VERSION %IRSSI); # }}} # {{{ Irssi variables $VERSION = "14.88"; %IRSSI = ( authors => 'vxp', contact => 'irc.arabs.ps #arab', name => 'flummi', description => 'FLUMMI', license => 'ARABIC FUCK YOU LICNESE', ); # }}} my @channels = (); sub reload { @channels = split(/ /, settings_get_str("flummi_channels")); }; settings_add_str("flummi", "flummi_channels", ""); signal_add("setup changed", \&reload); reload(); sub knubbze { my (@c) = (int(rand(14) + 1), int(rand(14) + 1)); while($c[0] eq $c[1]) { $c[1] = int(rand(14) + 1); }; return @c; }; signal_add_first('send text', sub { my ($line, undef, $witem) = @_; return unless ( length($line)) && ("CHANNEL" eq $witem->{'type'}) && grep {lc($_) eq $witem->{'name'}} @channels; my (@c) = ([knubbze()], [knubbze()]); my ($nc, $msg) = (0, ""); foreach my $c (split(//, $line)) { $msg .= sprintf("\003%.02d,%.02d%s", $c[$nc]->[0], $c[$nc]->[1], $c); $nc = (!$nc or 0); }; signal_stop(); $witem->command("say ". $msg); }); # vim:ts=8 sw=8 tw=80 noexpandtab foldmethod=marker