All pastes #986923 Raw Edit

Someone

public text v1 · immutable
·published 2008-04-16 01:56 UTC
rendered paste body
use strict;
use vars qw($VERSION %IRSSI);
 
use Irssi;
$VERSION = '1.00';
%IRSSI = (
    authors     => 'Peter Greenwood',
    contact     => 'pjgat09@gmail.com',
    name        => 'Highlight Code',
    license     => 'Public Domain',
);

sub server_msgs {
  my ($server, $data2, $nick, $address) = @_;
  my ($target, $text) = split(/ :/, $data2, 2);
  my $me = $server->{nick};
  if ( ($text =~ /$me/i) ) {
    $text =~ s/$me/($me)/g;
    my $place;
    if ($target =~ /^\#/) { $place = $target; } else { $place = "a PM"; }
    $server->command("msg #testing123 " . "In " . $place . " " . $nick . " Wrote:  " . $text);
  }
}

Irssi::signal_add("event privmsg", "server_msgs");