use strict; use Irssi; use Irssi::Irc; use POSIX; use vars qw($VERSION %IRSSI $nickservfqhn $mustidentify %nickpass %idcommand); $VERSION = '0.9'; %IRSSI = ( 'author' => 'JohnJohn', 'name' => 'Autostart', 'description' => 'Lance des commandes au démarrage, ajoute des alias' ); $nickservfqhn = 'NickServ!services@services.iiens.net'; $mustidentify = 'This nickname is registered and protected|Le pseudo .* est enregistr., si c\'est le votre, identifiez vous'; %nickpass = ('jj' => 'lolz'); %idcommand = ('jj' => 'identify'); sub event_notice { my ($server, $args, $nick, $nickad) = @_; my ($target, $msg) = $args =~ /^(\S*)\s*:(.*)$/; return unless ("$nick!$nickad" =~ /$nickservfqhn/i); return unless ($msg =~ /$mustidentify/i); $target = lc $target; my $pass = $nickpass{$target}; $server->send_raw ($idcommand{$target} . ' ' . $pass) if ($pass); } sub jj_kikoo { my ($args, $server, $witem) = @_; $args =~ s/ *$//; my $c = "\003".floor(rand(16)); my $kikoo = "\002\003".floor(rand(16)).','.floor(rand(16)). ' KIKOO'.'O' x floor(rand(40))." \003".floor(rand(16)).uc($args). " \003".floor(rand(16)).'!!!!'.'!' x floor(rand(40)). " $c".":\003".floor(rand(16))."o\003".floor(rand(16))."$c)))". ')' x floor(rand(40))." \003\002"; $witem->command("MSG $witem->{name} $kikoo"); } Irssi::command_bind ('kikoo', 'jj_kikoo'); Irssi::signal_add('event notice', 'event_notice');