mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05: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:
parent
75b7497187
commit
7a9cc02252
2
examples/.cvsignore
Normal file
2
examples/.cvsignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
6
examples/Makefile.am
Normal file
6
examples/Makefile.am
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
EXTRA_DIST = \
|
||||||
|
autorejoin.pl \
|
||||||
|
hello.pl \
|
||||||
|
privmsg.pl \
|
||||||
|
realname.pl \
|
||||||
|
quitmsg.pl
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# NOTE: I personally don't like this feature, in most channels I'm in it
|
# 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
|
# 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;
|
use Irssi;
|
||||||
|
|
||||||
|
32
examples/quitmsg.pl
Normal file
32
examples/quitmsg.pl
Normal 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');
|
Loading…
Reference in New Issue
Block a user