rendered paste body#!/usr/bin/perl
use strict;
use Net::IRC;
if(@ARGV<1) {
die "usage: ./seizure.pl <network>\n";
}
my $network = shift;
print "\nGenerating message...\n";
our $message = &flashbang("FLASHBANG");
print "Creating connection...\n";
my $irc = new Net::IRC;
my $conn = $irc->newconn(Nick => 'joinsall',
Server => $network,
Port => 6667,
Ircname => 'haquer');
$conn->add_handler('376', \&on_connect);
print "Starting IRC...\n";
$irc->start;
sub on_connect {
my $self = shift;
print "Joining \#hithere..\n";
$self->join("#hithere");
print "Prepare to intercept.\n";
for(1..10) {
$self->privmsg("#hithere",$message);
}
}
sub flashbang {
my $arg = shift;
my $text;
for(1..int(510/length($arg))) {
if(length($text) < 510 - 15) {
if($_ % 2 == 0) {
$text .= "\cC11,8$arg\cC";
}
else {
$text .= "\cC8,11$arg\cC";
}
}
else {
last;
}
}
return $text;
}