X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fd588,5afd95a5839b0308 X-Google-Attributes: gidfd588,public From: "Ojosh!ro" Subject: Re: Ojosh!ro, some help please... Date: 1998/10/28 Message-ID: <363730F4.AEB06860@lunatech.com>#1/1 X-Deja-AN: 405946310 Cache-Post-Path: perla.rotterdam.luna.net!nntp-user@gladiator.lunatech.com X-NNTP-Posting-Host: perla.rotterdam.luna.net [194.151.24.32] Content-Transfer-Encoding: 7bit Sender: luna4@perla.rotterdam.luna.net References: <36362AA8.DEBAFA38@erols.com> X-XS4ALL-Date: Wed, 28 Oct 1998 15:59:18 CET X-XS4ALL-User: luna4 Content-Type: text/plain; charset=us-ascii Organization: lunatech X-Cache: nntpcache 2.3.2.1 (see http://www.nntpcache.org/) Mime-Version: 1.0 Newsgroups: alt.ascii-art.animation Martin DiViaio wrote: > > I've heavly modified the perl script you posted that randomly changes > the sig on messages. Oh, that's okah =) > If you don't mind, I need a little help. What I need to know is: Is > there a way to eliminate all the white space that can appear between the > message and the credits? Yep, that is a bit of a problem... All lines defined in the 'format' will be printed. You see what I've done there. I simply didn't put anything under the quote. I'll see if I can build some fix for it. Shouldn't be too hard. The ^<< lines chop the part they can display off the original string. After a write the value of $quote is different than before. Should be some way to use that. > I have all ready tried adding the credits to the end of the quote but I > can't get the credits to appear on a line by themselves that way. Is > there a way to do that? Lemme see... Ah, I found it... Put at the end of the first long line (without a part of the image on it) ~~ this will repeat the line untill $quote is empty. Don't use the ~~ with @<< lines. A var written in an @<< field is not clipped and therefore will never get empty. This will probably drop you in a loop. around around and around untill you puke. Okay? Enjoy! > Ok, here is the modified script: > > #!/usr/bin/perl > > # Ojoshiro. > > # Inits > my $div = > "----------------------------------------------------------------------------\n"; > my $QUOTE = "~/.lazarus.quotes"; > my $FIFO = "~/.signature"; > my $CREDIT = "~/.lazarus.quotes.credits"; > my $time; > my $quote = ''; > my $credit = ''; > > # Open the quotefile once. > open ( QUOTE , "<$QUOTE" ) || die "Cannot open '$QUOTE' for reading > :$!\n"; > my $sep = $/; > $/ = $div; > # stuff the works in an array. > my @quotes = ; > close ( QUOTE ); > foreach ( $d = 0 ; $d <= $#quotes ; $d++ ) > { $quotes[ $d ] =~ s/$div//sgi; > } > open ( CREDIT , "<$CREDIT" ) || die "Cannot open '$CREDIT' for reading > :$!\n"; > my @credit = ; > close ( CREDIT ); > foreach ( $d = 0 ; $d <= $#credit ; $d++ ) > { $credit[ $d ] =~ s/$div//sgi; > } > # Every time the pipe is read, stuff it again. > while ( 1 ) { > unless ( -p $FIFO ) { > unlink $FIFO; > system ( 'mknod', $FIFO, 'p' ) && die "Cannot mknod '$FIFO': $!\n"; > } > $time = localtime(); > open ( FIFO , ">$FIFO" ) || die "Cannot open '$FIFO' for writing > :$!\n"; > my $line = int( rand ( $#quotes ) ); > $quote = $quotes[ $line ]; > $credit = $credit[ $line ]; > write FIFO; > close ( FIFO ); > sleep 1; > } > > # Mask for output. > format FIFO = > /)-._ Time : @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $time > Y. ' _] > ,.._ |`--"= ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $quote > / "-/ `.\ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $quote > /) sk | |_ `\|___ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $quote > \:::::::\___/_\__\_______\ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $quote > ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $quote > ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $quote > ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $quote > ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $quote > ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $quote > ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $quote > ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $quote > ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $credit > ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > $credit > . > > # Enjoy. > > Actually, all I did was copy the exhisting script to handle a second > file along with the first. > > -- > /)-._ Time : Tue Oct 27 14:57:13 1998 > Y. ' _] > ,.._ |`--"= It will be a great day when our schools get > / "-/ `.\ all the money they need and the Air Force > /) sk | |_ `\|___ has to hold a bake sale to buy a bomber. > \:::::::\___/_\__\_______\ -- ____ Time : Wed Oct 28 10:41:32 1998 .X+. . .Xx+-. . Be wary of strong drink. It can make you shoot at tax XXx++-.. collectors -- and miss. Lazarus Long (120) XXxx++--.. `XXXxx+++--' `XXXxxx' ""