1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-30 06:45:25 +00:00

Missing makefile, added quitmsg.pl

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@133 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-03-02 18:09:13 +00:00 committed by cras
parent 75b7497187
commit 7a9cc02252
4 changed files with 41 additions and 1 deletions

2
examples/.cvsignore Normal file
View File

@ -0,0 +1,2 @@
Makefile
Makefile.in

6
examples/Makefile.am Normal file
View File

@ -0,0 +1,6 @@
EXTRA_DIST = \
autorejoin.pl \
hello.pl \
privmsg.pl \
realname.pl \
quitmsg.pl

View File

@ -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;

32
examples/quitmsg.pl Normal file
View File

@ -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');