home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / JSAGE / ZSUS / TCJ / TCJ45.LBR / PCP.TZJ / PCP.TCJ
Text File  |  1990-05-02  |  4KB  |  126 lines

  1.  
  2. .. PCP.MEX: MAIN PCP SCRIPT (04/15/90)
  3. ..
  4. .. This is the main entry point to the script for automating
  5. .. calls via the PC-Pursuit network.  This part of the script
  6. .. handles initialization of MEX and the modem and establishes
  7. .. the connection to the local access number.
  8.  
  9. .. Two things we have to take care of right away
  10.  
  11. screen off
  12. stat sep ";"
  13.  
  14. .. ------------------------------------------------------------
  15. ..
  16. ..    Configuration Information
  17. ..
  18. .. ------------------------------------------------------------
  19.  
  20. phone pcp=000-0000 2400;.  local access number and baud rate
  21. A="Your Town -Class B";.   type of Telenet access for msg later
  22. key i="PCP_USERID";.       key for entering user ID
  23. key w="PCP_PW";.           key for entering password
  24.  
  25. %m=100;.                   default menu (100 -> display it)
  26. %t=5;.                     default attempts to reach city
  27. %s=1;.                     default attempts to reach BBS
  28. %b=2400;.                  default baud rate value for outdial
  29. B="24"                     default baud rate as a string
  30. %n=2;.                     automatic stepdown mode
  31. key 0="read pcpmenu/r";    key for reinvoking script
  32.  
  33. .. ------------------------------------------------------------
  34. ..
  35. ..    Initialization
  36. ..
  37. .. ------------------------------------------------------------
  38.  
  39. .. Initialize data from command line.  There are three optional
  40. .. parameters.  The first is a menu selection number to call
  41. .. immediately.  The second is the number of attempts that
  42. .. should be made to connect to the destination city.  The third
  43. .. is the number of times to attempt to connect to the local
  44. .. number in that city.  In all cases, we check to make sure that
  45. .. we have an acceptable value.
  46.  
  47. .. menu selection (variable %m)
  48.  
  49. %d={1:0};.           read parameter 1 with default value of 0
  50. if %d<1 GOTO BAD1;.  ignore if illegal value
  51. if %d>100 GOTO BAD1
  52. %m=%d;.              if value in range 1..100, use it
  53. LABEL BAD1
  54.  
  55. .. similar code for other parameters omitted.
  56.  
  57. .. Initialize various variables and MEX parameters
  58.  
  59. %a=0;.               no area code requested
  60. .. etc.
  61. D=" ";.              no PCP outdial (city) code
  62. .. etc.
  63.  
  64. stat filter on       turn filter on
  65. stat trigger "";.    do sendouts immediately
  66. stat sodelay on;.    ..but at a slow rate
  67. stat reply 0;.       do not wait for response to a sendout
  68. stat case on;.       ignore case
  69. .. etc.
  70.  
  71. .. ------------------------------------------------------------
  72. ..
  73. ..    Initialize the Modem
  74. ..
  75. .. ------------------------------------------------------------
  76.  
  77. .. Make sure the modem is connected and responding.
  78.  
  79. sendout "AT/r"
  80. wait string 2 "OK" "0";.     allow verbose or terse responses
  81. if value=0 A="No response from local modem";GOTO ABORT
  82. .. etc.
  83.  
  84. .. ----------------------------------------------------------------------
  85. ..
  86. ..    Establish Connection to Local Access to Telenet
  87. ..
  88. .. ----------------------------------------------------------------------
  89.  
  90. screen on;.                   tell user what we are doing
  91. say "/n/nDialing Telenet (",A,") . . . ";.
  92. screen off
  93.  
  94. .. place call to Telenet
  95.  
  96. dial pcp
  97. if value=0 A="No connection to Telenet:";GOTO ABORT
  98. screen on
  99. say "CONNECTED/n"
  100.  
  101. .. initialize PCP session
  102.  
  103. %z=2;.                       max tries
  104. LABEL LOGIN
  105. if %z<1 A="Telenet not responding";GOTO ABORT
  106. %z=%z-1
  107. screen on;say "  sync... ";screen off
  108. sendout "@";sleep 1;sendout "D/r"
  109. wait string 1 "TERMINAL"
  110. if value=0 sleep 1;goto LOGIN
  111. screen on;say "terminal ID... ";screen off
  112. sendout "D1/r"
  113.  
  114. read PCPMENU;.               chain to PCPMENU script
  115.  
  116. .. ------------------------------------------------------------
  117. ..
  118. ..    Subroutines
  119. ..
  120. .. ------------------------------------------------------------
  121.  
  122. LABEL ABORT
  123. screen on
  124. say "/n/n",A,"; session aborted./n/n"
  125. dsc
  126.