home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / protk1.zip / QUEENSVM.SCR < prev    next >
Text File  |  1994-05-21  |  3KB  |  127 lines

  1. ;-------------------------------------------------------------------------------
  2. ;       File:   QueensVM.SCR
  3. ;
  4. ;       Auth:   Brian Fisher
  5. ;               RR 1 Seeley's Bay
  6. ;               Ontario, Canada
  7. ;               KOH 2NO
  8. ;
  9. ;       Date:   May 18 1994
  10. ;
  11. ;       Purp:   Example of the ProTalk Script Language, used to log on to
  12. ;               Queen's University VM via the PACX data switch...
  13. ;
  14. ;-------------------------------------------------------------------------------
  15.  
  16.         s="vm"                                  ; service
  17.         n="T 555 5555"                          ; phone number
  18.         u="userid"                              ; userid
  19.         p="passwd"                              ; password
  20.  
  21.         x=0
  22.         timeout 5
  23. :checkAT                        ; see if modem responds
  24.         print "Checking modem..."
  25.         x=x+1
  26.         send "AT^M"             ; send attention sequence
  27.         wait "OK"               ; wait for OK to come back
  28.         if r==1 then "GotAT"       ; got a response
  29.         if x<5 then "checkAT"
  30.  
  31.         print "No response from MODEM"
  32.         abort
  33.  
  34. :GotAT
  35.         print "Modem is ALIVE"
  36.  
  37.  
  38. ; Dial the phone number
  39.         print "Dialing %n..."
  40.         timeout 120
  41.         send "ATD%n^M"                ; send dialing string
  42.         print "Waiting for response,"
  43.         connect
  44.         print "Result=%r"
  45.         if r>3 then "Connected"
  46.  
  47.         print "Connect attempt failed!"
  48.         goto "Abort"
  49.  
  50. :Connected
  51.  
  52.         timeout 3
  53.         x=0
  54. :SendCR
  55.         print "Looking for PACX Prompt,"
  56.         x=x+1
  57.         send "^M"
  58.         wait "Enter class"
  59.         if r==1 then "GotPACX"
  60.         if x<5 then "SendCR"
  61.  
  62.         print "Failed to get PACX"
  63.         goto "Abort"
  64.  
  65.  
  66. :GotPACX
  67.         send "%s^M"
  68.         timeout 20
  69.         print "Wait for Connected"
  70.         wait "Connected to"
  71.         if r==0 then "Abort"
  72.  
  73.         timeout 3
  74.         x=0
  75. :GetTType
  76.         send "^M"
  77.         print "Wait for terminal type"
  78.         wait "terminal type"
  79.         if r==1 then "GotTType"
  80.         x=x+1
  81.         if x<5 then "GetTType"
  82.  
  83. :GotTType
  84.         timeout 20
  85.         send "ibmpc^M"
  86.         print "Wait for Q Screen"
  87.         wait "COMMAND"
  88.         if r==0 then "Abort"
  89.         send "^L"
  90.  
  91.         timeout 5
  92.         x=0
  93. :GetCPRead
  94.         send "^M"
  95.         print "Wait for CP READ"
  96.         wait "CP READ"
  97.         if r==1 then "GotCPRead"
  98.         x=x+1
  99.         if x<5 then "GetCPRead"
  100.         goto "Abort"
  101.  
  102. :GotCPRead
  103.         print "Sending USERID"
  104.         send "L %u^M"
  105.         timeout 20
  106.         print "Waiting for PASSWORD"
  107.         wait "PASSWORD"
  108.         if r==0 then "Abort"
  109.         print "Sending PASSWORD"
  110.         send "%p^M"
  111.  
  112.         print "Sending Screen Refresh"
  113.         send "\x1BH2"
  114.  
  115.         print "Success!"
  116.         return
  117.  
  118. :Abort
  119.         print "Hanging up..."
  120.         send "+++~+++~+++ath^M"
  121.         print "Attempt aborted!"
  122.         abort
  123.  
  124. ;-------------------------------------------------------------------------------
  125. ; End of CompServ.SCR
  126. ;-------------------------------------------------------------------------------
  127.