Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

a challenger appears

Name: Anonymous 2008-04-02 1:35

i challenge you, /prog/, to create a program that

1. takes a screenshot of the current desktop
2. exports it to a .bmp image, with a file name equal to the name of the application plus an eight digit random number.
3. compiles to less than 4.00 kb

i have achieved the above.
can you, /prog/?
are you EXPERT enough?

Name: Anonymous 2008-04-02 2:16

this is pointless, i have a perl script take my screenshots and it works well and didn't take more than a 10 minutes to write

#!/usr/bin/perl

use warnings;
use strict;
use POSIX qw(strftime);

use constant SCREENSHOTS     => 'picz/screenshots';
use constant FILEEXT        => 'png';
use constant PREFIX            => 'laptop_';
use constant SCREEN_CMD        => "import -window root -screen";

$|=1;

my $filename = PREFIX.`uname`."-".`uname -r`."-".strftime("%F", localtime(time()));
$filename =~ s/[\r\n]//g;
my $append = '';
my $c = 0;

my $fullname = SCREENSHOTS."/".$filename.".".FILEEXT;

while(-f $fullname) {
    $c++;
    $append = "-".$c;
    $fullname = SCREENSHOTS."/".$filename.$append.".".FILEEXT;
}

for(my $c=1;$c<5;$c++) {
    print("\a");
    sleep(1);
}
   
system(SCREEN_CMD." ".$fullname);

exit(0);


like people say, using import is all you need on a posix system but i have this script so it automatically saves my screenshots in order and gives me a few seconds, thought i think import can do this builtin

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List