.. PCP.MEX: MAIN PCP SCRIPT (04/15/90) .. .. This is the main entry point to the script for automating calls via the .. PC-Pursuit network. This part of the script handles initialization of .. MEX and the modem and establishes the connection to the local access .. number. .. Two things we have to take care of right away screen off stat sep ";" .. ---------------------------------------------------------------------- .. .. Configuration Information .. .. ---------------------------------------------------------------------- .. Each user of this script must edit the following two lines. The local .. access number for Telenet should be assigned, and it is handy for those .. occasions when you have to perform operations manually to have your .. user ID and password assigned to function keys. Key I has the user ID .. alone with no carriage return; key W (P is already used for printer .. control) has the password with no carriage return. Your user ID and .. password data should also be entered in PCPCONN.MEX. phone pcp=000-0000 2400;. local access number and baud rate A="Your Town -Class B";. type of Telenet access for msg later key i="PCP_USERID";. key for entering user id key w="PCP_PW";. key for entering password .. Users may want to change the following default values. The value for .. %m will probably not be changed unless you want the script to default .. to placing a call to a particular RAS. Variable %t determines how many .. attempts will be made to connect to a city; variable %s determines how .. many attempts are made to reach the RAS once one is connected to the .. city. The numerical variable %b and string variable B contain the .. default baud rate. Variable %n determines whether or not automatic baud .. rate stepdown will be in effect. A value of 2 makes the script drop from .. 2400 down to 1200 after %t tries have failed at the higher baud rate. %m=100;. default menu (100 -> display it) %t=5;. default attempts to reach city %s=1;. default attempts to reach BBS in city %b=2400;. default baud rate value for outdial B="24" default baud rate as a string %n=2;. automatic stepdown mode key 0="read pcpmenu/r";. key for reinvoking script .. ---------------------------------------------------------------------- .. .. Initialization .. .. ---------------------------------------------------------------------- .. Initialize data from command line. There are three optional parameters. .. The first is a menu selection number to call immediately. The second .. is the number of attempts that should be made to connect to the destination .. city. The third is the number of times to attempt to connect to the local .. number in that city. In all cases, we check to make sure that we have an .. acceptable value. .. menu selection (variable %m) %d={1:0};. read parameter 1 with default value of 0 if %d<1 GOTO BAD1;. ignore if illegal value if %d>100 GOTO BAD1 %m=%d;. if value in range 1..100, use it LABEL BAD1 .. number of tries to connect to city (variable %t) %d={2:0};. read parameter 2 with default value of 0 if %d<1 GOTO BAD2;. ignore if illegal value if %d>100 GOTO BAD2 %t=%d;. if value in range 1..100, use it LABEL BAD2 .. number of tries to reach RAS (variable %s) %d={3:0};. read parameter 3 with default value of 0 if %d<1 GOTO BAD3;. ignore if illegal value if %d>25 GOTO BAD3 %s=%d;. if value in range 1..25, use it LABEL BAD3 .. Initialize various variables and MEX parameters %a=0;. no area code requested %c=0;. no city requested %p=0;. no remembered city connection D=" ";. no PCP outdial (city) code E=" ";. no phone number F=" ";. no system name stat filter on turn filter on stat trigger "";. do sendouts immediately stat sodelay on;. ..but at a slow rate stat reply 0;. do not wait for response to a sendout stat case on;. ignore case prefix "";. no prefix or suffix to sendout strings suffix "" .. ---------------------------------------------------------------------- .. .. Initialize the Modem .. .. ---------------------------------------------------------------------- .. First we make sure that the modem is connected and responding. Then we .. set it to MNP mode. sendout "AT/r" wait string 2 "OK" "0";. allow verbose or terse responses if value=0 A="No response from local modem";GOTO ABORT screen on cls say "/n/nEngaging MNP error correction mode" screen off sendout "AT\N2L2/r" wait string 2 "OK" "0" if value = 0 A="MNP command failure";GOTO ABORT .. ---------------------------------------------------------------------- .. .. Establish Connection to Local Access to Telenet .. .. ---------------------------------------------------------------------- screen on say "/n/nDialing Telenet (",A,") . . . ";. temp string A has node info screen off .. place call to Telenet dial pcp if value=0 A="No connection to Telenet:";GOTO ABORT screen on say "CONNECTED/n" .. initialize PCP session %z=2;. max tries LABEL LOGIN if %z<1 A="Telenet not responding";GOTO ABORT %z=%z-1 screen on;say " sync... ";screen off sendout "@";sleep 1;sendout "D/r" wait string 1 "TERMINAL" if value=0 sleep 1;goto LOGIN screen on;say "terminal ID... ";screen off sendout "D1/r" read PCPMENU;. chain to PCPMENU script .. ---------------------------------------------------------------------- .. .. Subroutines .. .. ---------------------------------------------------------------------- .. This routine handles possible aborts from several points in the script. .. An error message is passed via string variable A. After the message is .. displayed, the modem is sent a disconnect signal. MEX is not terminated. LABEL ABORT screen on say "/n/n",A,"; session aborted./n/n" dsc