x-haui

kick.pl

Ever wanted to kick multiple users with just one command? 

kick.pl makes it possible!

Usage:

/kck user1 user2 user3

Download

Source


 1 #!/usr/bin/perl
 2 
 3 #    This program is free software: you can redistribute it and/or modify
 4 #    it under the terms of the GNU General Public License as published by
 5 #    the Free Software Foundation, either version 3 of the License, or
 6 #    (at your option) any later version.
 7 #
 8 #    This program is distributed in the hope that it will be useful,
 9 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 #    GNU General Public License for more details.
12 #
13 #    You should have received a copy of the GNU General Public License
14 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
15 
16 use strict;
17 use vars qw(%IRSSI );
18 my %IRSSI = (
19         'authors'      =>      'Haui',
20         'contact'      =>      'haui45@web.de',
21         'name'         =>      'kicjuppdiduppk',
22         'description'  =>      'this script allows you to kick' .
23                                 'multiple users :D',
24         'license'      =>      'GPL',
25         'version'      =>      '0.1',
26         'usage'        =>      '/kck user1 user2 user3',
27         );
28 
29 #define your kickreason: /set kmessage REASON
30 Irssi::settings_add_str("kick", "kmessage", "byebye");
31 sub kck {
32     # server - the active server in window
33     # witem - the active window item (eg. channel, query)
34     #         or undef if the window is empty
35     my ($data, $server, $witem) = @_;
36 
37     if (!$server || !$server->{connected}) {
38       Irssi::print("Not connected to server");
39       return;
40     }
41 
42     if ($data && $witem && ($witem->{type} eq "CHANNEL")) {
43         my @array = split(/ /, $data);
44         my $reason = Irssi::settings_get_str("kmessage");
45         foreach (@array){
46                 $witem->command("/kick $_ $reason");
47         }
48     } else {
49       Irssi::print("Error");
50     }
51   }
52 
53   Irssi::command_bind('kck', 'kck');