Ticket #11098: testcase.pl

File testcase.pl, 418 bytes (added by dir123@…, 18 years ago)

Script to demo the problem

Line 
1#!/usr/bin/perl -w
2
3use strict;
4use warnings;
5
6
7sub server_hook
8{
9
10        $_[1][0] =~/^:(([^!]+)!([^@]+)@(\S+)) PRIVMSG (\S+) :(.*)$/;
11        my $nick = lc($2);
12
13        my $server = lc(Xchat::get_info('server'));
14
15        print STDERR "$_[1][0]\n";
16        print STDERR "dcc chat $nick, undef, $server\n";
17        Xchat::command("dcc chat $nick", undef, $server);
18
19}
20Xchat::register("Testscript", 1, "Testing");
21Xchat::hook_server("PRIVMSG", \&server_hook);