home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / pmcom233.zip / CSERVE.CMD < prev    next >
OS/2 REXX Batch file  |  1996-01-02  |  3KB  |  81 lines

  1. /* Pmcomm REXX Script to log on to CompuServe and capture new messages   */
  2. /* from selected areas in the IBM OS/2 and IBM Com forums.  Make changes */
  3. /* for your user id and password. These changes need to be made on line  */
  4. /* 26 line 28. */
  5.  
  6. Signal ON SYNTAX NAME SYNTAX_ERROR
  7.  
  8. Parse arg port portname screen_handle dde_output dde_input semaphore
  9. Parse source . . fn .
  10.  
  11. Expose_list = 'cr port screen_handle dde_output dde_input'
  12.  
  13. /* This function registers the init_dll function with REXX. The */
  14. /* init_dll function will register the rest of the functions in */
  15. /* the rxpmcomm.dll. */
  16. Call RxFuncAdd "init_dll","RxPmcomm","init_dll"
  17.  
  18. /* Required before any other rxpmcomm.dll functions are called. */
  19. Call init_dll
  20. cr   = '0d'x
  21. crlf = '0a0d'x
  22. Call read_timeout "600000",port
  23.  
  24. Call put_s "",port
  25. Call wait_fore "User ID: ",port,screen_handle
  26. Call put_s "xxxxx,xxx"||cr,port
  27. Call wait_fore "assword: ",port,screen_handle
  28. Call put_s "xxxx.xxxxx"||cr,port
  29. Call wait_fore " !",port,screen_handle
  30. capture_file = 'ibmos2.cap'
  31. conference = 'ibmos2'
  32. Call Capture_Mail (conference capture_file)
  33. capture_file = 'ibmcom.cap'
  34. conference = 'ibmcom'
  35. Call Capture_Mail (conference capture_file)
  36. Call put_s "off"||cr,port
  37. exit 0
  38.  
  39. Capture_Mail: Procedure expose (expose_list)
  40. Parse arg conference file_name
  41. If file_name = '' then return 0
  42. If conference = '' then return 0
  43. Call put_s 'go '||conference||cr,port
  44. Call wait_fore "ss <CR> !",port,screen_handle
  45. Call put_s cr,port
  46. Call wait_fore " choice !",port,screen_handle
  47. Call put_s "2"||cr,port
  48. Call wait_fore " choice !",port,screen_handle
  49. Call put_s "2"||cr,port
  50. Call wait_fore " choice !",port,screen_handle
  51. Call put_s "1"||cr,port
  52. Call capture_on file_name,dde_output,dde_input
  53. Do Forever
  54.    Call wait_fore "CHOICES !"," choice !","Press <CR> !",port,screen_handle
  55.    match = result
  56.    Select
  57.      When match=1 then Call put_s cr,port
  58.      When match=2 then
  59.      Do
  60.         Call capture_off dde_output,dde_input
  61.         return 99
  62.      End
  63.      When match=3 then
  64.      Do
  65.         Call capture_off dde_output,dde_input
  66.         return 99
  67.      End
  68.    Otherwise Call put_s cr,port
  69.    End
  70. End
  71.  
  72. /* Standard handler for SIGNAL on ERROR, will help in the debuging */
  73. syntax_error:
  74. fp = filespec("path",fn)
  75. fd = filespec("drive",fn)
  76. errormsg = 'REXX error' rc 'in line' sigl':' errortext(rc)
  77. errorfile = fd||fp||"SCRIPT.ERR"
  78. rc = lineout(errorfile,date() time() fn '-' errormsg)
  79. rc = lineout(errorfile,date() time() fn '-' sourceline(sigl))
  80. Exit
  81.