Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- use Time::HiRes qw( usleep ualarm gettimeofday tv_interval nanosleep
- clock_gettime clock_getres clock_nanosleep clock
- stat );
- #########################
- #* File Name : basketball.pl
- #* Purpose :
- #* Creation Date : 08-08-2012
- #* Last Modified :
- #* Created By :
- #########################
- system("google-chrome www.google.com");
- my $wid = `xdotool getactivewindow`;
- my @dims = `xwininfo -id $wid`;
- my $height;
- my $width;
- foreach my $line (@dims){
- if($line =~ /Width/){
- $width = (split(/\s+/, $line))[-1];
- }
- if($line =~ /Height/){
- $height = (split(/\s+/, $line))[-1];
- }
- }
- $height = $height / 3;
- $width = $width / 2;
- system("xdotool mousemove $width $height");
- sleep 2;
- system("xdotool click 1");
- system("xdotool mousemove 100 100");
- sleep 2;
- my $count = 0;
- my $time;
- while(1){
- $count++;
- system("xdotool keydown space");
- if($count == 1) { $time = 320000; }
- elsif($count == 6) { $time = 400000; }
- elsif($count == 7) { $time = 480000; }
- elsif($count == 10) { $time = 600000; }
- elsif($count == 11) { $time = 710000; }
- elsif($count == 16) { $time = 740000; }
- #if($count > 15){ print "$time:$count\n"}
- usleep($time);
- system("xdotool keyup space");
- #print "$time:$count\n";
- sleep 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment