home *** CD-ROM | disk | FTP | other *** search
- Program: fortune
- Programmer: George Kerber
- Written: 06/16/89 Modified: 01/07/90
- Version: 2.04c
- Compiler: Lattice 5.04
- Purpose: Output a "fortune" randomly from a "fortunes" file.
-
-
- Syntax: fortune [-l -s -# [alternate path to the "fortunes" file]]
-
- The fortune program will search ram: first, then s: for a file
- called "fortunes". If found, fortune will randomly select a
- fortune and display it centered on the screen.
-
- -s speak the fortune instead of screen output,
- if used, all other options are meaningless.
- -l the displayed fortune will not have an outline.
- -1 the outline will be white.
- -2 the outline will be black (default).
- -3 the outline will be orange.
-
- If you don't want to store the fortunes file in one of the
- default locations, you can use the command line option to
- specify a different location and/or file name.
-
- Example:
-
- fortune dh0:text/rules -- will attempt to locate the
- "dh0:text/rules" file to select
- a fortune from.
-
- fortune ? -- will display a help screen.
-
- fortune -3 -- will display an orange line before
- & after the fortune.
-
- fortune -s -- the fortune will be spoken using
- the speak: device.
-
- The "fortunes" program will attempt to randomly select a
- "fortune" from the "fortunes" file if it exists. Or the user
- can enter a fully qualified path/file name as an alternative to
- storing the "fortunes" file in one of the default directories
-
- (ram: s:) Included with this program is a "fortunes" file.
-
- INSTALLATION:
-
- Copy the "fortune" file to your "c" directory.
- Copy the "fortunes" file to your "s" directory.
-
- or execute the install script like this:
-
- 1> execute fortune.install <enter>
-
- You may want to add "fortune" to your startup sequence.
-
-
- RULES FOR "FORTUNE" FILE CONSTRUCTION
-
- 1. The first line of the file is a comment line & will never be displayed.
- 2. Fortunes can be up to 10 lines in length.
- The first line of each fortune must not have any leading blank spaces.
- Any additional fortunes lines must begin with at least on blank space.
- This is how the program "knows" that there are more lines that need
- to be displayed.
- 3. Fortunes file should be saved as an ASCII file.
- ("ed" or "memacs" is good for this.)
- 4. Each line can be up to 256 characters, but for legibility, they should
- be limited to 74 characters.
- 5. Escape options can be added to the fortunes to display color.
-
- The default escape value is a '*' following standard AmigaDOS format.
- The default value can be changed using the AmigaDOS setenv command.
- Changing the 'escape' character is optional.
-
- 1> setenv ESACPE=\ ; makes the escape value a backslash
- ; or whatever you want it to be.
- ; a backslash is recommended
- ; You should have this command in your startup
- ; sequence.
-
- The fortune help screen will always display the current escape value.
-
- These are the valid format characters:
-
- 0 Character color will be color 0 (blue)
- 1 Character color will be color 1 (white)
- 2 Character color will be color 2 (black)
- 3 Character color will be color 3 (orange)
- 4 All attributes will be reset to preferences
- 5 Bold
- 6 Underline
- 7 Italics
- ) Background color will be color 0 (shift 0)
- ! Background color will be color 1 (shift 1)
- @ Background color will be color 2 (shift 2)
- # Background color will be color 3 (shift 3)
-
- EXAMPLES
-
- # The first line of the fortunes file is always a "comment" line.
- This is line 1 of the fortunes file.
- This is *3line*4 2 of the fortunes file.
- This is line 2a of the fortunes file,
- This is line 2b of the *@*3fortunes*4 file,
- This is line 2c of the fortunes file.
- This is line 3 of the fortunes file,
- This is the *3*5*6*7second line*4 of line 3.
- This is line 4 of the fortunes file.
-
-
- Be sure to avoid leaving any blank lines anywhere in the file, including
- the last line, the fortune program may randomly select it & display a
- blank line.
-
- If an unused option is escaped, fortune will simply ingnore it. For example
- if a '*y' is found by the fortune program in the fortunes file, no error will
- be displayed, but neither will the '*' or the 'y'.
-
- SUGGESTIONS
-
- Since 'fortune' allows a different text file to be specified on the command
- line, you can have different text files for different purposes. What if
- you had a file in your s: directory names 'jokes' which contained jokes
- written in the format described above? And you had a script file called
- 'joke' which contained the line below:
-
- fortune s:jokes
-
- Then whenever you executed 'joke' you would get a joke from your 'jokes'
- file on the screen just like the fortunes file. Be sure to set the script
- bit of the script file for easier executions. You could have 'joke' and
- 'dirty-joke' and 'insult' and 'bible-quote' or whatever you wanted.
-
- fortune -s
-
- This will redirect the output of fortune to the speak: device. You must
- have the speak: device already mounted. All format characters inbedded in
- the fortunes data file will be automatically removed.
-
-
- STATUS
-
- Fortune is public domain and can be freely distributed. Please insure that
- I am kept as the author and that all documentation is intact. If someone
- doesn't like one of the fortunes, too bad, the user can delete it.....
-
-
- v1.xx 06/29/89: Initial release.
- v2.0 08/03/89: Rewrote the fortune selection process. Program now runs
- from 120 to 290% faster.
- v2.03 10/07/89: Added escape color options for the text file.
- v2.04 12/06/89: Added the speech option. Recompiled with Lattice 5.04
- v2.04c 01/07/90: Removed all global variables... PURE?
-