home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / oct93 / comm / dcdd.lha / DCDD / Do_FAAX.rexx < prev    next >
OS/2 REXX Batch file  |  1993-08-26  |  5KB  |  209 lines

  1. /* 
  2.    Do_FAAX.rexx                                                    930826.2144
  3.  
  4.              (you can follow along on the ZZZ_FAAX_session_log file)
  5. */
  6.  
  7. address BAUD /* must have this here */
  8. OPTIONS RESULTS
  9.  
  10. timeout 30
  11.  
  12. auto = 'n'
  13. waitlost = ' '
  14.  
  15. if exists('ram:AUTO')~=0 then  
  16.    auto = 'y'
  17.  
  18. call LOGON
  19.  
  20. if auto = 'y' then do
  21.    if waitlost = 'n' then do  
  22.       call AUTO_NEW_FILE_LIST
  23.    end
  24. end 
  25.  
  26. if auto = 'y' then do
  27.    if waitlost = 'n' then do 
  28.       call LOGOFF
  29.    end
  30. else
  31.    call LOGOFF
  32. end  
  33.  
  34. if waitlost = 'y' then do
  35.    if exists('RAM:continue')~=0 then do
  36.       address command 'delete RAM:continue'
  37.    end
  38. end
  39.  
  40. return
  41.  
  42.  
  43. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  44.  *                                                             *
  45.  *                   Functions / Subroutines                   *
  46.  *                                                             *
  47.  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  48.  
  49. LOGON:
  50. address BAUD /* must have this here */
  51.  
  52. waitlost = ' '
  53. waitlost_LO_hold = ' '
  54. do forever
  55. nput='Escape twice,First and Last name,Password:,continue,mail now? [Y/n]:,DDDDDDY,quit):'
  56. wait nput
  57. NRC = RC
  58. NRESULT = RESULT
  59.    if NRC > 0 then do  /* waited 30 seconds & no nput items on serial port */
  60.       waitlost = 'y'
  61.       msg '****** Logon wait is LOST! ******'
  62.    end
  63.    if NRESULT = 'Escape twice' then           /* A */ 
  64.       send '\w\w\x1B\x1B'
  65.    if NRESULT = 'First and Last name' then   /* B */ 
  66.       send '\wYour Name\r'
  67.    if NRESULT = 'Password:' then              /* C */ 
  68.       send 'Your Password\r'
  69.    if NRESULT = 'Press enter...' then         /* D */ 
  70.       send '\r'
  71.    if NRESULT = 'continue' then               /* E F */ 
  72.       send '\r'
  73.    if NRESULT = 'mail now? [Y/n]:' then do     /* G */
  74.       if auto = 'y' then do
  75.          send 'y\r'        
  76.          waitlost_LO_hold = waitlost
  77.          call MAIL_CALL
  78.          if waitlost = 'n' then 
  79.             waitlost = waitlost_LO_hold
  80.          end
  81.       else do
  82.          send 'n\r' 
  83.       end
  84.    end
  85.    if NRESULT = 'DDDDDDY' then                /* Q R */ 
  86.       send '\r'
  87.    if NRESULT = 'quit):' then do              /* S */
  88.       waitlost = 'n'
  89.       send '\r'
  90.    end
  91.    if waitlost ~= ' ' then 
  92.       leave
  93. end
  94. return
  95.  
  96. MAIL_CALL:
  97. address BAUD /* must have this here */
  98.  
  99. waitlost = ' '
  100. do forever
  101. nput='More(Y/n/=),(E)nter? (S)top:,(F)iles? (S)top:,to continue:,(Enter to continue):,(A)bort:,here [y/N],End of messages'
  102.  
  103. /* note use of ? to allow entry of a comma into nput above "(E)nter? (S)top:" */
  104.  
  105. wait nput
  106. NRC = RC
  107. NRESULT = RESULT
  108.    if NRC > 0 then do /* waited 30 seconds & no nput items on serial port */
  109.       waitlost = 'y'
  110.       msg '****** Mail_Now - wait is LOST! ******'
  111.    end
  112.    if NRESULT = 'More(Y/n/=)' then            /*   */ 
  113.       send '='
  114.    if NRESULT = '(E)nter, (S)top:' then       /* H N O */ 
  115.       send 'n\r'
  116.    if NRESULT = '(F)iles, (S)top:' then       /* I */ 
  117.       send 'f\r'
  118.    if NRESULT = 'to continue:' then           /* J */ 
  119.       send '\r'
  120.    if NRESULT = '(Enter to continue):' then   /* K */ 
  121.       send '\r'
  122.    if NRESULT = '(A)bort:' then               /* L */ 
  123.       send 's\r'
  124.    if NRESULT = 'here [y/N]' then             /* M */ 
  125.       send 'y\r'
  126.    if NRESULT = 'End of messages' then        /* P */ 
  127.       waitlost = 'n'
  128.    if waitlost ~= ' ' then 
  129.       leave
  130. end
  131. return 
  132.  
  133.  
  134. AUTO_NEW_FILE_LIST:
  135. address BAUD /* must have this here */
  136.  
  137. waitlost = ' '
  138. loop_count = 0
  139. do forever
  140. nput='Command ->,Enter Disk Number:,Time Left [,Search Date,Previous Page:'
  141. wait nput
  142. NRC = RC
  143. NRESULT = RESULT
  144.    if NRC > 0 then do  /* waited 30 seconds & no nput items on serial port */
  145.       waitlost = 'y'
  146.       msg '****** Auto_New_File_List wait is LOST! ******'
  147.    end
  148.    if NRESULT = 'Command ->' then             /* T */ 
  149.       send 't\r'
  150.    if NRESULT = 'Enter Disk Number:' then     /* U */ 
  151.       send '0\r'
  152.    if NRESULT = 'Time Left [' then do         /* V W */
  153.       loop_count = loop_count + 1
  154.       if loop_count = 1 then 
  155.          send '#'                             /* V */
  156.       if loop_count = 2 then 
  157.          send 'n'                             /* W */
  158.       if loop_count = 3 then do
  159.          waitlost = 'n'
  160.          send 'q'                             /* Z */
  161.       end
  162.       if loop_count > 3 then do
  163.          waitlost = 'y'
  164.          msg '****** Auto_New_File_List (time left) > 3 ******'
  165.       end
  166.    end
  167.    if NRESULT = 'Search Date' then            /* X */ 
  168.       send '\r'
  169.    if NRESULT = 'Previous Page:' then         /* Y */ 
  170.       send 'y'
  171.    if waitlost ~= ' ' then 
  172.       leave
  173. end
  174. return
  175.  
  176.  
  177. LOGOFF:
  178. address BAUD /* must have this here */
  179.  
  180. waitlost = ' '
  181. loop_count = 0
  182. do forever
  183. nput='Command ->' 
  184. wait nput
  185. NRC = RC
  186. NRESULT = RESULT
  187.    if NRC > 0 then do  /* waited 30 seconds & no nput items on serial port */
  188.       waitlost = 'y'
  189.       msg '****** Logoff wait is LOST! ******'
  190.    end
  191.    if NRESULT = 'Command ->' then do          /* A1 A2 */ 
  192.       loop_count = loop_count + 1
  193.       if loop_count = 1 then 
  194.          send 'g\r'                           /* A1 */
  195.       if loop_count = 2 then do
  196.          waitlost = 'n'
  197.          send 'y\r'                           /* A2 */
  198.       end
  199.       if loop_count > 2 then do
  200.          waitlost = 'y'
  201.          msg '****** Logoff (command ->) > 2 ******'
  202.       end
  203.    end
  204.    if waitlost ~= ' ' then 
  205.       leave
  206. end
  207. return
  208.  
  209.