#!/usr/bin/perl
#use strict;
# This script is Free Domain. Use it if you like :)
# This script gives everyone who joins a channel, voice (+v)
# 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
# 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;
}