#!/usr/bin/perl -w
# VIM: set ts=4, set sw=4
#

package IRC::XChat::Match;

my $script_name    = "biglol.pl";
my $sver = '0.1';

IRC::register($script_name,$script_version, "", "");
IRC::print("\cC4Plugin BigLoL $sver caricato!\n");

my $pkg = __PACKAGE__;

Xchat::hook_command("", "${pkg}::checklolling");

sub checklolling {

	$l = 0;
	$o = "";
	$line = "";
	@lol = ( "a", "A", "h", "H" );
	my $channel = Xchat::get_info("channel");
	@txx = split(//,Xchat::strip_code($_[1][0]));
	if ($#txx > 3) {
	  for $o (@txx) {
		&checklol;
		if ($ucks eq 1) {
			$l++;
		}
	  }
		if ($l eq ($#txx+1)) { 
			$line = $_[1][0];
			$line =~ tr/[a-z]/[A-Z]/;
			Xchat::command("msg $channel $line");
		} else {
			$l = 0;
		}
	}
}

sub checklol {

	$s = "";
	$ucks = 0;
	for $s (@lol) {
		if (ord($o) == ord($s)) { $ucks = 1; }
	}
	return $ucks;
}

		
1;
#end
