.. 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 .. .. ------------------------------------------------------------ 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 %m=100;. default menu (100 -> display it) %t=5;. default attempts to reach city %s=1;. default attempts to reach BBS %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 .. similar code for other parameters omitted. .. Initialize various variables and MEX parameters %a=0;. no area code requested .. etc. D=" ";. no PCP outdial (city) code .. etc. 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 .. etc. .. ------------------------------------------------------------ .. .. Initialize the Modem .. .. ------------------------------------------------------------ .. Make sure the modem is connected and responding. sendout "AT/r" wait string 2 "OK" "0";. allow verbose or terse responses if value=0 A="No response from local modem";GOTO ABORT .. etc. .. ---------------------------------------------------------------------- .. .. Establish Connection to Local Access to Telenet .. .. ---------------------------------------------------------------------- screen on;. tell user what we are doing say "/n/nDialing Telenet (",A,") . . . ";. 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 .. .. ------------------------------------------------------------ LABEL ABORT screen on say "/n/n",A,"; session aborted./n/n" dsc