View difference between Paste ID: H7eK6tN6 and DZudTXnx
SHOW: | | - or go back to the newest paste.
1
use Irssi;
2
use Irssi::Irc;
3
use strict;
4
use vars qw($VERSION %IRSSI);
5
use IO::Socket;
6
use warnings;
7
8
$VERSION = '3.0';
9
%IRSSI = (
10
    authors     => 'Aha2Y alias Shiny',
11
    contact     => 'Aha2Y@Hush.com',
12-
    name        => 'EliteBNC',
12+
    name        => 'EliteBNC Status Script',
13-
    description => 'EliteBNC Module for IRSSI.',
13+
    description => 'EliteBNC Server check!',
14
    license     => 'Aha2Y',
15
	changes	=> "v3.0 - Fixed critical freeze bug."
16
);
17
18
sub cmd_check {
19
	my ($server, $data, $nick, $mask, $target, $channel) =@_;
20
	if ($data=~/^!elitebnc/){
21-
	$server->command("/MSG ".$target." Sending PING request to elitebnc servers...");
21+
22
		my ($delta) = IO::Socket::INET->new(PeerAddr=>'delta.elitebnc.net',PeerPort=>'1337',Proto=>'tcp');
23-
		if($alpha) { 
23+
		my ($epilson) = IO::Socket::INET->new(PeerAddr=>'Epsilon.elitebnc.net',PeerPort=>'1337',Proto=>'tcp');
24-
		my ($alpha2) = "online";  }		
24+
		my ($gamma) = IO::Socket::INET->new(PeerAddr=>'Gamma.elitebnc.net',PeerPort=>'1337',Proto=>'tcp');		
25-
		else 	{ 
25+
		my ($omega) = IO::Socket::INET->new(PeerAddr=>'Omega.elitebnc.net',PeerPort=>'1337',Proto=>'tcp');		
26-
		my ($alpha2) = "offline"; 	}
26+
		my ($sigma) = IO::Socket::INET->new(PeerAddr=>'Sigma.elitebnc.net',PeerPort=>'1337',Proto=>'tcp');		
27-
		$server->command("/MSG ".$target." Alpha: ".$alpha2."");
27+
		my ($xi) = IO::Socket::INET->new(PeerAddr=>'xi.elitebnc.net',PeerPort=>'1337',Proto=>'tcp');		
28
		my ($zeta) = IO::Socket::INET->new(PeerAddr=>'zeta.elitebnc.net',PeerPort=>'1337',Proto=>'tcp');		
29
		my ($test) = IO::Socket::INET->new(PeerAddr=>'test.elitebnc.net',PeerPort=>'1337',Proto=>'tcp');		
30
		my ($alpha2, $delta2, $epilson2, $gamma2, $omega2, $sigma2, $xi2, $zeta2, $test2);
31
		if($alpha) { $alpha2 = "3UP";  }		
32
		else 	{ $alpha2 = "4DOWN!"; 	}
33
		if($delta) { $delta2 = "3UP";  }		
34
		else 	{ $delta2 = "4DOWN"; 	}
35
		if($epilson) { $epilson2 = "3UP";  }		
36
		else 	{ $epilson2 = "4DOWN"; 	}
37
		if($gamma) { $gamma2 = "3UP";  }		
38
		else 	{ $gamma2 = "4DOWN"; 	}
39
		if($sigma) { $sigma2 = "3UP";  }		
40
		else 	{ $sigma2 = "4DOWN"; 	}
41
		if($xi) { $xi2 = "3UP";  }		
42
		else 	{ $xi2 = "4DOWN"; 	}
43
		if($zeta) { $zeta2 = "3UP";  }		
44
		else 	{ $zeta2 = "4DOWN"; 	}
45
		if($test) { $test2 = "3UP";  }		
46
		else 	{ $test2 = "4DOWN"; 	}
47
		$server->command("/MSG ".$target." Alpha: ".$alpha2." Delta: ".$delta2." Epilson: ".$epilson2." Gamma: ".$gamma2." Sigma: ".$sigma2." Xi: ".$xi2." Zeta: ".$zeta2." Test: ".$test2."");
48
	}
49
}
50
Irssi::signal_add_last('message public', 'cmd_check');
51
Irssi::print("Loaded $IRSSI{name} $VERSION by Aha2Y.");