# # $Id: decimessage.pl,v 1.3 2005/03/06 22:27:08 nugget Exp $ # # DeciMessage Spray # Original Version by David McNett # # Decibel annoyingly maintains about four dozen irc clients # and it's impossible to keep track of which client he's # connected to at any given time. This script will detect # when the user has sent a privmessage to one of decibel's # nicks and will spray it out to all of his nicks. # my @nicklist = ('decibel','decibull','thecougar'); use Irssi; use Irssi::Irc; use strict; my $cvsid = '$Id: decimessage.pl,v 1.3 2005/03/06 22:27:08 nugget Exp $'; my $version = '?'; if( $cvsid =~ /\$Id: [^ ]+ (\d+\.\d+)/ ) { $version = $1; } sub dm_blast { my ($data, $server, $witem) = @_; my @args = split / /, $data; if($args[0] =~ /^-/) { shift @args; } my $target = lc(shift @args); Irssi::print("PM to " . $target); for(my $i=0; $i<@nicklist; $i++) { if($target eq $nicklist[$i]) { Irssi::print("This is a Decibel Nick!"); for(my $j=0; $j<@nicklist; $j++) { if($i != $j) { my $message = join(' ',@args); Irssi::print("Copy to " . $nicklist[$j] . " - " . $message); $server->send_message($nicklist[$j], $message,1); } } } } } Irssi::signal_add("command msg", "dm_blast"); Irssi::window_find_name('ego')->print("DeciMessage v$version loaded...", MSGLEVEL_PUBLIC);