summaryrefslogtreecommitdiff
path: root/scripts/privmsg.pl
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-03-15 20:49:44 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-03-15 20:49:44 +0000
commit2799d200cb28fee39a8b621e60fa71ac943f504f (patch)
tree864f7a2a227ff2b7275fb57cac5cef7e4f0e045b /scripts/privmsg.pl
parentbefd35e710bec8af72865b1e670e8a15f9342a45 (diff)
downloadirssi-2799d200cb28fee39a8b621e60fa71ac943f504f.zip
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
Diffstat (limited to 'scripts/privmsg.pl')
-rw-r--r--scripts/privmsg.pl17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/privmsg.pl b/scripts/privmsg.pl
new file mode 100644
index 00000000..999bd213
--- /dev/null
+++ b/scripts/privmsg.pl
@@ -0,0 +1,17 @@
+# 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");