2000-02-25 12:03:17 -05:00
|
|
|
# listen PRIVMSGs - send a notice to yourself when your nick is meantioned
|
|
|
|
|
|
|
|
use Irssi;
|
2000-10-18 16:50:12 -04:00
|
|
|
use Irssi::Irc;
|
2000-02-25 12:03:17 -05:00
|
|
|
|
|
|
|
sub event_privmsg {
|
|
|
|
my ($data, $server, $nick, $address) = @_;
|
|
|
|
my ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
|
|
|
|
|
2000-10-18 16:50:12 -04:00
|
|
|
return if (!$server->ischannel($target));
|
2000-02-25 12:03:17 -05:00
|
|
|
|
2000-03-10 15:16:43 -05:00
|
|
|
$mynick = $server->values()->{'nick'};
|
2000-02-25 12:03:17 -05:00
|
|
|
return if ($text !~ /\b$mynick\b/);
|
|
|
|
|
|
|
|
$server->command("/notice $mynick In channel $target, $nick!$address said: $text");
|
|
|
|
}
|
|
|
|
|
|
|
|
Irssi::signal_add("event privmsg", "event_privmsg");
|