diff options
author | Timo Sirainen <cras@irssi.org> | 2000-03-02 18:09:13 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-03-02 18:09:13 +0000 |
commit | 7a9cc02252150b6bf15464942d10d9bb0abb7522 (patch) | |
tree | 01e88dd7648e0ea73b8548fa0227a51c16788161 | |
parent | 75b749718755f9a836151648b520bc53f63e07e2 (diff) | |
download | irssi-7a9cc02252150b6bf15464942d10d9bb0abb7522.zip |
Missing makefile, added quitmsg.pl
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@133 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | examples/.cvsignore | 2 | ||||
-rw-r--r-- | examples/Makefile.am | 6 | ||||
-rw-r--r-- | examples/autorejoin.pl | 2 | ||||
-rw-r--r-- | examples/quitmsg.pl | 32 |
4 files changed, 41 insertions, 1 deletions
diff --git a/examples/.cvsignore b/examples/.cvsignore new file mode 100644 index 00000000..282522db --- /dev/null +++ b/examples/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/examples/Makefile.am b/examples/Makefile.am new file mode 100644 index 00000000..409ff8dd --- /dev/null +++ b/examples/Makefile.am @@ -0,0 +1,6 @@ +EXTRA_DIST = \ + autorejoin.pl \ + hello.pl \ + privmsg.pl \ + realname.pl \ + quitmsg.pl diff --git a/examples/autorejoin.pl b/examples/autorejoin.pl index 34f6cfe3..1dc4979a 100644 --- a/examples/autorejoin.pl +++ b/examples/autorejoin.pl @@ -2,7 +2,7 @@ # NOTE: I personally don't like this feature, in most channels I'm in it # will just result as ban. You've probably misunderstood the idea of /KICK -# wrong if you kick/get kicked all the time "just for fun" ... +# if you kick/get kicked all the time "just for fun" ... use Irssi; diff --git a/examples/quitmsg.pl b/examples/quitmsg.pl new file mode 100644 index 00000000..99c36247 --- /dev/null +++ b/examples/quitmsg.pl @@ -0,0 +1,32 @@ +# Quit with a random quit message read from ~/.irssi/irssi.quit + +use Irssi; + +$quitfile = "$ENV{HOME}/.irssi/irssi.quit"; + +sub cmd_quit { + my ($data, $server, $channel) = @_; + + open (f, $quitfile) || return; + $lines = 0; while(<f>) { $lines++; }; + + $line = int(rand($lines))+1; + + seek(f, 0, 0); $. = 0; + while(<f>) { + next if ($. != $line); + + chomp; + $quitmsg = $_; + last; + } + close(f); + + @servers = Irssi::servers; + foreach $server (@servers) { + %svals = %{$server->values()}; + $server->command("/disconnect ".$svals{'tag'}." $quitmsg"); + } +} + +Irssi::command_bind('quit', '', 'cmd_quit'); |