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

  1. ;-------------------------------------------------------------------------------
  2. ;       File:   CompServ.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. ;               CompuServ through the Queen's University PACX/DataPac link.
  13. ;
  14. ;-------------------------------------------------------------------------------
  15.  
  16.         u="77777,8888"                          ; userid
  17.         p="samplepasswd"                        ; password
  18.         s="CIS"                                 ; service
  19.         d="FALSEPINNUMBER"                      ; PIN Number
  20.         n="T 555 5555"                          ; phone number
  21.  
  22.         x=0
  23.         timeout 5
  24. :checkAT                        ; see if modem responds
  25.         print "Checking modem..."
  26.         x=x+1
  27.         send "AT^M"             ; send attention sequence
  28.         wait "OK"               ; wait for OK to come back
  29.         if r==1 then "GotAT"       ; got a response
  30.         if x<5 then "checkAT"
  31.  
  32.         print "No response from MODEM"
  33.         abort
  34.  
  35. :GotAT
  36.         print "Modem is ALIVE"
  37.  
  38.  
  39. ; Dial the phone number
  40.         print "Dialing %n..."
  41.         timeout 120
  42.         send "ATD%n^M"                ; send dialing string
  43.         print "Waiting for response,"
  44.         connect
  45.         print "Result=%r"
  46.         if r>3 then "Connected"
  47.  
  48.         print "Connect attempt failed!"
  49.         goto "Abort"
  50.  
  51. :Connected
  52.  
  53.         timeout 3
  54.         x=0
  55. :SendCR
  56.         print "Looking for PACX Prompt,"
  57.         x=x+1
  58.         send "^M"
  59.         wait "Enter class"
  60.         if r==1 then "GotPACX"
  61.         if x<5 then "SendCR"
  62.  
  63.         print "Failed to get PACX"
  64.         goto "Abort"
  65.  
  66.  
  67. :GotPACX
  68.         send "datapac^M"
  69.         timeout 20
  70.         print "Wait for Connected"
  71.         wait "Connected to"
  72.         if r==0 then "Abort"
  73.  
  74.         timeout 3
  75.         x=0
  76. :GetDataPac
  77.         send "^M"
  78.         print "Looking for DATAPAC '*'"
  79.         wait "*"
  80.         if r==1 then "GotDataPac"
  81.         x=x+1
  82.         if x<10 then "GetDataPac"
  83.         goto "Abort"
  84.  
  85.  
  86. :GotDataPac
  87.         timeout 10
  88.         send "%d^M"
  89.         print "Wait for Host Name:"
  90.         wait "Host Name:"
  91.         if r==0 then "Abort"
  92.  
  93.         send "%s^M"
  94.         print "Wait for User ID:"
  95.         wait "User ID:"
  96.         if r==0 then "Abort"
  97.  
  98.         send "%u^M"
  99.         print "Wait for Password:"
  100.         wait "Password:"
  101.         if r==0 then "Abort"
  102.  
  103.         send "%p^M"
  104.         print "Wait for CompuServ"
  105.         wait "CompuServ"
  106.         if r==0 then "Abort"
  107.  
  108.         print "Success!"
  109.         return
  110.  
  111. :Abort
  112.         print "Hanging up..."
  113.         timeout 5
  114.         x=0
  115. :Abort1
  116.         send "+++"
  117.         wait "OK"
  118.         if r==1 then "Done"
  119.         x=x+1
  120.         if x<3 then "Abort1"
  121.  
  122. :Done
  123.         timeout 3
  124.         send "ath^M"
  125.         wait "OK"
  126.         abort
  127.  
  128. ;-------------------------------------------------------------------------------
  129. ; End of CompServ.SCR
  130. ;-------------------------------------------------------------------------------
  131.