#!/usr/bin/perl -w

use strict;
use warnings;


sub server_hook
{

	$_[1][0] =~/^:(([^!]+)!([^@]+)@(\S+)) PRIVMSG (\S+) :(.*)$/;
	my $nick = lc($2);

	my $server = lc(Xchat::get_info('server'));

	print STDERR "$_[1][0]\n";
	print STDERR "dcc chat $nick, undef, $server\n";
	Xchat::command("dcc chat $nick", undef, $server);

}
Xchat::register("Testscript", 1, "Testing");
Xchat::hook_server("PRIVMSG", \&server_hook);