All pastes #476474 Raw Edit

perry

public text v1 · immutable
·published 2007-05-08 02:58 UTC
rendered paste body
#!/usr/bin/perl
#use strict;

# This script is generated for xchat 1.8.9 (linux version)
# but maybe will work by others operating systems or versions too.
# Try it :D

# Last tested with xchat version 2.2.4
# This version modified by perry



# INSTALLATION
# ------------
#
#   Just copy this file to ~/.xchat2/allvoice.pl
#   Normally, it will be loaded if you start xchat.
#
#   To load the script manually, type '/load ~/.xchat2/allvoice.pl'
#
#   Don't forget to configure the following line:
#

my($channel)='#ascension'; # Which channel do i have to auto-voice? (include the #)
my($channel2)='#covenant'; # Which channel do i have to auto-voice? (include the #)

# Example: my($channel)='#thechannel';


IRC::register ("allvoice script", "1.0", "", ""); 
IRC::print ("allvoice script loaded");
IRC::add_message_handler('JOIN', joined); 

sub joined{
	unless ($_[0]=~/\A:(.*)\!.*JOIN :(.*)\Z/){
		#If it isn't that someone joined, but e.g. somone just said JOIN :
		return;
	}
	my($persoon)=$1;
	if ($2=~/\A\Q$channel\E\Z/i){
		IRC::command("/raw MODE $channel +v $persoon"); 
	}

	return;	
}

sub joined{
	unless ($_[0]=~/\A:(.*)\!.*JOIN :(.*)\Z/){
		#If it isn't that someone joined, but e.g. somone just said JOIN :
		return;
	}
	my($persoon2)=$1;
	if ($2=~/\A\Q$channel2\E\Z/i){
		IRC::command("/raw MODE $channel2 +v $persoon2"); 
	}

	return;	
}