#!/usr/bin/perl #yooz meee my $fntd = `figlet -I2`; #this is 4linux #my $fntd = "/pip/4dos/fig/fonts"; #this is 4dos chomp ($fntd); $fntd .= "/*.flf"; my $text = "@ARGV"; my $outf = "dfaltout.txt"; my @fntz = glob("$fntd"); my $coun = 0; my $favs = " "; my $optn = ""; my $inpt = ""; print " Tigger's Figlet Chooser v0.2\n"; print "USAGE: me\@myserver:\% perl tiglet.pl \"KakA NachoZ\"\n"; print "Tiglet lets you interactively select the perfect figlet font \n"; print " for your .sig or msg or title or... =) smiley! \n"; print "Please email suggestions or constructive criticisms to pip\@binq.org\n"; print "n or Enter - checks next font, p - checks previous font\n"; print " Any specific number jumps directly to that font\n"; print "t - prompts for text change, e - prompts for filename to export to\n"; print "Y - SAVES selected text to specified exportfile and quits\n"; print "Q - QUITS without saving, ... the parameters are not case-sensitive\n"; print "Toggles: s=squish, k=kern, o=overlap, c=center, l=left, r=right, f=favorite\n"; if ($text eq "") { $text = "KakA NachoZ"; print "Please enter text to display [$text]: "; chomp ($poop = ); if ($poop ne "") { $text = $poop; } print "Please enter a file to write selected text to [$outf]: "; chomp ($poop = ); if ($poop ne "") { $outf = $poop; } } while ($inpt !~ /q|x|y|d/i && $coun < @fntz) { $fntz[$coun] =~ s!.*/!!; $kaka = `figlet -f $fntz[$coun] $optn $text`; print "${kaka}Font\#$coun:$fntz[$coun],Text:$text,Optn:$optn,Favs:$favs,cmd[npyteskocq]: "; chomp ($inpt = ); $inpt =~ tr/A-Z/a-z/; if ($inpt =~ /f/) { if ($favs =~ / $coun /) { $favs =~ s/ $coun / /; } else { $favs .= "$coun "; } } if ($inpt eq "" || $inpt =~ /n/) { $coun++; if ($coun == @fntz) { print "Last Font Displayed! Loop back to beginning? (y/n) "; $poop = ; if ($poop =~ /y/i) { $coun = 0; } } } if ($inpt =~ /p/) { $coun--; } if ($inpt =~ /\d+/) { $coun = $inpt; if ($coun < 0) { $coun = 0; } if ($coun > @fntz) { $coun = $#fntz; } } if ($inpt =~ /y/ || $inpt =~ /d/) { print "Saving to $outf and Quitting!\n"; open OUTF, ">$outf"; print OUTF $kaka; close OUTF; } if ($inpt =~ /t/) { print "New Text [$text]: "; chomp ($poop = ); if ($poop ne "") { $text = $poop; } } if ($inpt =~ /e/) { print "Export File [$outf]: "; chomp ($poop = ); if ($poop ne "") { $outf = $poop; } } if ($inpt =~ /s/ || $inpt =~ /k/ || $inpt =~ /o/ || $inpt =~ /c/ || $inpt =~ /l/ || $inpt =~ /r/) { if ($optn =~ /-$inpt /i) { $optn =~ s/(-$inpt |$inpt)//gi; } else { $optn .= "-$inpt "; } } if ($inpt =~ /q/ || $inpt =~ /x/) { print "Quitting Without Saving!\n"; } }