                             Mys Tic File Announce 
                                   Ver 1.1i

								 
Black Panther(RCS)
aka Dan Richter
Sysop - Castle Rock BBS
telnet://castlerockbbs.com
The sparrows are flying again...


                             -=-= Description =-=-

Mys Tic File Announce is a very simple TIC file announcement generator. Other 
programs that create new file announcements require a lengthy config program
which require all file echos and BBS file areas to be set up. This program will 
take all the information from the TIC files, and generate a report that can be 
posted in message bases.

While this program was written for use with Mystic BBS, running under 
DOS/Windows or Linux, it can be used with any BBS software. Again, there is no 
interaction between the BBS software and this program. It is completely 
independent of the BBS.


                       -=-= Warranties and Guarantees =-=-

While every effort is made to make sure this program does what it is designed
to, and not harm your computer, the only warranty you have, is this program 
will take up space on your hard drive. Other than that, I assume no 
reponsibility for what happens to your computer due to the use of this 
software. 

If you do notice a bug in the program, or have a suggestion on how it could
be improved, please feel free to let me know.

                               -=-= Files =-=-
							   
mtafile(.exe) -  The main program
mtafile.txt   -  The file your reading right now :)
mtafile.rpt   -  File created by the program in Mystic directory		
final.txt     -  File created by the program in Mystic directory
mtafile.log   -  File created in Mystic Logs directory				   

                         -=-= General Installation =-=-

The EXE file should be placed in your \mystic directory. It will create a log
file that will be placed in the typical \mystic\logs directory, called 
mtafile.log. This log contains, when the program was run, the command line
parameters, which files were announced, and from which file echo area.

MTAFile creates a file in the \mystic directory called mtafile.rpt. This file
can have a header and/or footer file attached to it, before being posted to 
the message echos. (Instructions will be shown below)

MTAFile now will combine a header and footer to the output file, if they exist
in the main Mystic directory. Just name the header as 'header.txt' and the 
footer file as 'footer.txt'. MTAFile will combine then to create the 
'final.txt' output file. The 'mtafile.rpt' is still created, and will also
be in the Mystic directory, if you would like to continue to use it. Both
of these files will be rewritten when MTAFile is run the next time.

This program can be run with two different setups. It can be called whenever
new files are received, for those Sysops who post multiple new file 
announcements per day. 

*Keep in mind, the mtafile.rpt is overwritten each time the program in run.*

The other way to set this up, is to copy the TIC files into an announcement 
sub-directory. Then, when the nightly maintenance is run, this program will 
process all of the TICs received, and generate one file announcement per day.
I will give examples below of how I have this set up at Castle Rock BBS.

The program takes two command line parameters. The first, is the complete path
to where the TIC files are located. The second parameter is the name of your
BBS. For example:

mtafile.exe c:\bbs\mystic\echomail\in\announce\ Castle Rock BBS
or
./MTAFile /home/bbs/mystic/echomail/in/announce/ Castle Rock BBS

Here is a sample of my mailin.bat file that runs whenever incoming mail/files
are received:

                          -=-= Windows Install =-=-

c:
cd \bbs\mystic\

:start
if exist c:\bbs\mystic\echomail\in\*.tic goto file
goto in

:file
cd \bbs\mystic\echomail\in\
copy *.tic \bbs\mystic\echomail\in\announce\ /y
cd \bbs\mystic\
mutil fileimport
goto in

:in
cd \bbs\mystic\
mutil mailin.ini
goto end

:end
cd \bbs\mystic\

(In case your wondering, this is only a portion of the complete batch file 
used at Castle Rock BBS. The actual file is about three times as long, but 
this should give you the idea)

Then, in your nightly maintenance, you would include something like the 
following:

c:
cd \bbs\mystic\

del mtafile.rpt
del final.txt
mtafile c:\bbs\mystic\echomail\in\announce\ Castle Rock BBS
*optional(if exist mtafile.rpt copy header.txt+mtafile.rpt final.txt)*

cd \bbs\mystic\
mutil fileannounce1.ini

The 'del mtafile.rpt' and 'del final.txt' lines will ensure that old postings 
do not get posted again. These files will be generated on the 'mtafile' line 
which follows. The program should now delete old copies of mtafile.rpt, but I
would still leave this in, just to be safe. :)

The 'if exist' line, takes the report, adds a text header file to the top of 
it, and creates the file 'final.txt'. It is this file that is posted into the
message areas. (Take a look at recent new files postings made from Castle Rock
BBS, and you will see where the header.txt file and the mtafile.rpt file 
start) The reason for the 'if exist' on this command line, is to keep from
creating a blank report, if no files have been received.

Also, if you wish to add a footer to the end of the final.txt, you could 
change the command line to read:

if exist mtafile.rpt copy header.txt+mtafile.rpt+footer.txt final.txt

                            -=-= Linux Install =-=-

Following is a sample of my mailin.sh script file that processes incoming
mail/files.

#!/bin/bash
cd /home/dan/mystic/echomail/in
if ls /home/dan/mystic/echomail/in/*.tic;
then 
cp *.tic /home/dan/mystic/echomail/in/announce 
fi

if ls /home/dan/mystic/echomail/in/*.TIC;
then 
cp *.TIC /home/dan/mystic/echomail/in/announce
fi

cd /home/dan/mystic 
./mutil mailin.ini

In the nightly events, I have this running...

#!/bin/bash
cd /home/dan/mystic/
rm mtafile.rpt
rm final.txt
./MTAFile /home/dan/mystic/echomail/in/announce/ Castle Rock BBS
*optional(if [ -f mtafile.rpt ]
then cat header.txt mtafile.rpt > final.txt
fi)


                              -=-= Credits =-=-

I would like to give sincere thanks to the following people
(in no particular order):

g00r00    -  for making, and maintaning an awesome BBS package
Avon      -  for having an great network which provides great support
             and for testing this program during pre-release
GaryCrunk -  for answering some rookie pascal questions
Apam      -  for showing us all that BBS programming is still alive
fsxNet    -  for putting up with my stupid questions and test posts
Cmech     -  for making great looking programs look easy to do :)
Gryphon   -  for porting some awesome games into MPL which got me 
             interested in learning Pascal again
xqtr      -  for making some great MPLs - even if most of them won't work 
             on Windows :)
fabian    -  for helping me figure out better functions to use
tiny      -  for giving me his string compare functions to use			 

I know I'm forgetting people here. It is not intentional. :)


                            -=-= Change Log =-=-
							
1.00a -=> First pre-release
1.00b -=> Output modifications
1.00c -=> Changed code to not create empty .RPT file if no TICs are present
1.00d -=> Fixed bug created in 1.0c of not placing report file in correct 
          directory
1.00e -=> Adjusted output to utilize more of the screen. Added code to ensure
          report file would end up in correct directory
1.00f -=> Fixed many bugs - main bug was not deleting the old report before 
          creating new one.
1.01a -=> Cleaned up code - Made sure it was ready for public release
1.01b -=> Major Bug fix - Program could go into infinate loop 
          Corrected typos in this text file
1.01c -=> Bug fix (damn typos)... :)
1.01d -=> Minor bug fixes - Added date/time of report generation
1.01e -=> Optimized code
1.01f -=> Fixed small bugs of not pulling origin or area desctiption fields
1.01g -=> Added help for when program is run without command line parameters
          or if run with 'mtafile ?' - Implemented accomodation for incorrect
          formatting of TIC files. MTAFile will now read multiple 'Desc'
          lines in the TIC file. 
1.01h -=> Minor bug fixes - Removed writing Desc line when LDesc line exists
          Ported code to create Linux version. Both versions will continue
          to be supported.
1.01i -=> Changed date output in both log file and report to make it more
          human-readable. Modified code to handle .TIC and .tic files in the
          Linux version. Added commas into the file size fields to make it 
          more readable. Changed array size to accomodate longer descriptions.
          Added a few cosmetic changes to output. Added the Magic Name to
          output file. Added the TIC file name to the log file to aid with
          debugging. If TIC file does not contain the AreaDesc field, it will
          now display the Area name in output file. Added functionality to 
          combine 'header.txt' and 'footer.txt' files to the output file. 
          This will eliminate the need for doing this in a script file.

