	::rev 6-08-90 for ZCOMM 17.28+
	cls; goto cmdch
ak	lput "\r\n\E[1;5mType space to Continue\E[m"; if y
	lput "\E[2A\E[2K"
busy	speed 1200 putw "ATM0H1\r"
reset	speed 1200; putw "ATZ\r";pat 1 OK; wait -f3
twx	if twxout speed 1200 %s8 f -qxh twxout;o
	else echo " No file to Send. "
att	set l 0; set m "0503"; set alds ",50312345678901,"
	echo "Set for AT&T Calling Card"
ddd	set l "1"; set m "1"; set alds ""
	echo "Set for Direct Distance Dialing (Station to Station)"
tryd	%telno


waketb	put "\b\b\b"; sleep 3; pat; purgel; kill; pat 1i "A"; pat 9 OK; ena -d
	while "L<5&&!m" mput "A" lput "!" sleep 2
	wait -f2; if !1 while "L<4&&!m" mput "A" lput "@" sleep 3
	if 1 put "TZ\r"; wait -f2
	if 9 goto wak1
	pat 1 ""; while "!9&&L<2" put "ATZ\r"  wait -f3
	if 9 goto wak1
	bye
	while "L<9&&!m" mput "A" lput "#" sleep 3
	pat 1i "A"; wait -f2; if !1 while "L<5&&!m" mput "A" lput "$" sleep 3
	if 1 put "TZ\r"; wait -f2
	if 9 goto wak1
	pat 1 ""; while "!9&&L<2" put "ATZ\r"  wait -f3
	if 9 goto wak1
	sp 9600 echo "9600 bps"
	bye; br; br; br; while "!9&&L<2" put "ATZ\r"  wait -f1
	if 9 goto wak1
	echo "2400 bps"; sp 2400
	while "!9&&L<3" put "ATZ\r"  wait -f1
	if 9 goto wak1
	echo "1200 bps"; sp 1200
	while "!9&&L<3" put "ATZ\r"  wait -f1
	if 9 goto wak1
	while "!9&&L<10" put "AT\r"  wait -f1
	if 9 goto wak1
	echo "No response From MODEM" dis -Q
	bye; sleep 4; br; br; while "!9&&L<2" put "ATZ\r"  wait -f2
	if 9 goto wak1
	echo "No response From MODEM"
	bye; sleep 4; br; br; while "!9&&L<2" put "ATZ\r"  wait -f2
	if 9 goto wak1
	echo "No response From MODEM: setting 2400 bps"; sp 2400
	bye; sleep 4; br; br; while "!9&&L<2" put "ATZ\r"  wait -f2
	if 9 goto wak1
	echo "No response From MODEM: setting 1200 bps"; sp 1200
	while "!9&&L<20" o sleep 9 bye sleep 9 put "ATZ\r"  wait -f2
	if 9 goto wak1
	echo "No response From MODEM"
wak1:	pat; pat 1i A
	if iMODEM,C2400E sp 2400
	while "L<9&&!m" mput "A" lput "%" sleep 3
	wait -f2; if !1 while "L<9&&!m" mput "A" lput "^" sleep 3
	pat; pat 1l "OK"; put "T\r"; wait -f3
	if !1 putw "AT\r"
	dis -t;  ret

::
:: Dial script for most 2400 bps modems uses speed fallback.
::  Environment variable MODEM checked for:
::	C2400E	US Robotics Courier 2400E (MNP)
::	HST	US Robotics Courier HST
::	HV96	Hayes V series 9600 bps
::	MM224	MultiTech 224
::	MM224E	MultiTech 224E (MNP)
::	MMV32	MultiTech MultiModemV32
::	SM1200	Hayes Smartmodem 1200
::	TB	Telebit TrailBLazer
:: If the call is placed at >300 and <9600 bps, switch to 2400 bps.  Make the
:: call.  If the called modem only supports 1200 or (ugh) 300 bps,
:: the modem will drop back in speed.  The actual connect speed is indicated
:: by a "CONNECT", "CONNECT 1200", or "CONNECT 2400" string.
:: Fallback to 300 bps may be a bit messey, (depending on the answering
:: modem, so a call originated at 300  bps will go out at that speed
::
::  It is important to give Xn value with highest possible n, e.g. X4
::
::  String vars: s0: original speed   s1:non empty to lock interface speed
::	s2: Current dial option   s3:Current telno
::      s4: Remaining alternate telnums    s5: provisional speed
::
mm224	if "itelno,1" if dX echo "Vritual Channel 1"; return
	if "itelno,2" if dX echo "Vritual Channel 2"; return
	if "itelno,3" if dX echo "Vritual Channel 3"; return
	if "itelno,1" port 1;  set dirrx "";  echo "Port 1"; return
	if "itelno,2" port 2;  set dirrx "";  echo "Port 2"; return
	if "%telno<2" echo "Please do not use \"call mm224\""; abort
	if iMODEM,MM224 if S>2500 sp 2400
	if iMODEM,MM224E if S>9600 sp 9600
	if iMODEM,MMV32 if S>19200 sp 19200
	if iMODEM,SM1200 if S>1201 sp 1200
	if iMODEM,C2400E sp 2400
	set? s0 S;  sets s4 %telno
mm2l:	split s4 "+" ""; sets s4 %z1; sets s3 %z0
	set s1 ""; split s3 "/" ""; sets s3 %z0; sets s2 %z1
	handshake sw;  pat;  sets s5 "%s0"
	echo "PORT = %dport  MODEM = %MODEM  modifier = %s2"
	if js2,mnp set s1 "mnp"
	if js2,_s set s1 "_s"
	if js2,lock set s1 "lock"
	if iMODEM,AX9624 if js2,mnp sp 19200
	if iMODEM,TB if S>3000 if !%s1 set s1 "lock"
	if iMODEM,HST if js2,mnp sp 19200  :: Change this to match sp in inithst
	if js2,1200 sp 1200; set s5 1200
	else if js2,300 sp 300; set s5 300
	else if S==450 sp 300 echo "300 bps"
	else if !%s1 if "S<9500&&S>1201" sp 2400 echo "2400 bps"
	bye
	gosub waketb		:: get modem to respond
	if iMODEM,C2400E sp 2400
	pat; pat 9 OK
	if pMODEM,MM if js2,mnp   put "AT&E2 &E4 &E13 \44BA0 &B0\r"; wait -f2
	if pMODEM,MM if js2,mnp_s put "AT&E2 &E5 &E13 \44BA0 &B0\r"; wait -f2
	if iMODEM,HST if !js2,mnp put "AT&M0 X6 &B0 &H0 &R1 &I0\r"; wait -f2
	if iMODEM,HST if js2,mnp put "AT&M5 X6 &B2 &H1 &R2 &I0 &K1\r"; wait -f2
	if iMODEM,HST if js2,mnp_s put "AT&H2 &I1 &R1\r"; wait -f2
	if iMODEM,C2400E if !js2,mnp put "AT&M0 &H0 &R1 &I0\r"; wait -f2
	if iMODEM,C2400E if js2,mnp put "AT&M5 &H1 &R2 &I0 &K1\r"; wait -f2
	if iMODEM,C2400E if js2,mnp_s put "AT&H2 &I1 &R1\r"; wait -f2
	if iMODEM,AX9624 if js2,mnp put "ATX4\\V1\\J0\\A3\\N3\\Q3\r"; wait -f2
	if iMODEM,AX9624 if js2,mnp_s put "ATX4\\V1\\J0\\A3\\N3\\Q1\r"; wait -f2
	put "AT"
	if pMODEM,MM if js2,a_mnp put "&E1 "
	if pMODEM,MM if "as5<2500" put "\44MB%s5 "
	if jMODEM,C2400E if js2,a_mnp put "&M4 "
	if iMODEM,HST    if js2,a_mnp put "&M4 S15=16 "
	if iMODEM,HST    if js2,300 put "&N1 "
	if iMODEM,HST    if js2,1200 put "&N2 "
	if iMODEM,HST    if js2,2400 put "&N3 "
	if jMIDEM,HV if js2,v22 put "B0 "
	ss s2 "(c:)(.*)";  if %z2 put "%z2 "		:: for extra commands
	if iMODEM,TB if is5,300 put "S50=1 "
	if iMODEM,TB if is5,1200 put "S50=2 "
	if iMODEM,TB if is5,2400 put "S50=3 "
	if iMODEM,TB if js2,fast z pW10000; put "S50=255 S7=50 "; if !%s1 set s1 "lock"
	if iMODEM,TB if js2,mnp put "S95=1 "
	if iMODEM,TB if js2,a_mnp put "S95=2 "
	if iMODEM,TB if %s1 put "S66=1 S58=2 " if S==19200 put "S51=5 "
	if iMODEM,TB if js2,_s put "S58=3 "
	if iMODEM,TB if js2,v22 put "S90=1 "
	if pMODEM,SM put "X3 "
	if "%s3>8" put "S7=70 "		: longer wait if long distance
	put "E1 Q0 S10=10 V1\r"; wait -f2
	put "ATS6=3 S8=1 S0=0\r" wait -f2
	if iMODEM,TB put "ATX3 S68=255 S111=0\r" wait -f2
	if iMODEM,TB if js2,xmodem put "ATS111=20\r" wait -f2
	if iMODEM,TB if js2,kermit put "ATS111=10\r" wait -f2
	if pMODEM,MM put "ATX4 &Q0\r" wait -f2
	if !%MODEM put "ATX3\r";  wait -f2	:: Change this for your modem
	if iMODEM,C2400E if %s1 putw "AT&B6\r"; sp 9600
	if %s1  if !Js1,s handshake slow; lput "Handshake SLOW: "
	if %alds if ps3,0 putw "ATS8=10\r"
	put "%mprefix";  put "%s3%alds";  dis -Q
	if js2,man putw ";\r"; echo "Hit F1 when Tone is heard"; t; put "ATO"
	put "\r";  dis -t
	if "js3,;"  accept s1 "Lift Telephone Receiver, Hit ENTER"; o; return
	pat 1 "CONNECT\r"; pat 2 "NO CARRIER"; pat 3 "BUSY"; pat 4 RING;
	pat 5l "ECT 12"; pat 6l "ECT 24"; pat 7l "CONNECT FAST"
	pat 8 "NO DIAL TONE"; pat 10l "CONNECT 300"
	pat 11l "CONNECT 96"; pat 12l "CONNECT 192"
	pat 13 "VOICE"; pat 14 "NO ANS"; pat 15l "CONNECT 4800"
	wait -f72
	while "4&&!L>3" wait -f40
	if "n||9||2||3||4||13||14" goto sorry
	dis -d
	if dd while "!c&&L<20" sleep 1	: For modems with slow carrier det
	if iMODEM,HST if "!hARQ" set s1 ""
	if %s1 if "hCONNECT" ss y "[0-9]+"; estimate 0 z0; echo "Speed Locked"; goto mm2end
	if "hARQ" echo "MNP Connected";  handshake both; goto arq
	if "hREL" echo "MNP Connected";  handshake both; goto arq;
	if "hERROR-CONTROL" echo "HV Connected";  handshake both; goto arq
	if js2,mnp set s2 ""
arq:	if "1||10" if is5,450 sp 450; echo "450 bps"; goto mm2end
	if "1||10" sp 300 goto mm2end
	if 5 sp 1200 goto mm2end
	if 6 sp 2400 goto mm2end
	if "du&&7" sp 9600 echo "9600 bps"; goto mm2end
	if "7||12" sp 19200; goto mm2end
	if 11 sp 9600; goto mm2end
sorry:	echo "No Connect Message Detected."
	: if iMODEM,TB sleep 10; pat; pat 1 OK; putw "ATN?\r" wait
	if iMODEM,C2400E if %s1 putw "ATZ\r"
	if %s4 echo "Attempting %s4";  speed s0;  goback mm2l
	pat; bye; bye; fail
mm2end:	pat
        if js1,mnp sleep 15	: for gliches in MM224E
	sets telno %s3		: Telephone number we connected to
	if !js2,nodel queue delete
	return



askspd	lput "1200 baud?"; if y sp 1200; return
	lput "2400 baud?"; if y sp 2400; return
	lput "4800 baud?"; if y sp 4800; return
	lput "9600 baud?"; if y sp 9600; return
	lput "19200 baud?"; if y sp 19200; return
	lput "300 baud then."; sp 300; return
callcis	speed 1200
	if %s3 sets telno %s3; gosub tryd; if c sleep 20 put \3 return
	speed 300
	if %s2 sets telno %s2; gosub tryd; if c sleep 20 put \3 return
	sp 1200
	if %s5 sets telno %s5; gosub tryd; if c gosub tym12; return
	if %s4 sets telno %s4; gosub tryd; if c gosub tel12; return
	echo "Sorry, none of the numbers are working right now"
	gosub ak
	fail
tel12	pat 1 TERMINAL
	while "c&&!1" put "\r" wait -f2
	if !c fail
	pat 1 @
	put "D1\r"; wait -f40
	if !c fail
	if !1 o fail
	put "C 202202\r"
	return
tym24	wait -f5
	in !c fail
	put A pat 1 "log in"; wait
	put "%s1\r"; return
tym12	pat 1 x; wait
	if !c fail
	put A pat 1 "log in"; wait
	if !c fail
	put "%s1\r"; return
xsetup	port 1; : if !c speed 1200 putw "ATZ\r"
	pd1; pz480	: turn on time stamping, set PST timezone
	set mprefix ATDP	: Pulse Dial
	: set mprefix ATDT	: Tone Dial
	set mcommand "gosub mm224"
	: set mcommand "gosub dial"
	set l "1"; set m "1"
	set answerback "\r\nYOUR NAME CITY\r\n\21"
	: ps8 :set C/G status line attribute to dim
	: set phones "c:/phones.t"
	echo "Resetting Function Keys"; reskeys
	set f3 @rb;  set f4 "@echo Working...;  gosub tlearn"
	set f6 "@accept s2 Receive-File: rc %s2"
	set f7 "@accept s1 Send-File: sx %s1"
	: set f8 "\PXXXXX"
	: accept xpassword "\E[mMaster Password: \E[8m"; lput "\E[m"
	set f9 "@gosub add"
	if fyamhelp.t set helpfile "yamhelp.t"; set f10 "@help"
	if f/zmanh.hlp set helpfile "@!yhp /zmanh.hlp zmain"; set f10 "@help"
	if fzmanh.hlp set helpfile "@!yhp zmanh.hlp zmain"; set f10 "@help"
	set fs1 "@find speed %phones"
	set fs2 "@accept s1 Name:; find \n%s1 %phones"
	set fs3 "@find \\\;\r %phones"
	set fs4 "@speed 1200 putw ATH\r"
	set fs5
@accept s1 "System name to call: "; queue add " call %s1"; queue list
	set fs6
@lput "Queue Entries:\n"; queue list; echo "Working..."; queue run
	: display bell=visual
	set emdir /memo; set twxfile twx;
	: set call1 ATZ\r\336ATZ\r
	set call2
@bye; sleep 3; putw "ATZ\r"; sleep 5; putw "ATX1 M0 S0=1\r"; clears
	: (AT commands above are repeated to make sure modem obeys them)
	: set callpath /tmp/*.xx?
	set outahost
@bye; putw "ATZ\r"
	:::  DO NOT USE BACKSLASHES FOR FILENAMES
	: set calllog c:/calllog
	: set rxlog c:/tmp/rxlog
	: set txlog c:/tmp/txlog
	: set tmp /yam/tmp
	: set lib /yam/lib
	set quitcmd \003\336off\r
	if dc ps4 pn3 pr97	:if RGB, cyan, red stat, color rev video
  : if dc ps11 pn14 pr30 :if RGB, yellow on black & rev. blue /w lt. bl. status
	return
setup	echo "Running ..."
	set mprefix ATDP	: Pulse Dial
	: set mprefix ATDT	: Tone Dial
	p-1; set mcommand "gosub dial"
	if da>1 goto setu1
	if !flocal.t gosub sinit; gosub .local.t; goto setu1
	gosub .local.t
	echo "Hello %s6 %s7."
	lput "Has your phone number or port configuration changed\r\n"
	lput "since the last time you entered your name (y/n) ?"
	if y del local.t; gosub sinit; gosub .local.t
	if c gosub carrier
setu1:	if dd pd1; pz480
	pe0
	set f3 @rb;  set f4 "@echo Working...;  gosub tlearn"
	set f5 "@accept s1 Send-File(s): sz %s1"
	set f6 "@accept s2 Receive-File: rc %s2"
	set f7 "@accept s1 Send-File: sx %s1"
	: set f8 "\PXXXXX"
	set f9 "@gosub add"
	set fs1 "@find speed %phones"
	set fs2 "@accept s1 Name:; find \n%s1 %phones"
	set fs3 "@find \\\;\r %phones"
	set fs4 "@speed 1200 putw ATH\r"
	set fs5
@accept s1 "System name to call: "; queue add " call %s1"; queue list
	set fs6
@lput "Queue Entries:\n"; queue list; echo "Working..."; queue run
	if fyamhelp.t set helpfile "yamhelp.t"; set f10 "@help"
	if f/zmanh.hlp set helpfile "@!yhp /zmanh.hlp zmain"; set f10 "@help"
	if fzmanh.hlp set helpfile "@!yhp zmanh.hlp zmain"; set f10 "@help"
	if da>1 return
	: return : uncomment this line to remove automatic menu startup
	sets menu %phones
	cls; goto cmdch
demo	cls
cmdch:	pv0; echo " ZCOMM Beginner's Menu "
	display nlmode nooverstrike
	lput "\ns  Generate a script with AI \E[1mTurboLearn Script Writer\E[m(Tm)\n"
	if fnewscr.t lput "e  Execute your new script in newscr.t\n"
	lput "f  Flash-up HELP Processor\n"
	lput "a  Add a new system entry to the Telephone Directory\n"
	lput "c  Compuserve Online Demo (requires modem)\n"
	lput "d  Dial telephone number and connect\n"
	lput "g  Go Local (Direct Connection)\n"
	lput "h  Host Operation demo (dial-in)\n"
	lput "l  List file names in current directory\n"
	lput "n  Newest files listed first\n"
	if !dS lput "o  Display Ordering Information\n"
	lput "r  Review (circular buffer search/cut/paste) demo\n"
	lput "t  Call Telegodzilla (Omen's Software Downloading System)\n"
	lput "u  Utility command demo\n"
	lput "x  eXit to DOS\n"
	lput "z  exit to ZCOMM command prompt\n\n"
	display nonlmode
choos:	acceptl1 s1 "Please enter your menu choice "
	if is1,a gosub add; cls; goback cmdch
	if is1,c call cidemo; cls; goback cmdch
	if is1,d call xdnum; cls; goback cmdch
	if is1,e call .newscr.t;  goback choos
	if is1,f help; goback cmdch
	if is1,g call glocal; cls; goback cmdch
	if is1,h gosub host; host; return
	if is1,l dirr; goback choos
	if is1,n dirt; goback choos
	if is1,o gosub order; goback choos
	if is1,r kill; gosub review; goback choos
	if is1,s echo "Working...";  gosub tlearn; acceptl1 s0 "Hit Enter ";  goback cmdch
	if is1,t call telegodzilla; cls; goback cmdch
	if is1,u gosub udemo; cls; goback cmdch
	if is1,x x
	if is1,y goto quitt
	if is1,z goto quitt
	cls; echo "Unknown Command"; goback cmdch
udemo:	cls;  echo "Enabling debug output to show the commands"; pv4
	echo "The find command searches files for a string, case insensitive"
	find zcom *.t
	gosub ak
	echo "The sum command calculates Unix compatible file checksums"
	sum local.t
	gosub ak
	echo "Word Count: lines, words, printing characters, and characters"
	echo "The count of printing characters predicts ribbon usage!"
	wc *.t
	gosub ak
	echo "The crc command calculates a 32 bit file CRC useful for comparing"
	echo "Multiple copies of the same file for accurcacy and identity."
	echo "(Compatible with PKZIP's CRC)"
	crc local.t
	gosub ak
	cls
	echo "Paced upload transmission demonstration"
	echo "File Upload pacing is used with bulletin boards, etc."
	echo "Note the EXTRA delay at the end of each line"
	display nooverstrike
	open %phones
	echo "Let's just send a little bit from the END of the file"
	seek -120
	ph2; o; t -adhxtp
	close; pv0; dis -dah
	gosub ak
	return

73	speed 1200 %l-603-924-9809 t
amrad-bbs	speed 2400 %l-703-734-1387 t
amsat-bbs	speed 300 %l-512-852-8194 t
caf		speed 1200 %s8-3406\;
cidemo	speed 1200 set s1 "cis02"; gosub callcis
	pat 0 OK;
	pat 1i ID:
	pat 2 "please log in: "
	pat 3 "DISCONNECTED"
	pat 4 "?? LOG"
	pat 5i "more !"
	pat 6$ "!"
	pat 7i "continue!"
	wait;  put 77770,101\r
	pat 1i assword:; wait; if !1 goto cid2
	echo "Sending PASSWORD"; put FREE-DEMO\r
	wait
cid2:	if "3||2" echo " Login may be possible through a Compuserve Node "
	if "1||4||3||2" echo " Try Again Later "; o; sleep 50; return
	pat;
	pat 1i "menu !"
	pat 2i "page !"
	pat 3i "choice !"
	pat 4i "continue!"
	pat 5i "more !"
	pat 6$ "!"
	put \25s\r
	wait put "\025t\r"
	wait put "\0253\r"
	wait put "\025s 1\r"
	wait put "\025log\r"
	pat 1i ID:
	wait -f5
	echo "Good Bye Cruel World"
	close
	o
	gosub ak
	gosub review
	return
review	if !fcdemo echo "Sorry, the file \"cdemo\" is missing."; return
	kill; read cdemo
	del cut
	<revv
	review
	echo "Let's play with that file."
	echo "First, a word count"
	wc cut
	echo "Next, 32 bit file CRC, then a Unix style checksum"
	crc cut; sum cut
	sleep 100
	return

cis	speed 2400 nolog 239-6124
	pat 1i "^"
	while !1&&L<8 wait -f2 if !1 echo "Sending ^C" put "\3"
cis:	lput "\E[H\E[2J"
	lput "SIG Download Browse hot keys: F3=B Protocol F8=XMODEM F7=capture"
	lput "\E[2;24r\E[?6h\E[H"
	pat 1 ID:; wait
	put 70001,0001\r pat 1 assword:; wait; put "wrongo\r"
	pat 1 OK; pat 2 Plex!; pat 3 "\nFunction: "; pat 4 "!"
	set f3 "@source %lib/kcisdl.t"
	set f7 "@source %lib/ckcisdl.t"
	set f8 "@source %lib/xkcisdl.t"
	wait
	if n o return
	pat; t -fcs!p
	return
cis02	speed 2400 nolog 222-2151	: Compuserve via Tymnet 2400 bps
	pat 1i x; wait -f5 put A pat 1 "log in"; wait
	put "cis02;"; goto cis
cis02	speed 1200 nolog 222-0900	: Compuserve via Tymnet
	pat 1i x; wait put A pat 1 "log in"; wait
	put "\030cis02;" goto cis
cisdat	speed 1200 %l-604-687-7144	: Compuserve via Datapac
	sleep 25
	ena -t
	put "..\r"
	pat 1 "DATAPAC"
	wait -f4
	put "P 29400138\r"
	dis -t
	pat 1 "Name:"
	wait -f20
	put "cis\r"
	goto cis
cistel	speed 1200 295-3028		: Compuserve via Telenet
	pat 1 TERMINAL
	while !1 put "\r" wait -f1
	pat 1 @
	put "D1\r"; wait -f4
	if !1 o abort
	put "C 202202\r"
	goto cis

navobsy		speed 1200 %l-202-653-1079 t -u7e
	echo " type @tco for list of commands "
nbs		speed 300 %l-301-948-5717 t
nbs2		speed 300 %l-301-948-5718 t
oem		speed 1200 %s8 pat 1i \5;wait;put \1;sb;o
omen-tech	speed 1200 %s8 t
pl24	speed 2400 241-0496 goto pl1	: People-Link via Telenet
pl	speed 1200 295-3028		: People-Link via Telenet
pl1:	patt; patt 1 TERMINAL
	while !1 put "\r" wait -f1
	pf40 patt 1 @
	put "D1\r"; wait
	if !1 o abort
	put "set 0:33,64:1\r"; wait -f1
	put "c 312 63\r"
	pat 1 "PRESS <RETURN>:";  wait -f15;  put "\r"
	pat 1 "ID:";  wait -f15;  put "myacct\r"
	pat 1 "PASSWORD:";  wait -f15;  put "nothis\r"
	set f9 "/next\r"; set f10 "/dlo;fil;xmo;\r\r"
	t
source1200	speed 1200 295-3028	: The Source via Telenet
sourcex:	set  f7 "upi n b "
	set  f9 "upi n g "
	set f8 ",-,*,rb"
	set f10 ",-,*,sb"
	pf3
	patt; patt 1 TERMINAL
	while "L<5&&!1" put "\r" wait -f1
	if !1 off
	pf40 patt 1 @
	put "D1\r"; wait
	if !1 o abort
	put "c 30124\r"
	kill; patt; patt 1 SOURCE; wait
	if !1 o abort
	putw "id ABC123 notthis\r"
	patt; pat 10c "-More-" "@put \r lput \r\E[A\E[2M\E[A"
	pf9999; wait
source300	speed 300 295-3028	: The Source via Telenet
	goto sourcex
telegodzilla	speed 1200 %s8-3746
	ena -Z; display overstrike; cls
	pat 1 "ease:"; wait -f20
	if !1||!c echo "Access Failed"; o; return
	put "\b\b%s6 %s7\r"; pat 1 ect;wait -f2
	put "y"; pat 1 "-Host"; wait -f5
	set s0 "TeleGodzilla"
tele1:	echo "You are now Online to \42%s0\42."
	echo "Type F1 when done."; pat;  t -Z!vn
	lput "\Ez Do you wish to disconnect (y/n) "
	if y echo " Disconnecting ... ";put \25\4; wait -f2; o; return
	echo " **************  Rewinding the Capture Buffer  ************** "
	rewind; wait -f0; goto tele1

vms	speed 9600;  display vt100;  set bs "\177";  set rubout "\b";  z pd30
	t

host	echo " host " speed 1200
	set welcome welcome.txt
	set password Ritchie
	set challenge challeng.txt
	set unrestrict "CustomerSupport"	: WARNING - CHANGE THIS!!
	set xhelpfile xyamhelp.t
	set private private; set messages messages
	set emdir "."; set twxfile twx;
	set call2 ATZ\r\336\336ATM1X1S0=1\r\336ATM1X1S0=1\r\336\336
	set outahost "@pk512; putw ATM0H1\r"
	set baudstr "@gosub baud"
	pc40
	return

sinit	pv0;  cls
	echo "    Initial setup for ZCOMM with ZMODEM, WXMODEM, etc.        "
	echo "             I need some phone information.                    "
	accept s6 " Your \E[1mFirst\E[0m name please "
	accept s7 " Your Last name please "
	set s8 ""
getac:	accept s8 " Please enter your 3 digit telephone area code, plus <Enter> "
	if !%s8 goto getac
	echo "I need access numbers for the Compuserve Information Service."
	: if dd lput "Shall I search for them (y/n) ?"
	: if dd if y echo "300/1200 bps Access Numbers"; find "%s8 " cisnodes.lst
	echo "Just hit <Enter> if your modem doesn't have the indicated speed."
	accept s3 " Please enter the 1200 baud local Compuserve Node phone Number "
	accept s2 " Please enter the 300 baud local Compuserve Node phone Number "
	accept s5 " Please enter the 1200 baud local Tymnet Node phone Number "
	accept s4 " Please enter the 1200 baud local Telenet Node phone Number "
	echo "Creating disk file 'LOCAL.T' for future reference"
	kill; pv0; create -y local.t
	echof " :Area Code is \042%s8\042"
	if %s2 echof " set s2 \042%s2\042"
	if %s3 echof " set s3 \042%s3\042"
	if %s4 echof " set s4 \042%s4\042"
	if %s5 echof " set s5 \042%s5\042"
	if %s6 echof " set s6 \042%s6\042"
	if %s7 echof " set s7 \042%s7\042"
	echof " set s8 1-503-621"
	lput "\EzAre you using a Color Monitor? (y/n) "
	if y echof " if dd&&dc ps4 pn3 pr97 pu6"; ps4 pn3 pr97 pu6
	lput "\r\nIs your display adapter flicker/snow free? (y/n) "
	if y echof " if dd&&dc display warpdrive"; display warpdrive
	lput "\r\nIs your modem connected to COM2? (y/n) "
	if y echof " port 2"; port 2
	lput "\r\nDo you use DTMF (TouchTone) dialing? (y/n) "
	if y echof " set mprefix ATDT"
	lput "\r\nDoes your modem include 2400 bps or higher? (y/n) "
	if y echof " set mcommand \"gosub mm224\""; set mcommand "gosub mm224"
	close; echo "file created"
	if dd echo "Searching for directory entries with your area code"
	if dd find l-%s8- %phones
	if dd echo "Please change the %phones lines shown above to suit your area."
	if !is8,503 return
	kill; pv0; create -+ local.t
	lput "Is 621-3746 (Burlington Exchange) a local call for you ? (y/n) "
	if y echof " set s8 621"
	else echof " set s8 1-621"
	close; return
quitt:	echo "   Type 'menu' to return to this menu   "
	if Jf10,@ echo "       Press F10 for Flash-Up Help      "
	echo "\n\n  The following ABORT message is normal "
	abort
carrier	lput " Type \ESy\Eq if the modem is now connected to a computer: "
	if y echo "OK, just checking"; sleep 30; return
	lput "\r\n\nAlthough ZCOMM can operarte with the modem's\r\n"
	lput "Carrier Detect signal always on, this script (and most other\r\n"
	lput "scripts) require the Carrier Detect signal to read the actual\r\n"
	lput "modem status.  Please adjust the modem accordingly; on the Hayes\r\n"
	lput "SmartModem 1200, switch 6 should be UP. "
	off
xdnum	cls
	if jmcommand,mm224 sp 2400; goto xd1
	lput "Use 2400 Baud (y/n) ? "
	if y speed 2400;  goto xd1
	lput "Use 300 Baud (y/n) ? "
	if y speed 300; goto xd1
	speed 1200;  echo "1200 Baud, then."
xd1:	accept telno "Enter Telephone Number: "
	if !%telno return
	if Jmcommand,2 gosub mm224
	if Jmcommand,l gosub dial
	sets s0 "%telno"
	goto tele1
glocal	cls;  display nonlmode
	lput "Use Port 2 (y/n) ?"
	if y port 2
	else port 1
	gosub askspd
	set s0 "Local"
tele9:	echo "You are now Online to %s0."
	echo "Type F1 when done."; pat;  t -Z!v
	lput "\Ez Finished talking now (y/n) "
	if y goto tele2
	echo " **************  Rewinding the Capture Buffer  ************** "
	rewind; wait -f0; goback tele9
tele2:	lput "\Ez Do you wish to disconnect (y/n) "
	if y echo " Disconnecting ... ";put \25\4; wait -f2; o
	source local.t
	return
order	if forder display overstrike; page order; return
 cls display overstrike
 lput "ZCOMM Registration, Typeset Manual Pages, ZSNP, and update disk sell for $40.00.\r\n"
 lput "                 (Add $10 if you wish a PC-size binder)\r\n"
 lput "\r\n"
 lput "       Send check to Omen Technology, PO Box 4681, Portland OR 97208\r\n"
 lput "Please see Chapter 3 of the ZCOMM User's Manual for more information."
 lput "\r\n"
 return
baud	pat 1 "CONNECT\r\n"; pat 2 "NO CARRIER"
	pat 5 "CONNECT 1200\r\n"; pat 3 "CONNECT 2400\r\n"
	pe-20
	wait -Ef25
	dis -E
	if 1 speed 300 return
	if 5 speed 1200 sleep 20 return
	if 3 speed 2400 sleep 20 return
	kill create -+ rings
	close
	fail

	: inittb initializes the TrailBlazer NVRAM for these scripts
	: It may be necessary ot change the 9600 speed below if the
	: NVRAM has been set to a strange value by somebody else
inittb	sp 9600; ena -t; gosub waketb
	putw "aaaaat&F S0=0 S7=45 S50=0 S52=1 S53=1 S54=1 S58=3 S68=3\r\336\336"
	putw "AAAATS51=255 \r\336\336"
	putw "aaaatS111=255 S95=0 S92=1 S52=2\r\336\336"
	putw "aaaATJ6S39=3\r\336\336"	: MNP bugfix magic incantation
	putw "aaaAT&W\r\336\336"
	return

	: initmm initializes the MultiTech error correcting 224 NVRAM 
	: Change &E14 to &E15 to enable MNP compression
initmm	speed 2400;  pat; pat 0 OK; pat 1 ERROR
	put "AT &C1 E1 V1 X4 B1 &E0 S0=0 S7=45 S11=80 Q0\r"; wait -f5
	if 1 echo "ERROR: cycle power on the modem and retry this script"; abort
	put "AT &D3 &C1 &T5 &E7 &E8 &E10 &E14 \44BA1 &B1\r"; wait -f5
	put at&w\r; wait -f5
	return

	: initc24e initializes the US Robotics Courier 2400E
initc24e	speed 2400;  pat; pat 0 OK; pat 1 ERROR
	put "AT &F E1 V1 X6 B1 &G0 &Y1 S0=0 S7=45 S11=80 Q0\r"; wait -f5
	if 1 echo "ERROR: cycle power on the modem and retry this script"; abort
	put at&w\r; wait -f5
	return

	: inithv96 initializes the Hayes V9600 NVRAM 
inithv96	bye;  sleep 20;  speed 2400;  pat; pat 0 OK; pat 1 ERROR
	set s1 "K4"; if dF set s1 "K3"
	put "AT &F V1 X4 W1 B1 &K0 &Q5 S36=1 S37=0 S0=0 S7=45\r"; wait -f5
	if 1 echo "ERROR: cycle power on the modem and retry this script"; abort
	put "AT &D3 &C1 &R1 &%s1 &T5 &W0 &Y1 &W0\r"; wait -f5
	return

	: initfc initializes a Fastcomm 2496t high speed modem
initfc	sp 9600; gosub waketb
	putw "AT #LDN #LCN S57=2 #W\r";  return

	: initsm initializes a Hayes Smartcom 2400
initsm	putw "at &c1 &d2 x3 v1 e1 q0 &s1 s7=45\r"; sleep 5; putw at&w\r
	return

	: initax9624 inits a Microcom AX/9624c MNP Class 6 modem	
initax9624	bye;  sleep 20;  speed 2400;  pat; pat 0 OK; pat 1 ERROR
	set s1 "\\Q1"; if dF set s1 "\\Q3"
	put "AT &F V1 \\V1 &D3 Q0 E1 &C1 \\N0 X4 %s1 S0=0 S7=45\r"; wait -f5
	if 1 echo "ERROR: Reset the modem and retry this script"; abort
	put "AT &W\r"; wait -f5
	return

	:: If you change the speed below, you MUST change the speed in
	:: specially commented lines in mm224 and call2h !!!!
inithst	speed 19200; gosub waketb
	speed 19200; put "AT&F &B2 &M0\r";  wait -f4
	put "AT&A3 &K3\r";  wait -f4		:: enable v.42bis
	put "AT&W\r"; wait -f4
	return


	:: Generate a script with TurboLearn Script Writer(TM)
tlearn	set fa10 "" :: telephone number, and flag that telno was entered
	if c goto connected
	cls
	accept fa10 "Enter Telephone Number "
ag1:	accept fa1 "Enter Speed (300, 1200, 2400) "
	if ifa1,2400 speed 2400 goto ag2
	if ifa1,1200 speed 1200 goto ag2
	if ifa1,300 speed 300 goto ag2
	echo "Bad speed"; goback ag1
ag2:	lput "\r\n1	System uses IBM PC (ANSI) line drawing characters\r\n"
	lput "2	System uses 7 bits even parity\r\n"
	lput "3	System uses 8 bits No parity (8n1)\r\n"
	lput "\r\n"
	acceptl1 fa2 "Choose one of the above: "
	lput "\r\n"
	ena -8n
	@%fa10
	if !c echo "Sorry, no connection"; return
	set fa5 ""
	if ifa2,1 ena -8g; set fa5 "ena -8g"
	if ifa2,2 ena -7e; set fa5 "ena -7e"
connected:
	echo "Finish with F1.  Use ALT-B to send a break if necessary"
	learn -y tlrn.tmp
cn2:	if !r echo "WARNING: Learning (recording) terminated prematurely!"
	close
	kill
	create newscr.t
	if !r abort
	echo "Is this to become a Telephone Directory entry (y/n)?"
	if !y goto nodir
	accept fa6 "What directory entry name to use? "
	echoc "%fa6	speed %fa1 %fa10 %fa5"
nodir:	close;  set fa2 ""
	echo "Should the script disconnect the phone line (y/n) ?"
	if !y "!tlearn tlrn.tmp >>newscr.t"; goto scdone
	set fa2 "bye;  return"
	echo "Should the script then exit to the Operating System (y/n)?"
	if y  set fa2 "off"
	!tlearn -r tlrn.tmp >>newscr.t
	create -+ newscr.t; echof "	%fa2";  close
scdone:	echo "Your new script is in the file 'newscr.t' !!"
	if %fa10 echo "You may add this file to your Telephone Directory"
	if %fa10 echo "Or execute it with 'call %fa6.newscr.t'";  return
	echo "You may execute this file with 'source newscr.t'"
	return

	:: Add a telephone directory entry
add	if r close
	cls
	echo "Create New Phone Directory Entry"
xg0:	accept fa3 "Enter new directory name: "
	p?0
	lput "Searching for duplicate name"
	find "\n%fa3" %phones
	if ? echo "Please choose another name"; goback xg0
	accept fa4 "Enter Comments for this number: "
	accept fa10 "Enter Telephone Number: "
xg1:	accept fa1 "Enter Speed (300, 1200, 2400, 9600, 19200): "
	if ifa1,19200 speed 2400 goto xg2
	if ifa1,9600 speed 2400 goto xg2
	if ifa1,2400 speed 2400 goto xg2
	if ifa1,1200 speed 1200 goto xg2
	if ifa1,300 speed 300 goto xg2
	echo "Bad speed"; goback xg1
xg2:	lput "\r\n1	System uses IBM PC (ANSI) line drawing characters\r\n"
	lput "2	System uses 7 bits even parity\r\n"
	lput "3	System uses 8 bits No parity (8n1)\r\n"
	lput "\r\n"
	acceptl1 fa2 "Choose one of the above: "
	lput "\r\n"
	set fa5 ""
	if ifa2,1 set fa5 " -8g"
	if ifa2,2 set fa5 " -7e"
	kill; pv0; create -+ %phones
	if !%fa4 goto nobanr
	echoc "%fa3	speed %fa1 echo \42%fa4\42 %fa10 t%fa5"
	close; return
nobanr:	echoc "%fa3	speed %fa1 %fa10 t%fa5"
	close; return

	:: Login script for Byte Information Exchange
bix		speed 19200  222-2151+222-0900
		pat 1 "log in"
		pat 2 "error" "\r"
		pat 3 "user name:"
		pat 5 "host shut"
		wait -f4; put "A"; wait -f2
		set s9 "login"; pf15
bix:		put "BIX\r"
		pat 4i "ame?"; wait
		if 5 fail
		if "c&&!4" goback bix
		if jargs,new put "new\r";  t; quit
		put "accntname\r"
		pat 1i "assword:"; wait
		dis -h;  put "notthis\r"
		if dZ zmodem pl8192	:: Temporary - see manual
		if dZ ena -yZ		:: Disable ZMODEM Challenge to save time
		if jargs,h ena -h
		pat; pat 1$ "\n:"
		wait
		if "hYou have [*1-9]" source bixmaild.t
		expand bixmailu.t 002*
		if jargs,off off
		t

genie		speed 1200 287-9045
		lput "\E[H\E[2J"
		lput "\E[1mDownload hot key: F3=XMODEM F8=OverThruster\E[m"
		lput "\E[2;24r\E[?6h\E[H"
		ena -7e; pat 1 "U#"
		while "c&&L<8&&!1" put "\r" wait -f2
		if !1 echo "No Response from Genie"; o; fail
		pat 2 "PASS"
		while !2 put "abc12345,\r"  wait -f5
		put "abcd\r"
gen3:		set f3 "@set s5 xx; source %lib/gekxdl.t"
		set f8 "@set s5 x; source %lib/gekxdl.t"
		pO20; if S>2400 pO40
		ph2; ena -h
		t; ret
dial	pat
	if "%telno<2" echo "Please do not use \"call dial\""; abort
	bye
	if "%mprefix<2" goto mandial
	pat 9 K\r\n; ena -d
	put "ATZ\r"; wait -f3; if !9 wait -f3
	if !9 put "AT E1 Q0 S7=60 V1 X1\r"; wait -f3
	if "!9&&S>1201" speed 1200 put "ATZ\r"; wait -f3; if !9 wait -f3
	if "!9&&S>301" speed 300 put "ATZ\r"; wait -f3; if !9 wait -f3
	if !9 put "AT E1 Q0 S7=60 V1 X1\r"; wait -f3
	if !9 echo "No response From MODEM"; fail
	sleep 4
	put "ATS6=3 S8=4 S0=0\r" wait -f2
	pat 1l CONNECT; pat 2 "NO CARRIER"; pat 3 "BUSY"; pat 4 RING;
	pat 0c ";"
	dis -d
	put %mprefix; putw %telno\r
	if 0 wait -f30; accept s1 "Hit ENTER to Hang Up"; o; return
	wait -f60
	while "4&&!L>3" wait -f30
	while "!c&&L<20" sleep 1	: Some modems are slow on carrier det
	if 1 pat; return
	if !9 bye
	pat; bye; fail
	echo "fail DIDN't FAIL!!"
mandial:	echo "Please dial %telno, type 'y' when connected, 'n' if failed"
	if y return
	fail

