Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: None | Size: 0.54 KB | Hits: 44 | Expires: Never
Copy text to clipboard
  1. #!/usr/bin/perl
  2. #hello i play asciis
  3. use Xchat qw( :all );
  4. Xchat::register ("ascii player", "7.11", "", "");
  5. Xchat::hook_command ("play", \&play);
  6. use strict;
  7. use warnings;
  8. sub play {
  9.         my $request = $_[1][1];
  10.         my $filename = "Users/jakk/ascii/$request.txt";
  11.         if (open(ASCII,"<",$filename)) {
  12.                 close(ASCII);
  13.                 my @ascii = <ASCII>; #assigns the .txt to $ascii
  14.                 foreach my $asciiart (@ascii) {
  15.                         chomp $asciiart;
  16.                         Xchat::command ("say $asciiart"); #says the ascii
  17.                 }
  18.             return EAT_XCHAT;
  19.                 } else {
  20.                 return EAT_XCHAT;
  21.         }
  22. }