<>; Note: THERE IS NO NEED TO EDIT THIS SCRIPT. Description: This script allows you to join channels on connect only after freenode sets your cloak. This ensures that the cloak is visible upon joining each channel. For X-Chat 2.0.8+; if in doubt test in the latest version first. Seek support on freenode's #xchat. Usage: 1. Make sure the script has a .pl extention. 2. Put it in your config directory for it to run on start 3. (a) Open the server list (ctrl+s), (b) select or add an entry for freenode, (c) hit "Edit..." (d) place "youraccount password" in the nickserv field* (e) and put the following in your connect command (see the FAQ for info on multiple commands): CloakAndJoin #channels,#to,#join - or - CloakAndJoin -u account -p password #channels,#to,#join For channels with keys, CloakAndJoin password #channels,#to,#join channel's_key,,join's_key - or - CloakAndJoin -u account -p password #chans,#to,#join chan's_key,,join's_key This is the join command's syntax. Do not put spaces around the commas. If -p password is not provided, you must have specified the password within XChat's built in NickServ password handling. If -u account is specified, XChat will identify to the specified account * You can choose not to use the Nickserv field, however XChat will not wait for confirmation of being cloaked before joining if you have to reconnect either automatically or with /reconnect. By placing both your account name and the password in the field, freenode will identify you to that specific account, even if not in the group. Note: THERE IS NO NEED TO EDIT THIS SCRIPT. q use strict; use warnings; use Xchat qw( :all ); register( my $NAME = "Fn Cloak+Join", my $VERSION = '4', "Join channels after a Freenode cloak takes effect" ); my $COMMAND = 'CloakAndJoin'; # name of user command my $USAGE = 'Usage: '.$COMMAND.' [-u ] [-p ] <#list,#of,#channels> []'; # /help COMMAND my $PREFIX = "\cBCloak+Join\cB\t"; my $HOOK; hook_command($COMMAND, sub { my ($w, $e) = @_; my ($account, $password, $args); my $i = 1; while ($$w[$i]) { if ($$w[$i] eq '-p' && $$w[$i+1]) { $password = $$w[++$i] } elsif ($$w[$i] eq '-u' && $$w[$i+1]) { $account = $$w[++$i] } else { $args = $$e[$i]; last } $i++; } if ( not $args ) { prnt("$PREFIX$USAGE") } else { $args =~ s/(?<=,) //g if $args; # ' , '->',' my ($channels, $keys) = split" ",$args,2; $_||='' for($channels, $keys); # optional # to keep out of the server on reconnect if not identified to services, # need to jump the irc_join_delay sky high and then bring back down to earth # this will only work if the nickserv password field in the network list # is populated my $delay = get_prefs("irc_join_delay"); command("set -quiet irc_join_delay 3628800"); # 42 days! command("timer 1 set -quiet irc_join_delay $delay"); # back to earth after connection complete # identify if provided in command if ($password) { if ($account) { command("ns identify $account $password") } else { command("ns identify $password") } } # wait for response unhook $HOOK if $HOOK; # don't hook twice $HOOK = hook_server('396', sub { my ($w, $e) = @_; # this may change at some point if( $$e[4] =~ /^:is now your hidden host/ ) { # # now join command("join $channels $keys"); unhook $HOOK; undef($HOOK); # get rid of this hook } return EAT_NONE; }); } return EAT_XCHAT; # don't pass user command to server }, {help_text=>$USAGE}); __END__ 2005-06-13 b0at Updated for freenode-seven 2010-11-12 LifeIsPain #xchat @ freenode