Ticket #11098: testcase.pl
File testcase.pl, 418 bytes (added by dir123@…, 18 years ago) |
---|
Line | |
---|---|
1 | #!/usr/bin/perl -w |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | |
7 | sub 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 | } |
20 | Xchat::register("Testscript", 1, "Testing"); |
21 | Xchat::hook_server("PRIVMSG", \&server_hook); |