Category : Communication (modem) tools and utilities
Archive   : CA29-3.ZIP
Filename : LEARN.DOC

 
Output of file : LEARN.DOC contained in archive : CA29-3.ZIP
COM-AND LEARN Script










---------------------------------------
COM-AND LEARN Script
Script generator (learning) for COM-AND
---------------------------------------




COM-AND, and the LEARN script are copyright 1992 by CABER Soft-
ware. COM-AND is distributed freely and may be copied by anyone
for any number of machines, for purposes of evaluation. The
author offers COM-AND and its accessory programs as "shareware".
If you USE the program after evaluating it, you MUST pay for it.



The complete user license and registration information is to be
found in the file REGISTER.DOC. Limitations on redistribution
of COM-AND are set out in the file VENDOR.DOC. These two files
are included with the COM-AND program release.



CABER Software
R. (Scott) McGinnis
P.O. Box 3607 Mdse Mart
Chicago, IL 60654-0607

GEnie, Delphi: TARTAN
CIS .......... 73147,2665
Internet ..... [email protected]











Version 1.0: 921012

COM-AND LEARN Script


Table of Contents
-----------------

I. Introduction .............................................. page 1

A. What is COM-AND? ........................................ page 1
B. The LEARN script ........................................ page 1

II. Running LEARN .............................................. page 2

III. LEARN function ............................................. page 3

IV. LEARN commands ............................................. page 6

ESC Exit LEARN ......................................... page 6
F1 Load accessory ..................................... page 6
F2 Execute script ..................................... page 6
F3 Change drive:subdir ................................ page 6
F4 Set default download subdir ........................ page 6
F5 Toggle line/char ................................... page 7
F6 Toggle learn hold .................................. page 7
F7 Toggle logging file ................................ page 7
F9 Toggle log hold .................................... page 7
F10 Information screen ................................. page 7
Alt-C Clear screen ....................................... page 8
Alt-E Toggle echo ........................................ page 8
Alt-D Dial ............................................... page 8
Alt-G Toggle blankline ................................... page 8
Alt-H Hangup ............................................. page 8
Alt-L Toggle 25/43 ....................................... page 8
Alt-Q Toggle CR/CRLF ..................................... page 8
Alt-N Encrypt/decrypt .................................... page 9
Alt-P Set comm parms ..................................... page 9
Alt-Z Toggle masking ..................................... page 9
PgUp Upload ............................................. page 9
PgDn Download ........................................... page 10

Alt-F10 Shell to DOS ....................................... page 10
Alt-0/9 Send macro ......................................... page 10
Ctl-End Send break ......................................... page 10
Ctl-Prt Toggle print ....................................... page 10

V. Modifying Scripts .......................................... page 11

VI. Program Requirements ....................................... page 12

VII. Program and Author Information ............................ page 13




Version 1.0: 921012

COM-AND LEARN Script Page 1


I. Introduction


A. What is COM-AND?


COM-AND for the IBM PC and compatibles is a communications
program for use by itself, or for use with several integrated
accessory programs (which themselves may be used independently of
COM-AND). COM-AND provides standard comm program functions: a
dialing directory, macros, disk logging, binary and ASCII file
transfers, scripted execution and the usual schtick.


B. The LEARN script


LEARN.CMD was created at Mike Todd's request, to aid in the
writing of scripts. LEARN generates a script by 'comprehending'
(in a limited sense) the actions taken. The generated script
mimics the learned session. LEARN provides many COM-AND functions
(e.g. DIAL (Alt-D), Accessories (F1) macros (Alt-0/9), and so on)
within its environment.


This document discusses the function of the LEARN.CMD script.
























Version 1.0: 921012

COM-AND LEARN Script Page 2


II. Running LEARN


The LEARN script is invoked through COM-AND's script processor (F2).
When invoked, LEARN first asks for a script file name. When this
request is satisfied, LEARN then displays a screen with:

. a received text area
. a keyboard buffer
. a summary of available commands
. a status line


The LEARN script adjusts to the screen size in use. You may wish to
use LEARN in 43 line mode generally (if you have an EGA or VGA adap-
tor), to provide a maximum space for received text.


LEARN logs the initial state of COM-AND (options, comm parms, and so
on) to the output file when the file is created. If you enter LEARN
with 43 screen lines, a SET 43 is placed at the beginning of the
output file. You may edit this out after exiting LEARN, or during
the LEARN session.


Note: any subdirectory/drive change you perform within LEARN is
'cancelled' when you exit LEARN. Similarly, the screen from which
LEARN was executed is restored.






















Version 1.0: 921012

COM-AND LEARN Script Page 3


III. LEARN function


LEARN follows your actions. When a key is pressed, its equivalent
is displayed in the keyboard display. When RETURN is pressed, the
entire line (limited to 60 characters) is transmitted, and WAITFOR/
TRANSMIT statements are written to the output file. For example:

WAITFOR ""
;*IF NOT WAITFOR GOTO ...
TRANSMIT ""


LEARN writes a WAITFOR, a comment, and a TRANSMIT statement to the
output file. The WAITFOR waits for the last line of text received.
The comment is to remind the potential author that the WAITFOR may
time out, and the action should be tested. The TRANSMIT sends the
equivalent of what was typed out the comm port.


Should no text have been received between the last transmit and the
current transmit, LEARN write the following comments to the output
file:
;
; WAITFOR may be needed here
;


Initially, LEARN is in a 'LINE' mode. Text is buffered, and trans-
mitted only when RETURN is pressed. Some BBSes use single characters
and control characters as commands. LEARN may set to a 'character'
mode with the F5 toggle (see below). In 'CHAR' mode, each character
typed results in the WAITFOR/comment/TRANSMIT statements described
above.


Special functions (such as Alt-D dialing, macros, and so on) may be
performed within LEARN. The appropriate script statements are added
to the output file. The special functions LEARN supports are listed
in the following chapter.


When LEARN is exited, the output file is closed, and COM-AND is reset
to a condition similar to that when LEARN was entered. The real work
starts when LEARN is exited and you must edit the script!





Version 1.0: 921012

COM-AND LEARN Script Page 4


III. LEARN function (continued)


LEARN cannot capture some actions taken on-line. For example, when
dialing PLINK direct, connecting to PLINK's modems requires one step
LEARN cannot accomodate. For example:

... initial state settings
LEGEND "Script learned: "*"08/10/1989"
PRINTER OFF
SET CHAT OFF
SET KBDB OFF
; Dialing
DIAL "1"
IF FAILED
EXIT
ENDIF
WAITFOR "2400"
;*IF NOT WAITFOR GOTO ...
TRANSMIT "!"
;
; WAITFOR may be needed here
;
TRANSMIT "!"
WAITFOR "USER ID:"
;*IF NOT WAITFOR GOTO ...
TRANSMIT "id!"
WAITFOR "PASSWORD:"
;*IF NOT WAITFOR GOTO ...
TRANSMIT "password!"
... and so on

The above script was generated by entering LEARN, pressing Alt-D,
selecting entry #1, pressing CR twice, and typing "id" followed by
"password". When this script is executed, it does not connect.
PLINK's modems require a 5 second pause between the time the local
modem reports carrier, and the first CR is pressed. The appropriate
script would be:

... as above
IF FAILED
EXIT
ENDIF
PAUSE 5 ; Added for PLINK's modems
TRANSMIT "!"
TRANSMIT "!"
WAITFOR "USER ID:"
... and so on


Version 1.0: 921012

COM-AND LEARN Script Page 5


III. LEARN function (continued)


Further, many actions taken on-line are the result of 'decisions'.
A decision is made according to the last text received. For example,
logic to enter a file library and search for files with a certain
keyword may be captured directly by LEARN. However, the decision to
download none, or a file (or files) must be made on the response to
the search. LEARN does not capture alternatives (decision-making
logic). LEARN simply captures what happened as a script.


Extensive editing of the resultant script is recommended. LEARN
serves as a means to capture SOME of the actions taken on-line, and
as an aid to the process of script writing.



































Version 1.0: 921012

COM-AND LEARN Script Page 6


IV. LEARN commands


ESC Exit LEARN

When you press ESC it may not take immediately. LEARN flags
the fact ESC was pressed, and acts upon it as soon as all
output is complete. When LEARN executes the ESC, a window
is raised to query 'are you sure?'. If the response is 'n',
LEARN continues. If the response is 'y', LEARN ends.

F1 Load accessory

LEARN pops-up a window to display the current accessory dir-
ectory. PgDn, PgUp, Home, and End scroll through the window.
To select an accessory, enter the number. After an accessory
is selected, LEARN warns you that execution of an accessory
terminates LEARN. An "ACCESSORY #" statement is added to the
output file, and the accessory is executed.

F2 Execute script

LEARN pops-up a window to request the name of a script file.
The script must exist. LEARN warns you that the invocation
of another script terminates LEARN. An "EXECUTE