2000-02-25 12:03:17 -05:00
|
|
|
# listen PRIVMSGs - send a notice to yourself when your nick is meantioned
|
|
|
|
|
|
|
|
use Irssi;
|
|
|
|
|
|
|
|
sub event_privmsg {
|
2000-12-06 00:42:13 -05:00
|
|
|
my ($server, $data, $nick, $address) = @_;
|
2000-02-25 12:03:17 -05:00
|
|
|
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-12-06 00:42:13 -05:00
|
|
|
$mynick = $server->{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");
|