# If kick message isn't given, kick with a random message # read from ~/.irssi/irssi.kick use Irssi; use Irssi::Irc; use strict; use vars qw($VERSION %IRSSI); $VERSION = "1.00"; %IRSSI = ( authors => 'vjt based on a script by Timo Sirainen', name => 'kickmsg', description => 'Random kick messages', license => 'Public Domain', changed => 'Sun Ago 24 06:30 CEST 2002' ); my $kickfile = glob "~/.irssi/irssi.kick"; sub cmd_kick { my ($data, $server) = @_; my ($channel, $nick, $reason) = split(' ', $data, 3); if (!($channel =~ /^#/)) { $reason = "$nick $reason" if($nick); $nick = $channel; $channel = Irssi::active_win()->get_active_name() if(Irssi::channel_find(Irssi::active_win()->get_active_name())); } if($nick eq "") { Irssi::print("Not enough parameters given"); Irssi::signal_stop(); return; } return if ($reason ne ""); return unless open (f, $kickfile); my $line = 0; my $kickmsg; $line++ while(); $line = int(rand($line))+1; seek(f, 0, 0); $. = 0; while() { next if ($. != $line); chomp; $kickmsg = $_; last; } close(f); $server->command("/kick $channel $nick $kickmsg"); Irssi::signal_stop(); } Irssi::command_bind('kick', 'cmd_kick');