Public feed #893408

Someone

public text v1 · immutable
Raw Edit
·published 2008-02-06 02:44 UTC
rendered paste body
#!/usr/bin/perl

Xchat::register("Auto Voice","0.5","Auto voices the users you put in \"op.txt\" when they join #channel");

Xchat::hook_print("Join",\&auto);

Xchat::hook_command("rl",\&command);

 

$file = 'put teh path here';

 

open($in,$file);

chomp(@names = <$in>);

close($in);

 

sub auto {

	my $channel = $_[0][1];

	my $user = $_[0][0];

	my $context = Xchat::get_context();

 

	if ($channel eq "#r4forum") {

		Xchat::hook_timer(100,

			sub {

				Xchat::set_context($context);

				foreach my $autov (@names) {

					if ($user eq $autov) {

						Xchat::command("MODE +o $user");

						last;

						return Xchat::REMOVE;

					}

				}

			}

		);

	}

}

 

sub command {

	my $com = $_[0][0];

	if ($com eq "rl") {

		open($in,$file);

		chomp(@names = <$in>);

		close($in);

		Xchat::command("ECHO op.txt reloaded.");

	}

}