1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-13 05:03:45 -04:00
irssi/scripts/privmsg.pl
Timo Sirainen 2799d200cb Directory should really be named "scripts", not "examples".
Added script mlock.pl


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@149 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-03-15 20:49:44 +00:00

18 lines
464 B
Perl

# listen PRIVMSGs - send a notice to yourself when your nick is meantioned
use Irssi;
sub event_privmsg {
my ($data, $server, $nick, $address) = @_;
my ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
return if (!Irssi::is_channel($target));
$mynick = $server->values()->{'nick'};
return if ($text !~ /\b$mynick\b/);
$server->command("/notice $mynick In channel $target, $nick!$address said: $text");
}
Irssi::signal_add("event privmsg", "event_privmsg");