Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- use Irssi;
- use Irssi::Irc;
- use vars qw($VERSION %IRSSI);
- $VERSION = "1.0";
- %IRSSI = (
- "authors" => "esc",
- "name" => "redirectmsg",
- "description" => "Redirect messages to another window",
- "license" => "GNU GPL v2"
- );
- my $chan = "##crawl";
- my @bots = (
- "Rotatell", "Lantell", "Henzell", "Sequell",
- "Eksell", "Jorgrell", "Cheibriados", "Gretell",
- "Kramell"
- );
- sub sig_messagepublic {
- my ( $server, $msg, $nick, $address, $target ) = @_;
- if ( $target =~ /^$chan$/
- && grep( /^$nick$/, @bots ) )
- {
- my $windowname = Irssi::window_find_name('redirect');
- $windowname->print(
- "REDIRECT : " . $target . " : < " . $nick . ">: " . $msg,
- MSGLEVEL_CLIENTCRAP )
- if ($windowname);
- Irssi::signal_stop();
- }
- }
- my $windowname = Irssi::window_find_name('redirect');
- if ( !$windowname ) {
- Irssi::command("window new hidden");
- Irssi::command("window name redirect");
- }
- Irssi::signal_add( { 'message public', 'sig_messagepublic' } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement