<>; 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) check "Edit mode" (2.0.x) or hit "Edit..." (2.4.x), (d) and put the following in your connect command (see the FAQ for info on multiple commands): CloakAndJoin password #channels,#to,#join For channels with keys, CloakAndJoin password #channels,#to,#join channel's_key,,join's_key This is the join command's syntax. Do not put spaces around the commas. 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 = '3.1', "Join channels after a Freenode cloak takes effect" ); my $COMMAND = 'CloakAndJoin'; # name of user command my $USAGE = 'Usage: $COMMAND [[#list,#of,#channels] channel,keys]'; # /help COMMAND my $PREFIX = "\cBCloak+Join\cB\t"; my $HOOK; Xchat::print "\cB$NAME $VERSION\cB by b0at (use /$COMMAND)"; hook_command($COMMAND, sub { my ($w, $e) = @_; my $password = $$w[1]; (my $args = $$e[2]) =~ s/(?<=,) //g; # ' , '->',' my ($channels, $keys) = split" ",$args,2; $_||='' for($channels, $keys); # optional if( not $password ) { Xchat::print("$PREFIX $USAGE") } else { # identify command("ns identify $password"); # wait for response unhook $HOOK if $HOOK; # don't hook twice $HOOK = hook_server('NOTICE', sub { my ($w, $e) = @_; # this may change at some point if( $$e[3] =~ /^:NickServ set your hostname to/ ) { # # 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__ 13 June 2005 b0at #xchat @ freenode 3->3.1: removed extraneous semicolon from command