         More Batch Magic from the Sysop of the Stalag 13 BBS!

  A new utility for TriBBS Sysops just came out, 09/94, called TRIRBS. This
  small utility will take the TBBBSES.TXT and accompanying FILE_ID.DIZ file
  found in the TBBBSES.ZIP file available on the LOBSTER BUOY BBS run by
  Mark Goodwin. TRIRBS.EXE v. 1.0 is a new freeware utility that will read
  the data found in the TBBBSES.TXT file and the FILE_ID.DIZ file and make
  a `@X' encoded logon, goodbye, or bulletin screen for your TriBBS board.

  To keep my new bulletin updated (you can make it a logon, etc. if you so
  choose, of course) automatically, I decided to make it "automatic" by 
  means of some batch files called by my nightly maintenance batch file.
  I only run one node so the setup for me was easy.

  1. Create a \TRIRBS directory.
  
  2. Place TRIRBS.EXE and TRIRBS.INI file in it.

  3. Read the TRIRBS.DOC file and make your changes to the TRIRBS.INI.

  4. Create a batch file called RUNIT.BAT. The only command in this new
     batch file is the command "TRIBRS". Put RUNIT in \TRIRBS.

  5. Return to your \TRIBBS directory that will call the maintenance batch
     file each night.

  6. Create a new batch file called TRIRBS.BAT in that \TRIBBS directory.

     Sample TRIRBS.BAT file:

                            cd \trirbs         <- Change to TRIRBS dir.
                            call get tbbbses   <- See text below & step 7.
                            call runit
                            erase *.diz        <- Do I need to explain?
                            erase *.txt        <- Ditto
                            cd \tribbs         <- Return to node dir.

    **NOTE** Be sure to use the "CALL" command when calling another batch
             file from inside another batch file. If the "called" batch 
             file fails due to an error it will return to the original
             batch file and complete execution. If you don't use "CALL" an
             error in the "called" batch file will crash you to DOS and
             hang your board in DOS.

   
  7. Create a new batch file called GET.BAT. Put it in a directory in your
     DOS path statement. (I put all my goodies in my C:\UTIL directory, 
     which is part of my DOS path statement in the AUTOEXEC.BAT.)

     Sample GET.BAT file:

                           pkunzip c:\uploads\%1.zip   <- See text below.


     You should also put PKUNZIP.EXE in a directory in your DOS path 
     statement as well. This allows you to call it from any place on your
     hard drive or even a second drive without having to have PKUNZIP.EXe
     physically present in the present directory you are logged in to.

     `%1' is a batch file "variable". I use GET.BAT for manual maintenance
     on my board for checking out all the new ZIP uploads. I got tired of
     typing "PKUNZIP c:\uploads\filename.zip" all the time. Now all I do
     go to my work directory, and type "GET FILENAME" (note do not use the
     .ZIP extension.) This will unzip the "FILENAME.ZIP" file in my 
     \UPLOAD directory to my work directory automatically. The `%1' variable
     captures the "switch" after the "GET" batch filename. In this example,
     the "switch" is "FILENAME" (as in GET FILENAME.) The ".ZIP" is appended
     automatically by the batch file.

  8. Now you must edit your maintenance batch file run each night by your
     board. Each maintenance batch file ends with the "BOARD" command. Put
     the following lines in your maintenance batch file ahead of that
     "BOARD" command. 

     You must add the following lines to your maintenance batch file:

                    if not exist c:\upload\tbbbses.zip goto notthere
                    if exist c:\upload\tbbbese.zip goto trirbs
                    :trirbs
                    call trirbs
                    goto notthere
                    :notthere
                     (rest of batch file here)
                    board

     If you are new to batch files, let me explain, if not skip ahead to 
     step 9. See sample MAINT2.BAT below.

     "if not exist" tells DOS to check for the existence of a file and to
     go to a batch file "label" called NOTTHERE if the file is not found
     (doesn't exist.) The target file being TBBBSES.ZIP in this case.

     "if exist" tells DOS to check for the existence of a file and to go
     to a batch file "lable" called TRIRBS if the target file is found
     (it exists.) The target file being TBBBSES.ZIP in this case.
     
     "C:\UPLOAD\TBBBSES.ZIP" is the drive, path, and filename of the target
     file.

     A batch file "label" is a word preceeded by a colon (:). This allows
     the batch file to branch to a command internally and carry out more
     than one set of instructions depending on the "if not exist" or "if
     exist" command results.

     If the TBBBSES file is NOT (not exist) found in the C:\UPLOAD directory 
     the batch file branches to the ":notthere" label and carries out the
     batch commands below this label, which in this case is the rest of your
     maintenance batch file.

     If the TBBBSES file is found (it exists) in the C:\UPLOAD directory
     the batch file branches to the ":trirbs" lable and carries out the 
     batch commands below this label instead, which in this case is the
     "CALL" to the TRIRBS.BAT file, which runs the TRIRBS.EXE program, 
     then returns control back to the TRIRBS.BAT file that passes control
     back to the maintenance batch file.

     Once the maintenance batch file has control of the operations again
     the "goto notthere" command is sent. This is a bit safer than just 
     letting the batch file "crash" through to the ":notthere" label on
     its own. Trust me. 

     The next line is the ":notthere" label. The rest of your normal 
     maintenance batch file should be placed here ending with the "BOARD"
     command on the last line. This will run your other maintenance 
     routines and return you to the call waiting screen when it is done.

     Here is a sample portion of my own MAINT2.BAT file run each midnight
     on my board Stalag 13.

     Sample MAINT2.BAT:

        d:
        cd d:\tribbs
        if exist activity.001 del activity.001
        if exist d:\bcrc\badfile.crc del d:\bcrc\badfile.crc
        if exist d:\bcrc\badbyet.crc del d:\bcrc\badbyte.crc
        if exist d:\bcrc\crc.err del d:\bcrc\crc.err
        if exist d:\bcrc\dupes.c del d:\bcrc\dupes.c
        if exist d:\bcrc\dupes.d del d:\bcrc\dupes.d
        if not exist c:\upld\tbbbses.zip goto notthere
        if exist c:\upld\tbbbses.zip goto trirbs

        :trirbs
        call trirbs
        goto notthere

        :notthere
        hostage
        cd d:\tribbs\display
        copy goodbye.ans + bye1.bbs goodbye.ans
        copy cls1.bbs + goodbye.bbs goodbye1.bbs
        copy goodbye1.bbs + bye1.bbs goodbye.bbs
        erase goodbye1.bbs
        cd \tribbs
        call retensio
        board

  9. Now when your nightly maintenance is run and a new TBBBSES.ZIP file
     has been added to your \UPLOADS directory it will be automatically
     unzipped into your \TRIBBS\TRIRBS dirctory, processed by TRIRBS.EXE
     making your updated logon, bulletin, or goodbye screen depending on
     your setup in the TRIRBS.INI file, erase the TBBBSES.TXT and the
     FILE_ID.DIZ files before returning to do maintenance on the rest of 
     your board.

     If the TBBBSES.ZIP file doesn't exist in your upload directory the
     TRIRBS.BAT file is not run and the routines are skipped while the
     rest of your maintenance batch file is carried out just like always.

  Author's Note
  -------------
  I hope my explanations are clear and easy to follow for you. Take it
  slowly and do it step by step. You will have to change the batch files
  for the correct drives and directories you actually use on your own
  board. If you get it right your screens will be autmatically updated
  whenever a new TBBBSES.ZIP file is added to your upload directory!

                                                Keith Heitmann
                                                Stalag 13 BBS, Sysop
                                                TriBBS #719
                                                (219) 763-0826
                                                1 Node, 2400-14.4K v.42bis
                                                Trimail QWK Door
                                                (No Fido as yet...)
