#pwn.pl
#!pwn
#Script perl pour irssi
#Retire tous les privilèges sur IRC sur tous les chans (utilisation de chanserv)
#

use strict;
use vars qw($VERSION %IRSSI);
use Irssi qw(command_bind signal_add);

$VERSION = '0.01';
%IRSSI = (
    authors     =>  'nah',
    contact     =>  'irc://irc.recycled-irc.net/#geekeries',
    name        =>  'pwn',
    description =>  '!pwn yourself',
    licence     =>  'WTFPL or better',
    url         =>  'irc://irc.recycled-irc.net/#geekeries'
);

sub pwn()
{
    my ($server, $msg) = @_;
    $_ = $msg;
    if (!/^!pwn/i) { return 0; }
    
    $server->command("qmsg chanserv deowner");
    $server->command("qmsg chanserv deprotect");
    sleep(1);
    $server->command("qmsg chanserv deop");
    $server->command("qmsg chanserv dehalfop");
    sleep(1);
    $server->command("qmsg chanserv voice");
    print 'pwned!';
}

signal_add("message own_public", "pwn");
