home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / mkarea10.zip / makearea.doc < prev    next >
Text File  |  1995-06-10  |  8KB  |  205 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                          MakeArea.Cmd
  7.                        OS/2 REXX Script
  8.  
  9.              to automate adding new echomail areas
  10.                      to Squish and Maximus
  11.  
  12.                 Copyright 1995, Herman Freeman
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24. MakeArea.Cmd is a REXX script intended to automate the addition
  25. of new echomail areas to a Maximus/Squish based BBS.  It
  26. automatically scans the Bad Messages area maintained by Squish,
  27. creating new Echoarea entries in both Squish.Cfg and MsgArea.Ctl
  28. files based on information found in the Elist.Dat file (produced
  29. and copyrighted by Michael Fuchs).
  30.  
  31. I created MakeArea.Cmd because Fidonet is constantly adding new
  32. echo areas to the backbone, and messages for these new areas
  33. were piling up in my bad message area until I got busy and
  34. edited them into the Squish.Cfg and MsgArea.Ctl files, ran Silt,
  35. and corrected the usual mess of errors in my text-work.
  36. MakeArea.Cmd can be used in a normal batch process to completely
  37. automate the detection and creation of new echo areas in a very
  38. consistent way.  Since MakeArea returns an errorlevel of 0 if no
  39. new areas are created, or 1 if new areas are created, the
  40. errorlevel exit can be used to control the batch process.
  41.  
  42. INVENTORY:
  43.  
  44. this archive contains the following files:
  45.  
  46.     MAKEAREA.CMD        - the actual script file
  47.     MAKEAREA.CFG        - the sample control file
  48.     MAKEAREA.DOC        - this document
  49.     MECCA.PRE        - Mecca command prefix file sample 
  50.  
  51. other files may also be included, but these files are required.
  52.  
  53.  
  54. FUNCTION:
  55.  
  56. MakeArea.Cmd, using info you provide in the Makearea.Cfg file,
  57. scans the Bad Messages directory where Squish tosses Echomail
  58. messages if the echo tag is not set up.  If MakeArea finds *.msg
  59. files in this directory, the messages are parsed to extract the
  60. echo tags and the uplink address.  The uplink address is assumed
  61. to be the LAST entry in the PATH: kludge of the message.
  62.  
  63. Having now extracted the echo tags and addresses, MakeArea
  64. reads the file ELAREA.DAT, a comma-delimited text database
  65. created by Michael Fuchs and updated monthly.  This useful file
  66. contains lots of useful info about all E-Listed echo areas.  If
  67. an entry is found in the ELAREA.DAT file which matches a tag
  68. found in a bad message, an entry is written to SQUISH.CFG and
  69. MSGAREA.CTL to create the area. 
  70.  
  71. MakeArea uses the Key field from the ELAREA.DAT file for several
  72. purposes: 
  73.     
  74.     To build the path to the files in Squish.Cfg
  75.     To name the Area in Maximus
  76.     to name the description files
  77.  
  78. MakeArea uses the Title field from ELAREA.DAT to construct the
  79. MsgInfo line in the MSGAREA.CTL entry.
  80.  
  81. MakeArea uses the Description field from ELAREA.DAT to construct
  82. a mecca-formatted description file which can be display to the user.
  83.  
  84. The database entry for the area also determines whether the area
  85. is set as Read-Only and determines the user-priviledge level
  86. required to access the area.  If the Description field contains
  87. the phrase 'Read-Only' then the area is made read-only.  If the
  88. FlagSysopOnly field is set to 'Y' then the user-priv level for
  89. the area is set to the value defined by the 'SysopUserPriv'
  90. keyword in the MakeArea.Cfg file.
  91.  
  92.  
  93.  
  94. CONFIGURATION:
  95.  
  96. MakeArea is configured using an external configuration file.
  97. The default for the configuration file is to search for
  98. 'MakeArea.Cfg' in the logged directory.  You can overide the
  99. default by specifying a different file as the first parameter on
  100. the command line.  The name of an alternate configuration file
  101. is the only command-line parameter used by MakeArea.  Alternate
  102. configuration files allows you to process different Mail paths,
  103. mecca suffix/prefixes, and so forth.  You may not need this, but
  104. if you get adventurous, there it is.
  105.  
  106. If no configuration file is found in the logged directory, and
  107. none is passed to MakeArea as a command-line parameter, MakeArea
  108. will run using the internal defaults.  Don't, however, expect much.
  109.  
  110. The sample MakeArea.Cfg file includes examples of each
  111. configuration keyword used by MA, an example of its use, and and
  112. explanation of its purpose.  The sample file is self-documented.
  113. Entries in the file are case-insensitive.
  114.  
  115. I suggest that you run MakeArea a few times with the SquishCfgFile
  116. and the MsgAreaCtlFile keywords remarked out so you can see what
  117. will happen before you point it at your real Squish.Cfg and
  118. MsgArea.Ctl files.
  119.  
  120. the following skeleton for a batch .cmd file suggests how to set
  121. up MakeArea.Cmd:
  122.  
  123.   Sq386p In Out Squash Link        'Normal Squish processing'
  124.   .
  125.   call MakeArea.Cmd            'auto-add new areas'
  126.   if errorlevel=0 goto Skip        'no new areas: quit'
  127.   .
  128.   Sq386p In Link            'toss new areas'
  129.   .
  130.   Siltp Max -u                'Silt in new areas'
  131.   .
  132.   :Skip                    'go here when done'
  133.   .
  134.   and so on....
  135.  
  136.  
  137. DESCRIPTION FILES:
  138.  
  139. MakeArea can write out the long description of an area it
  140. creates as a formatted, word-wrapped mecca-displayable <.BBS>
  141. file.  I did this so that my bbs can display a detailed
  142. description of echo areas to users on demand.  The files pointed
  143. to by the 'MeccaPrefixFile' and 'MeccaSuffixFile' keywords in
  144. the configuration file are prepended and appended to the
  145. description file as-is when the description file is written.
  146. These prefix and suffixes allow you to set colors, set or test
  147. keys, display headers, or anything else allowed by mecca.  My
  148. sample Quits (doesn't display) the description file if the user
  149. doesn't have the 'D' key set, and sets the display color to
  150. magenta. This allows a menu function which toggles display of
  151. the description file. Neither the prefix or suffix files are
  152. required, and default to NUL:. 
  153.  
  154.  
  155. KNOWN PROBLEMS:
  156.  
  157. MakeArea will build a new area from information contained in the
  158. FIRST matching entry in the ELAREA.DAT file.  Sometimes, there
  159. is more than one entry with the same echo tag in the ELAREA.DAT
  160. file.  This isn't a problem here, but your mileage may vary.
  161.  
  162. MakeArea will happily create duplicate entries in both your
  163. Squish.Cfg file and your MsgArea.Ctl file if you fail to run
  164. Squish between executions of MakeArea.  You should run Squish
  165. after running MakeArea, if the exit errorlevel is not 0.
  166.  
  167.  
  168.  
  169. REGISTRATION:
  170.  
  171. MakeArea is freeware, but not Public Domain.  You may use
  172. MakeArea as you wish, and change it if you wish, so long as you
  173. acknowledge the original copyright in your modified version. 
  174. If you find MakeArea useful, I ask that you send a netmail
  175. message to me at the following address:
  176.  
  177.     1:308/90 Fidonet
  178.     Herman Freeman
  179.  
  180. If you have suggestions, or find serious flaws in the operation
  181. of MA, feel free to netmail suggestions to the same Fidonet
  182. address.  I don't promise to fix anything, but if I can see a
  183. solution, I'll try, and if you have an interesting suggestion,
  184. I'll try to implement it. 
  185.  
  186.  
  187. ACKNOWLEDGEMENTS:
  188.  
  189. Scott Dudley is the creator and copyrighter of Maximus, Squish,
  190. and Mecca. Thanks, Scott, for a very flexible and trouble-free
  191. product. 
  192.  
  193. REXX and OS/2 are copyright IBM corp.  Thank them, too.  OS/2 is
  194. neat. 
  195.  
  196. CAVEAT:
  197.  
  198. MakeArea.Cmd is my first attempt to do anything useful with
  199. Rexx.  It is very different than any other language I've used,
  200. as it is 'Word/Text' oriented.  While I <Think> I came up with
  201. good solutions to various programming problems, I'm sure there
  202. are many plainly hideous ideas in MakeArea.Cmd, and I'm equally
  203. sure that I've made some assumptions about the files parsed by
  204. MakeArea that I'll regret, probably tomorrow.
  205.