home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / CJBNIT.CMD < prev    next >
OS/2 REXX Batch file  |  1992-01-10  |  6KB  |  169 lines

  1. /* Nitewing BBS Frontdoor 2.02  (for OS/2 PMCOMM 1.09)              */
  2. /*  Using either RAMAIL or MKQWK                                    */
  3. /*  12/7/91        Chuck Brazie RD3 Box 226 Newark Valley, NY 13811 */
  4.  
  5. Signal ON SYNTAX NAME SYNTAX_ERROR
  6. TRACE O
  7. Parse arg port portname screen_handle dde_output dde_input semaphore
  8. Parse source . . fn .
  9.  
  10. Call RxFuncAdd "init_dll","RxPmcomm","init_dll"
  11. Call init_dll
  12. cr   = '0d'x
  13. crlf = '0a0d'x
  14. esc  = '1B'x
  15. Call read_timeout "20000",port
  16. /*********************************************************************/
  17. /* Set up the download and upload paths for the mail packets         */
  18. /*********************************************************************/
  19. DownloadPacketDir = "C:\SLMR\READ"
  20. UploadPacket = "C:\SLMR\REPLY\NITEWING.REP"
  21. DownloadPacket = "C:\SLMR\READ\NITEWING.QWK"
  22. MailDoor = 'M' /* R=RAMail M=MKQwk */
  23.  
  24. /*Call wait_fore "twice for NiteWing",port,screen_handle*/
  25. Call put_s esc||esc,port
  26. Call put_s 'Escape Escape was entered...',screen_handle
  27. Call wait_fore "Last Name:","Full Name",port,screen_handle
  28. Call put_s "xxxxxxxxxxxx"||cr,port
  29. Call wait_fore "Password: ",port,screen_handle
  30. Call put_s "xxxxxxxxxxxxx"||cr,port
  31. Call wait_fore "to Continue",port,screen_handle
  32. Call put_s cr,port
  33. ContinueFlag = 1
  34. /**********************************************************************/
  35. /* Skip by the logo, quickflash, and message scan.                    */
  36. /**********************************************************************/
  37. Do Forever
  38.   Call Wait_fore 'new files',,              /* 1 */
  39.                  'Continue [Y/n/=]?',,      /* 2 */
  40.                  'Press [Enter] ',,         /* 3 */
  41.                  'TOP Command',,            /* 4 */
  42.                  'read this mail now',,     /* 5 */
  43.                  'Check for waiting mail',, /* 6 */
  44.                  'More(Y/n/=)',,            /* 7 */
  45.                  'Press (Enter)',,          /* 8 */
  46.                  'Press [Return]',,         /* 9 */
  47.                  'QuickFlash',,             /* 10 */
  48.        port,screen_handle
  49.  
  50.   match = result
  51.   Select
  52.     When (match=1 | match=5 | match=6) then Call Put_s 'n',port
  53.     When (match=2) then Call Put_s 'y',port
  54.     When (match=7 & (ContinueFLag = 1)) then Call Put_s 'y',port
  55.     When (match=7 & (ContinueFLag = 0)) then Call Put_s 'n',port
  56.     When (match=3 | match=8 | match=9) then Call Put_s cr,port
  57.     When (match=10) then ContinueFlag = 0
  58.     When match=4 then leave
  59.     Otherwise nop
  60.   End/* select */
  61. End/* do forever*/
  62. /**********************************************************************/
  63. /* Go to the express mail area.                                       */
  64. /**********************************************************************/
  65. Call Put_s 'M',port    /* message area */
  66. Call wait_fore "Select",port,screen_handle
  67. Call Put_s 'X',port    /* express mail */
  68. Call wait_fore "Select",port,screen_handle
  69. IF MailDoor = 'R' THEN
  70. DO /*RaMail */
  71.   Call Put_s 'R',port   /* Ramail   System */
  72.   Call wait_fore "press any key",port,screen_handle
  73.   Call Put_s cr,port
  74.   Call wait_fore "uit to BBS",port,screen_handle
  75. END /* Ramail */
  76. ELSE
  77. DO  /* MKQwk  */
  78.   Call Put_s 'M',port   /* MKQwk    System */
  79.   Call wait_fore "uit to Bbs",port,screen_handle
  80. END /* MKQwk  */
  81. /**********************************************************************/
  82. /* If we have a reply to upload, do it now.                           */
  83. /**********************************************************************/
  84. replyfile = stream(UploadPacket,'c','query exists')
  85. If Replyfile <> '' THEN
  86. DO
  87.   Call Put_s 'U',port   /* Upload packet */
  88.  
  89.   IF MailDoor = 'R' THEN /* RaMail system */
  90.    Call wait_fore "Start your upload NOW!",port,screen_handle
  91.   ELSE
  92.    Call wait_fore "Ready to receive:",port,screen_handle
  93.  
  94.   Call zmodem_send UploadPacket,dde_output,dde_input
  95.   IF (result <> 0) THEN
  96.   DO /* upload successful */
  97.     '@ERASE 'UploadPacket
  98.   END
  99.   IF MailDoor = 'R' THEN /* RaMail */
  100.   DO
  101.     Call wait_fore "press any key",port,screen_handle
  102.     Call Put_s cr,port
  103.     Call wait_fore "uit to BBS",port,screen_handle
  104.   END
  105.   ELSE /* MKQwk */
  106.     Call wait_fore "uit to Bbs",port,screen_handle
  107. END /* there was data to send */
  108. /**********************************************************************/
  109. /* Download any mail.                                                 */
  110. /**********************************************************************/
  111. Call Put_s 'D',port   /* Download packet */
  112. IF MailDoor = 'R' THEN /* RaMail */
  113. DO
  114.   Call wait_fore "oodbye after Transfer",,
  115.                  "Press any key",, /* no Mail to send */
  116.                  port,screen_handle
  117. END /* RaMail */
  118. ELSE
  119. DO /* MKQwk */
  120.   Call wait_fore "oodbye after transfer",port,screen_handle
  121.   Call Put_s 'Y',port
  122.   Call wait_fore "Packing",,
  123.                  "No Messages Found To Send",,
  124.                  port,screen_handle
  125. END /* MKQwk  */
  126. IF (result = 1) THEN /* mail to download and goodbye after */
  127. DO
  128.   IF MailDoor = 'R' THEN /* RaMail */
  129.   DO
  130.     Call Put_s 'G',port
  131.     Call wait_fore "Start your download NOW!",,
  132.                    port,screen_handle
  133.   END /* RaMail */
  134.   ELSE
  135.   DO /* MKQwk */
  136.     Call wait_fore "Ready to send:",,
  137.                    port,screen_handle
  138.   END /* MKQwk */
  139.   IF (result = 1) THEN
  140.   DO
  141.     '@ERASE 'DownloadPacket
  142.     Call Set_download_path DownloadPacketDir,dde_output
  143.     Call zmodem_receive dde_output,dde_input
  144.   END
  145. END/* mail to download */
  146. ELSE /* no mail */
  147. IF ((result=2) & (MailDoor = 'R')) THEN
  148. DO /* RaMail */
  149.   Call Put_s cr,port /* no mail today */
  150.   Call wait_fore "uit to BBS",,
  151.                  port,screen_handle
  152.   Call Put_s 'G',port /* Goodbye     */
  153. END /* RaMail */
  154.  
  155. Call beep 350,100
  156. Call beep 150,100
  157. Call beep 350,100
  158. RETURN
  159.  
  160. /* Standard handler for SIGNAL on ERROR, will help in the debuging */
  161. syntax_error:
  162. fp = filespec("path",fn)
  163. fd = filespec("drive",fn)
  164. errormsg = 'REXX error' rc 'in line' sigl':' errortext(rc)
  165. errorfile = fd||fp||"SCRIPT.ERR"
  166. rc = lineout(errorfile,date() time() fn '-' errormsg)
  167. rc = lineout(errorfile,date() time() fn '-' sourceline(sigl))
  168. Exit
  169.