Untitled
By: a guest | Mar 20th, 2010 | Syntax:
None | Size: 0.54 KB | Hits: 44 | Expires: Never
#!/usr/bin/perl
#hello i play asciis
use Xchat qw( :all );
Xchat::register ("ascii player", "7.11", "", "");
Xchat::hook_command ("play", \&play);
use strict;
use warnings;
sub play {
my $request = $_[1][1];
my $filename = "Users/jakk/ascii/$request.txt";
if (open(ASCII,"<",$filename)) {
close(ASCII);
my @ascii = <ASCII>; #assigns the .txt to $ascii
foreach my $asciiart (@ascii) {
chomp $asciiart;
Xchat::command ("say $asciiart"); #says the ascii
}
return EAT_XCHAT;
} else {
return EAT_XCHAT;
}
}