Guest User

Untitled

a guest
Mar 13th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4.  
  5. IRC::register("hump", "1.0", "", "");
  6. IRC::add_command_handler("hump", "hump");
  7. Xchat::print("hump.pl loaded.");
  8.  
  9. sub hump {
  10. my $c;
  11. my $s = shift;
  12.  
  13. # Open the file, read the count, and print it.
  14. open MYFILE, "C:/Program Files (x86)/X-Chat 2/count.txt" or die $!;
  15. while (<MYFILE>) {
  16. chomp;
  17. $c = $_;
  18. IRC::command("/me humps $s (Count: $c)");
  19. }
  20. close (MYFILE);
  21.  
  22. # Overwrite the new count into the file.
  23. open MYFILE, ">C:/Program Files (x86)/X-Chat 2/count.txt" or die $!;
  24. $c += 1;
  25. print MYFILE "$c\n";
  26. close (MYFILE);
  27. }
Add Comment
Please, Sign In to add comment