home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / ca24_1.zip / SCRIPTS.ZIP / CONNECT.CMD < prev    next >
OS/2 REXX Batch file  |  1989-02-14  |  2KB  |  72 lines

  1. ;
  2. ;    Go into auto answer (echo off, answer on 2nd)
  3. ;    Also: Return result codes, word form, with CONNECT 1200
  4. ;
  5.     ON ESCAPE GOSUB EXIT        ; Escape pressed
  6.     SET PARITY NONE         ; Turn off parity
  7.     SET DATA 8            ; Set 8 databits
  8.     SET MASK ON            ; Mask received text to 7 bits
  9. Restart:
  10.     LEGEND " Waiting for call"
  11.     Pause 3             ; Wait 3 seconds
  12.     HANGUP                ; HANGUP and leave modem in cmd mode
  13.     PAUSE 3             ; Wait 3 secs
  14.     MESSAGE "^MWaiting..."
  15.     TRANSMIT "ATE0Q0V1X1S0=2 S7=30 S9=10^M"
  16. ;
  17. ; -----------------------------------------------------------------------
  18. ; ----- Wait for a connect
  19. ; -----------------------------------------------------------------------
  20. ;
  21. Wait_Connect:
  22.     RGET S9 80 180            ; Wait for a line
  23.     IF NOT SUCCESS            ; If nothing was read
  24.        GOTO Wait_Connect
  25.        ENDIF
  26.  
  27.     FIND S9 "NO CARRIER"            ; Look for a disconn
  28.     IF FOUND
  29.        GOTO Restart
  30.        ENDIF
  31.  
  32.     FIND S9 "CONNECT"               ; Anything else BUT CONNECT
  33.     IF NOT FOUND            ; .. waits
  34.        GOTO Wait_Connect
  35.        ENDIF
  36.  
  37. ;***    IF NOT CONNECTED        ; SOme modems aren't fast enough
  38. ;***       GOTO Wait_Connect        ; .. to set this right away
  39. ;***       ENDIF
  40. ;
  41. ; -----------------------------------------------------------------------
  42. ; ----- Change baud rate according to connect
  43. ; -----------------------------------------------------------------------
  44. ;
  45.     FIND S9 "1200"                  ; Test for 1200 baud
  46.     IF FOUND            ; IF found
  47.        SET BAUD 1200        ; Set to 1200 baud
  48.        GOTO Finish            ; We're done.
  49.        ENDIF
  50.  
  51.     FIND S9 "2400"                  ; Test for 1400 baud
  52.     IF FOUND            ; IF found
  53.        SET BAUD 2400        ; Set to 1400 baud
  54.        GOTO Finish            ; We're done.
  55.        ENDIF
  56. ;
  57. ;    None of the above... set to 300
  58. ;
  59.     SET BAUD 300            ; Set to 1200 baud
  60. ;
  61. ;    Exit - set-up for conversational mode
  62. ;
  63. Finish:
  64.     SET CHAT ON            ; Set chat mode
  65.     SET CR CR_LF            ; Incoming Cr's as CRLF
  66.     CLOG "* Auto-answer"            ; Log it
  67. ;
  68. ;    The exit is separately labelled to allow ESC to terminate quickly
  69. ;
  70. Exit:
  71.     EXIT
  72.