;ASPECT script for Procomm PLUS Version 2 to log on to TYMNET at 2400 baud
;on local line and go to INFORMATION.  In the first define change 639-3022
;to your local TYNET 2400 baud node number.  If you don't know your number,
;phone (800)336-0149 and ask them.  This file uses a modified Translation
;Table.  If you don't want to modify yours, download PCPLUS.XLT from 
;Library 3.
;
DEFINE PHONE "639-3022"              ;define telenet phone number
DEFINE SERVICE "INFORMATION;;"       ;service desired
;
PROC MAIN                            ;label of main procedure
  LOG CLOSE                          ;close log in case it was open
  SET ATIME 1                        ;set alarm time 1 second
  SET DISPLAY ON                     ;turn on display of line characters
  SET ENQ OFF                        ;set enq to avoid download on login
  SET REMOTECMD OFF                  ;prohibit external control using ansi
  SET SOUND ON                       ;set sound on for alarm
  SET TRANSLATE ON                   ;set translation table to strip 8th
  IF NOT FROMDDIR                    ;if not linked to dialing directory
    EMULATE ANSI                     ;set emulation
    SET BAUDRATE 2400                ;set baudrate
    SET DATABITS 8                   ;set databits
    SET DUPLEX FULL                  ;set full duplex mode
    SET PARITY NONE                  ;set parity
    SET STOPBITS 1                   ;set stopbits
    LOCATE 0 0                       ;locate the cursor
    BOX 1 16 4 63 14                 ;draw a box
    ATSAY 2 18 14 " Calling Tymnet on local line at 2400 8-N-1." ;message
    ATSAY 3 18 14 "    Session will be logged to TYMNET.LOG.   " ;message
    LOCATE 6 0                       ;locate the cursor
    MDIAL PHONE "Tymnet Information" ;dial string phone and message
    IF NOT CONNECTED                 ;if not connected
      HANGUP                         ;hangup
      CALL MAIN                      ;and start over
    ENDIF                            ;end the if case
  ENDIF                              ;end the if case
  PAUSE 1                            ;pause to be sure of carrier
  RFLUSH                             ;flush the buffer
  TRANSMIT "A"                       ;wake up tymnet with A and no enter
  WAITFOR "please log in: "          ;wait for tymnet prompt
  PAUSE 1                            ;pause
  LOG OPEN "TYMNET.LOG"              ;open a log every time
  TRANSMIT SERVICE                   ;transmit service string
  TRANSMIT "^M"                      ;transmit enter
  WAITFOR "Select: "                 ;make sure we got in
  IF NOT WAITFOR                     ;if we didn't get in
    HANGUP                           ;hangup
    IF FROMDDIR                      ;if calling from dialing directory
      EXIT                           ;exit script
    ENDIF                            ;end the if
    CALL MAIN                        ;and start over
  ENDIF                              ;end the if case
  RFLUSH                             ;flush the buffer
  ALARM                              ;make some noise
  CALL LOGOFF                        ;call proc logoff
ENDPROC                              ;endproc main
;
PROC LOGOFF                          ;label for proc
  WHILE 1                            ;open while
    WAITFOR "DROPPED" FOREVER        ;wait for prompt after exit
    IF WAITFOR                       ;open if
      EXITWHILE                      ;exit while to next command
    ENDIF                            ;end the if
  ENDWHILE                           ;end the while
  WAITFOR "please log in: "          ;wait for
  LOG CLOSE                          ;close log just in case
  HANGUP                             ;hangup
  QUIT                               ;exit script, quit program
ENDPROC                              ;end the proc logoff
;
