From: birchall@pilot.njin.net (Shag)
Newsgroups: comp.os.msdos.pcgeos
Subject: Re: GeoComm script questions
Date: 14 Oct 92 07:41:40 GMT
Organization: Screaming in Digital, the Queensryche Net Digest

wilson@hsi.com (John Wilson) writes:

>Howdy!

>I have a couple questions about the scripting language for GeoComm (running
>GeoWorks PRO under DOS 5, internal 2400 baud modem).

>I am having problems making the 'MATCH' command do what I think it should
>be doing.

>I would like to do something like:

>DIAL 1800###
>PROMPT ## 				(to wait for the connection)
>MATCH "CONNECT" GOTO somewhere		(which logs me in)
>MATCH "BUSY" GOTO somewhereelse		(which tells me to get coffee)
>MATCH "CARRIER" GOTO someplace		(which tells me to check the modem)
>PRINT "failed all matches.  Get help", CR

>My problem is that it always fails on all of the matches.

You've just got the PROMPT command in the wrong place.  Try:
DIAL	[number]
MATCH	"CONNECT"	GOTO [login routine]
MATCH	"BUSY"		GOTO [busy/retry routine]
MATCH	"CARRIER"	GOTO [alert you to check things]
PROMPT	[timeout period]
GOTO	[script failure message and end]

For an example of how you can use this type of thing repeatedly, I'll include
my internet login script [with a few key fields edited out. ;)]

; Internet automated logon
; $ld: i_net.mac,v 1.0.0.0 92/04/26 23:07:00 shag Exp $
;
; Shag's modem is an external PPI 14400, running off COM 2.
; The Internet dialin prefers 8-N-1 parity and VT100 emulation.
PORT	2
COMM	19200-8-N-1-FULL
TERM	VT100
;
; Clear the Display
;
CLEAR
;
PRINT	"Dialing ShagNET..."
:dialin
DIAL	"[My Number]"
MATCH	"CONNECT"	GOTO	connect
MATCH	"BUSY"		GOTO	retry
PROMPT	3600
GOTO	done
;
:retry
PRINT	"Busy.",CR
PAUSE	300
GOTO	dialin
;
:connect
PRINT	"Connected.",CR
:loop
SEND	^M
MATCH	"whitman>"	GOTO tacacs
PROMPT	60
GOTO	loop
;
:tacacs
PRINT	"Logging in...",CR
SEND	"128.6.7.38",CR
;
MATCH	"login:"	GOTO	username
PROMPT	2700
PRINT	"Timeout on Login",CR
GOTO	loop
;
:username
SEND	"birchall",CR
;
MATCH	"Password:"	GOTO	password
PROMPT	600
PRINT	"Timeout on Login",CR
GOTO	done
;
:password
SEND	"[My password]",CR
;
MATCH	"incorrect"	GOTO	log_fail
MATCH	"Vt100"		GOTO	terminal
PROMPT	1800
PRINT	"Timeout on Login",CR
GOTO	done
;
:log_fail
PRINT	"Login Failure",CR
GOTO	done
;
:terminal
SEND	"",CR
;
MATCH	"gTerm"		GOTO	software
PROMPT	600
GOTO	done
;
:software
SEND	"G",CR
;
MATCH	")"		GOTO	success
PROMPT	600
GOTO	done
;
:success
PRINT	"Script Successful",CR
BELL
END
;
:done
PRINT	"Script Aborting",CR
SEND	"+++"
MATCH	"OK"		GOTO 	dohup
PROMPT	300
PRINT	"Couldn't disconnect the modem",CR
GOTO	end
;
; Hangup the connection
;
:dohup
SEND	"ATH0",CR
MATCH	"OK"	GOTO	hangup
PROMPT	300
PRINT	"Timeout on hangup",CR
GOTO	end
:hangup
PRINT	"Modem hung up",CR
:end
BELL
END

This script calls into a CISCO dialup, gets a prompt, connects to the machine
I use, logs me in, selects a terminal type, and selects a terminal _program_
type [an extra question I added to my login file, since I use terminal progs
that handle backspace/delete differently].  It can fail if something times
out, anywhere along the line, or if the password doesn't work.  

Eventually I plan to re-code it so that a failure at one point [say, the
connection from the dialin to the machine] fails [due to the link being down]
so that instead of aborting altogether, it will maintain the connection to 
the dialin, and make repeated attempts to connect to the machine and proceed.

-Shag
-- 

     Freedom belongs to only those without video screens for eyes and mouth.
		- Queensryche