home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / aacu.zip / aacu.cmd next >
OS/2 REXX Batch file  |  1995-07-22  |  3KB  |  85 lines

  1. /* REXX program to convert Fido style .MSG file attaches to Adept style.    */
  2. /* Checks for presence of BRNODES in the filename and will not kill that    */
  3. /* file attach from the BRE outbound mail dir (League Coordinator support). */
  4. /*                                                                          */
  5. /* by Jerry Jones * Enigma, A Piece of the Puzzle * 1:3602/212 *  07/22/95  */
  6. /*                                                                          */
  7.  
  8. ADDRESS CMD
  9.  
  10. /* Edit these lines to reflect your Adept outbound_mail directory and your  */
  11. /* BRE outbound packet directory. Have BRE store *.MSG files in BRE\OUTBOUND*/
  12.  
  13.   adept = 'd:\adept'
  14.   admail = 'd:\adept\mailer\outbound_mail'
  15.   bremail = directory('.\outbound')
  16.   stripchar = X2C('00')
  17.  
  18.   goto = directory(bremail)
  19.  
  20.   call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  21.       call SysLoadFuncs
  22.  
  23.      rc = SysFileTree('*.Msg',files,O)
  24.        if Files.0 == 0 then signal exit
  25.           do i = 1 to files.0
  26.               locfile = charin(files.i,73,0)
  27.                  attach1 = charin(files.i,,43)
  28.                      attach = strip(attach1,'B',stripchar)
  29.  
  30. /* If your number of directories to your BRE dir is more or less than 4 you  */
  31. /* must add or remove dir# variables as needed. (League Coordinator support) */
  32.  
  33.       parse var attach disk':\'dir1'\'dir2'\'dir3'\'dir4'\'filename'.'ext
  34.             if filename = 'BRNODES' then attach = left(attach,41)
  35.                  if filename = 'BRNODES' then Kill = ''
  36.                           else Kill = '^'
  37.  
  38.         locaddr = charin(files.i,197,0)
  39.              fidoaddr = charin(files.i,,12)
  40.                 adeptaddr = translate(fidoaddr,'..',':/')
  41.                    address = word(adeptaddr,1)
  42.  
  43. /* Insert 'if net = #### the network = netname' statements as needed.        */
  44.  
  45.       parse var address zone'.'net'.'node
  46.  
  47.                 if net = 10 then network = Fidonet
  48.  
  49.                 if net = 3602 then network = Fidonet
  50.  
  51.                 if net = 100 then network = VLinkNet
  52.  
  53. /* Insert 'if node    = #.####.#### then packet = H' to make hold packets.   */
  54.  
  55.    packet =  C
  56.  
  57.         if address = 1.10.110 then packet = H
  58.  
  59.         if address = 1.3602.1776 then packet = H
  60.  
  61.         if address = 44.100.4 then packet = H
  62.  
  63.         if address = 44.100.9 then packet = H
  64.  
  65. /* Ensure that the 'else packet = C' statement is the first line in this     */
  66. /* section. This will send all packets not held as crash mail.               */
  67.  
  68. /* This section actually creates the Adept file attach files.                */
  69.  
  70.       if attach <> ''
  71.             then do
  72.  
  73.             adout = lineout(admail'\'packet'.'address'.0.'network,kill''attach)
  74.                  say 'Created 'admail'\'packet'.'address'.0.'network''
  75.                      inclose = lineout(files.i)
  76.                          say 'Deleting 'files.i
  77.                              del files.i
  78.         end
  79.  
  80.   end
  81.  
  82. exit:
  83.   goto1 = directory(adept)
  84.   return
  85.