Guest User

Untitled

a guest
Aug 8th, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.35 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use Time::HiRes qw( usleep ualarm gettimeofday tv_interval nanosleep
  5.         clock_gettime clock_getres clock_nanosleep clock
  6.         stat );
  7. #########################
  8. #* File Name : basketball.pl
  9.  
  10. #* Purpose :
  11.  
  12. #* Creation Date : 08-08-2012
  13.  
  14. #* Last Modified :
  15.  
  16. #* Created By :  
  17.  
  18. #########################
  19.  
  20. system("google-chrome www.google.com");
  21. my $wid = `xdotool getactivewindow`;
  22. my @dims = `xwininfo -id $wid`;
  23. my $height;
  24. my $width;
  25. foreach my $line (@dims){
  26.     if($line =~ /Width/){
  27.         $width = (split(/\s+/, $line))[-1];
  28.     }
  29.     if($line =~ /Height/){
  30.         $height = (split(/\s+/, $line))[-1];
  31.     }
  32.  
  33. }
  34.  
  35. $height = $height / 3;
  36. $width = $width / 2;
  37.  
  38. system("xdotool mousemove $width $height");
  39. sleep 2;
  40. system("xdotool click 1");
  41. system("xdotool mousemove 100 100");
  42. sleep 2;
  43. my $count = 0;
  44. my $time;
  45. while(1){
  46.     $count++;
  47.     system("xdotool keydown space");
  48.     if($count == 1) { $time = 320000; }
  49.     elsif($count == 6) { $time = 400000; }
  50.     elsif($count == 7) { $time = 480000; }
  51.     elsif($count == 10) { $time = 600000; }
  52.     elsif($count == 11) { $time = 710000; }
  53.     elsif($count == 16) { $time = 740000; }
  54.     #if($count > 15){ print "$time:$count\n"}
  55.     usleep($time);
  56.     system("xdotool keyup space");
  57.     #print "$time:$count\n";
  58.     sleep 1;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment