Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- IRC::register("hump", "1.0", "", "");
- IRC::add_command_handler("hump", "hump");
- Xchat::print("hump.pl loaded.");
- sub hump {
- my $c;
- my $s = shift;
- # Open the file, read the count, and print it.
- open MYFILE, "C:/Program Files (x86)/X-Chat 2/count.txt" or die $!;
- while (<MYFILE>) {
- chomp;
- $c = $_;
- IRC::command("/me humps $s (Count: $c)");
- }
- close (MYFILE);
- # Overwrite the new count into the file.
- open MYFILE, ">C:/Program Files (x86)/X-Chat 2/count.txt" or die $!;
- $c += 1;
- print MYFILE "$c\n";
- close (MYFILE);
- }
Add Comment
Please, Sign In to add comment