home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1994 February
/
psl_9403.zip
/
psl_9403
/
DOS
/
UT_SYSTM
/
AUTOSC.ZIP
/
AS.DOC
< prev
next >
Wrap
Text File
|
1993-12-01
|
143KB
|
3,326 lines
AutoScript
Version 2.0
User's Manual
Copyright 1992,93 by Larry Michaels
All rights resevred
Table of Contents
Shareware Notice - Registration......................................1
Registration Form....................................................2
Liability Disclaimer.................................................3
1. Introduction.................................................4
1.1 What is AutoScript...........................................4
1.2 Uses of AutoScript...........................................4
1.2.1 Making Program Demos.........................................4
1.2.2 Automated Software Testing...................................4
1.2.3 Automated Task Scheduling and Execution......................5
1.2.4 Increasing Productivity......................................5
1.3 System Requirements..........................................5
1.4 Summary of Features..........................................5
1.4.1 Keyboard Features............................................6
1.4.2 Screen Features..............................................6
1.4.3 Script Control Features......................................7
1.4.4 System Features..............................................7
1.4.5 Miscellaneous Features.......................................8
2. Starting AutoScript..........................................8
2.1 General Notes................................................9
2.2 Installing AutoScript........................................9
2.3 Loading AutoScript..........................................10
2.4 Configuration Settings......................................11
3. AutoScript Operation........................................13
3.1 Pop-up Windows..............................................13
3.1.1 Settings Window.............................................13
3.1.2 Actions Window..............................................13
3.2 AutoScript Modes............................................14
3.3 Extended Keyboard Buffer....................................14
3.4 Key Repeat..................................................14
3.5 Key Click...................................................15
3.6 Blanking the Screen.........................................15
3.7 Locking the Keyboard........................................15
3.8 Saving/Displaying Text Screens..............................16
3.9 Copying Screen Text to a FIle...............................16
3.10 Printing Screen Text........................................16
3.11 Stuffing Text Files.........................................17
3.12 Incremental File Names......................................17
3.13 Recording Scripts...........................................17
3.13.1 Recording Keystroke Delays and Keyboard Status Changes......18
3.13.2 Inserting Comments..........................................19
3.13.3 Inserting Other Commands....................................19
3.14 Appending Scripts...........................................19
3.15 Playing Scripts.............................................20
3.15.1 Pausing Play................................................20
3.15.2 Changing Settings During Play...............................20
3.15.3 Single-Stepping.............................................20
3.15.4 Locking Keyboard During Play................................20
3.15.5 Using Text Files as Scripts.................................21
3.16 Assinging Script Play Hot Keys..............................21
3.17 Batch Mode..................................................21
3.18 Unloading AutoScript........................................22
4. Creating Scripts With a Text Editor..........................23
4.1 Line and Block Comments......................................23
4.2 Commands and Comditions......................................23
4.3 Keystrokes...................................................24
5. Commands and Condition Descriptions..........................25
5.1 Commands.....................................................25
5.2 Conditions...................................................44
6. Utilities Included With AutoScript...........................51
6.1 Script Compiler..............................................51
6.2 Script Uncompiler............................................51
6.3 Screen Comparison Utility....................................51
6.4 KBRATE.......................................................52
7. Compatibility Issues.........................................52
8. User Support.................................................53
APPENDIX - New in Version 2.0.......................................54
Index to Commands and Conditions Reference..........................55
1
Shareware Notice - Registration
AutoScript 2.0 is distributed as SHAREWARE. This means that you may
try it out for up to 30 days for free. If you find AutoScript useful,
you are required to register by sending a registration form (included
below), along with any comments and suggestions, and a modest
registration fee of US $40. Your registration will:
1. Let me know that someone is using AutoScript.
2. Help me to continue making improvements and enhancements.
3. Entitle you to a receive a disk with a personalized copy of the
latest version of AutoScript, a copy of AutoScript Lite, a smaller,
version which plays existing script, free upgrades for 2 years,
and free telephone support.
Even if you do not intend to register, I would appreciate if you would
let me know what you do not like about AutoScript so that I might make
improvements, and perhaps fill your particular need.
Being that AutoScript is shareware, you are thankfully encouraged to
pass it on to friends, co-workers, associates, etc., to upload it to
BBSs, or otherwise distribute it, with the following conditions:
1. All files (ie. AS.EXE, AS.USG, AS.OVL, AC.EXE, AUC.EXE, ASCRN.EXE,
DEMO.SCR, AS.DOC, STARTING.DOC, READ.ME, and FILE_ID.DIZ) are
included without any modifications.
2. No fee is charged for the software, and only a modest fee, if any,
is charged for the distribution.
3. The recipient is aware or informed of the shareware concept and
how it works.
I hope that you will appreciate that a great deal of time, effort, and
resources went into developing AutoScript, and that you will register
your copy without having to be threatened to do so. I am most
interested in hearing from users as to how they are using AutoScript,
and suggestions for future enhancements. Although a serious effort has
been made to assure that the code is bug-free, there still exists the
possibility that some bugs may have escaped unnoticed. If any bugs are
found, I apologize in advance, and request that they quickly be brought
to my attention so that they can be corrected. Also, being that
AutoScript is a fairly complicated TSR program, it may not be compatible
will all hardware and/or software configurations, or all applications.
It does not work under MS windows.
Customized versions of AutoScript are also available. Please contact me
for more information.
AutoScript 2.0 Registration Form
Remit to: From:
AutoScript Registration _______________________________
Larry Michaels
15712 Hilton _______________________________
Southfield, MI 48075-6010
U.S.A. _______________________________
_______________________________
_______________________________
_______________________________
Phone:_________________________
Where did you get your copy of AutoScript?______________________
Registration US $40 per user Quantity:____ x $40 = ___________
Total: ___________
Disk: 5.25":____ 3.5":____
Comments:
3
Liability Disclaimer
No warranty, written, implied, or otherwise is made regarding the
suitability of AutoScript for any particular use. The author,
representatives, and/or distributor(s) can not and will not be held
accountable for any damages whatsoever, including, but not limited to,
the loss of data, loss of time, or loss of business, resulting from the
use or misuse of the AutoScript software. The user assumes
responsibility for determining the suitability of the software for any
given use.
4
Chapter 1 Introduction
This manual describes AutoScript's features and operation. I hope that
you will find AutoScript to be useful.
1.1 What is AutoScript
AutoScript is a powerful TSR (Terminate and Stay Resident) program which
AutoScript can record your keystrokes, type keystrokes as if they were
being typed at the keyboard, perform various tasks such as clearing the
screen, generating sounds, saving screen text, and deleting files,
check various conditions such as text on the screen, which application
is running, or data in memory, and act accordingly, and much more.
AutoScript also provides screen blanking, keyboard repeat, expanded
keyboard buffer, keyclick, screen text copy and print, text screen save,
text file insertion, keyboard locking, batch mode, as well as many other
features, all in one program.
AutoScript records and plays "scripts". Scripts are binary files which
contain keystrokes and/or commands, and are limited in size only by disk
capacity. As a script is played, keystrokes in the script are "typed" by
stuffing them into the PC's keyboard buffer, as if they were being typed
at the keyboard. Commands in a script can control how a script is played,
as well as various aspects of you PC's operation.
1.2 Uses of AutoScript
AutoScript provides many features and has numerous uses. The following
sections describe a few uses for AutoScript.
1.2.1 Making Program Demos
AutoScript is ideal for creating demos of almost any DOS application.
You can create a demo of your application, without making a single
modification to it, by recording your keystrokes while running the
application, and then playing back the recorded script at demo time.
AutoScript can preserve the delays between keystrokes so that at
playback time, keystrokes "typed" by AutoScript will appear as though
they were being typed by a user at the keyboard. Scripts can be
scheduled to be played at specific times, and can contain loops,
providing the facility for long-running, unattended demo operation.
The keyboard lock and key enable/disable features allow you to restrict
which keypresses, if any will be allowed to affect your application.
Conditional branching within a script enables you to make your demos
more dynamic, allowing them to respond to conditions such as text on the
screen or the name of the current process.
1.2.2 Automated Software Testing
AutoScript is also a powerful automated software testing tool.
AutoScript can record all keystrokes while running your application,
providing you with an accurate record of you testing sequence, and
allowing you to painlessly repeat that sequence any number of times to
properly test you application after making changes and/or corrections.
5
Variable-speed play and single-step mode permit you to play back your
recorded script at different speeds, or one key at a time. The various
conditional tests which AutoScript can perform can quickly alert you to
bugs in you application by checking the contents of the display screen,
as well as RAM within your application's memory space, or anywhere else
in conventional memory. You can instruct AutoScript to check specific
bytes, words, double words, and strings within your application by
providing the segment and offset values which appear in the map file
produced by you linker. A separate utility lets you compare the
contents of text mode screens saved by AutoScript, displaying the
differences between two screens. Log statements within a script can
provide a useful audit trail during testing, allowing you to determine
what occurred at what time.
1.2.3 Automated Task Scheduling and Execution
AutoScript can handle many tedious and/or repetetive tasks, peforming
them unattended and automatically. The batch processing feature allows
you to schedule a task to be done, at any time, day or night, up to a
month in advance. You can even schedule tasks to be done every day at
the same time.
1.2.4 Increasing Productivity
AutoScript can help you boost your productivity with your PC. The
extended keyboard buffer will help you save time, allowing you to type
ahead up to 200 keystrokes, while the PC is doing something else, such
as writing to disk. The keyboard repeat feature can help you type
duplicate keys and move around large documents quickly in an editor.
The screen blanker can increase the life of your video display by
automatically blanking the screen after a set number of minutes or at
any time on demand. The screen saving, screen text copy and print,
and text file stuffing features allow you to save the screen, copy or
print selected portions of the screen, and insert the contents of any
text file, almost anywhere that keyboard input is required. By recording
the keystrokes for repetitive tasks in a script, such tasks can repeated
by a single keystroke.
1.3 System Requirements
AutoScript should run on any IBM AT or PS/2 or 100% compatible machine
with a hard disk, running DOS version 3 or higher. Some features may
require EGA or VGA video controllers.
1.4 Summary of Features
AutoScript provides a wide variety of features. This section provides a
list of AutoScript's features, grouped by category, along with a brief
description of each. For detailed instructions on how these features
work, please refer to the appropriate sections in this manual.
6
1.4.1 Keyboard Features
Extended keyboard buffer: Increases your PC's keyboard type-ahead
buffer size from 15 to 200 keystrokes.
Keyboard repeat: Lets you set your keyboard repeat rate and
delay.
Key click: Produces a "click" sound for each key pressed
at the keyboard or "typed" by AutoScript.
Keyboard lock: "Locks" your keyboard so that no keystrokes
will be accepted (not even Ctrl-Alt-Del) until
the password is entered.
Key enable/disable: Disables specific keys, or all but certain
keys. AutoScript will cause disabled keys to
be ignored.
Keyboard status changing: Turns on or off certain keyboard status bits
in the PC's keyboard status word. These bits
correspond to the pressing and releasing of
the left and right Shift, Ctrl, and Alt keys,
and the Num Lock, Caps Lock, and Scroll Lock
states.
1.4.2 Screen Features
Screen blanking: Blanks the PC's screen, either automatically,
after a given number of idle minutes, or on
demand at any time. You have the option of
whether or not the screen will be unblanked
when text is written to it.
Screen save/display: Lets you save the contents of any text-mode
screen, including the attributes and cursor
size and location, to a file. You can
display any screen which was saved using this
feature. For EGA and VGA video systems, you
can specify whether blinking or background
intensity should be enabled when a screen is
displayed.
Screen text copy: Lets you select a block of text, any size,
anywhere on a text-mode screen, and save it
to a file. The resultant file will be a
plain ASCII file.
Screen text printing: Lets you select a block of text, any size,
anywhere on a text-mode screen, and send it
to your printer.
Screen clearing: Clears the screen and video buffer.
7
Cursor hide/restore: Hides (makes invisible) the text cursor,
storing its size and location on the screen.
A hidden cursor can be restored to its saved
size and location.
Video mode setting: Sets the video mode to a specified value.
Writing to screen: Lets you draw a window and/or text, in any
attribute over the current text screen.
1.4.3 Script Control Features
Conditional execution: Controls script play by allowing commands or
blocks of commands to be either executed or
skipped, depending on the outcome of condition
checks. The conditions which can be chkecked
include: data in RAM, environment variables,
input from I/O ports, register values returned
by interrupt calls, variable values, the name
of the foreground process, screen contents,
and text on the screen.
Looping: Repeats the command(s) within a loop a fixed
or infinite number of times. Loops can be
exited based on conditions.
Delay: Pauses script play for a specified amount of
time. You can also specify in a script, a
standard delay which AutoScript will pause
between each command and/or keystroke.
During script play, you can tell AutoScript
to ignore these imbedded delays. You can
also set the maximum speed at which scripts
are played.
Wait until: Pauses script play until a specified time of
day arrives.
Waiting for a string: Pauses script play until a specified character
string is typed at the keyboard.
Play pause: Pauses script play until a specified key is
pressed or a specified amount of time elapses.
Script insert/change: Causes AutoScript to stop playing the current
script and begin playing another. You have
the option of whether or not AutoScript
should return to playing the original script
upon completion of the new script.
Single-stepping: When AutoScript is in single-step mode,
keystrokes in the script are "typed" one at a
time as the step key is pressed.
8
1.4.4 System Features
File deletion: Deletes the specified file.
Interrupt generation: Generates the specified interrupt with the
registers set to the given values.
I/O port output: Outputs a byte or word to an I/O port.
System pause: Pauses the foreground process until a key is
pressed.
Data save: Saves a byte, word, double word, or string
from the specified memory location. The
memory locations can be specified relative
to the start of system memory or relative to
the start or the current foreground process's
memory area.
Reboot: Reboots the PC. You can specify either a
"warm" (ie. the same as pressing Ctrl-Alt-Del)
or "cold" (ie. the same as pressing the PC's
reset button) reboot.
1.4.5 Miscellaneous Features
Variables: You can set, modify 10 user variables, as well
registers corresponding to the 80x86 registers.
Variables are also provided for the date and
time. The contents of these variables and
registers can be used as parameters in various
commands, be included in file name and text
strings, and and control conditional branching.
The registers can also be used in generating
interrupts and examining the results.
Beep/tone: Produces either a beep of fixed frequency and
duration, or a tone of specified frequency
and duration.
Alarm: Stops script play, and produces an alarm
sound which continues until a key is pressed.
Script play is resumed by pressing the unpause
key.
Text file stuffing: Stuffs the contents of a text file into the
keyboard buffer, as if they were being typed
at the keyboard. You can use this feature to
"paste" screen text saved with the Copy
screen text feature.
Batch mode: You can submit a batch file to AutoScript.
Batch files contain a list of script names
and associated dates and times. AutoScript
will play the scripts listed at the specified
dates and times.
Logging: Writes a given message, along with the time,
to a log file.
9
Chapter 2 Starting AutoScript
2.1 General Notes
AutoScript recognizes a number of "hot keys", as described later in this
chapter. A hot key can be either a single key on the keyboard, or a
combination of a key with a modifier key (ie. Ctrl, Alt, or Shift).
When referring to a numerical key, such as "4", the key on the main part
of the keyboard, and not on the numerical keypad, is meant. Most keys
are referred to by a simple, one-character name, such as "A", "B", "9",
etc.. Other keys such as the Spacebar, the Tab key, etc. are referred
to by longer names. The keys prefixed by "KP" are those on the numeric
keypad. Table 5-1 at the end of Chapter 5 lists all of the valid
multi-character key names. When a key includes a modifier, the
prefixes: "Ctrl-", "Alt-", and "Shft-" are used. Note that the Alt and
left and right Shift keys can also be used with modifiers. The
following are valid key combinations using the Alt and Shift keys:
Ctrl-LShift, Ctrl-RShift, Ctrl-Alt, Alt-LShift, and Alt-RShift.
The keystrokes which AutoScript records and plays are not the actual
keypresses, but the words which the PC's BIOS generates and places in
the keyboard buffer when keys are pressed. These keystroke words
consist of an ASCII character byte and a keyboard scan code byte. All
keyboard keys produce keypress codes, but not all result in a keystroke
word being generated. For example, the left and right Shift keys each
produce a unique code when pressed, but neither cause a keystroke word
to generated or placed in the keyboard buffer. The hot key names, as
well as the key names which are required as arguments in some of the
script commands correspond to the codes produced by the keyboard when
those keys are pressed, whereas the keystrokes which can be included
in scripts correspond to the words which are placed in the PC's keyboard
buffer.
2.2 Installing AutoScript
Your AutoScript distribution disk should contain the following files:
AS.EXE - The AutoScript program file
AS.OVL - An overlay file used by AutoScript
AS.USG - A data file used by AutoScript
AC.EXE - The script compiler program
AUC.EXE - The script uncompiler program
ASC.EXE - The screen compare utility program
KBRATE.EXE - A utility for setting the keyboard's repeat rate and delay
DEMO.SCR - A demo script file
To install AutoScript on your system, simply create a directory on
your hard disk named "AUTOSCR" (or any other name you prefer), and
copy all of the files on the distribution disk to the new directory.
You will probably want to add the new directory to the PATH statement in
your AUTOEXEC.BAT file. You may want to copy KBRATE to your utilities
directory.
10
2.3 Loading AutoScript
To load AutoScript, type "AS" along with any command-line options at
the DOS prompt, and press Enter. You should preferably not load
AutoScript from a DOS shell while within another application, as this
can lead to problems. AutoScript will load itself into your PC's memory
and return to DOS. Command-line options can be typed in either upper or
lower-case, and are prefixed by a '/' or '-' character. The following
are the command-line options:
/b<path> Start AutoScript in batch mode, using the batch file specified
by path. AutoScript will attempt to read the batch file, and
execute the scripts listed in it at the specified times.
/c<path> Use the configuration file specified by path instead of the
default file "AS.CFG".
/d Record delays between keystrokes. This option is valid only
in conjunction with the /r option. Using this option has the
same effect as setting Record Delays in the Record Script window.
/i<xx> Set the multiplex interrupt ID to the value xx (in
hexadecimal), instead of the value stored in the configuration
file. The default setting is 0BFh.
/k Record keyboard status changes. This option is valid only in
conjunction with the /r option. Using this option has the same
effect as setting Record Kbd Stat Changes in the Record Script
window.
/l<path> Use the name given by path for the log file instead of the
name stored in the configuration file. The default name is
"AS.LOG". If this option is used, all log output will be
written to the file with the specified name. If the log file
does not exist, it will be created.
/m Force monochrome. This option forces the pop-up windows to
appear in monochrome, even when a color monitor is used. This
option may be useful when running AutoScript on a laptop or
notebook PC.
/p<path> Start AutoScript in Play mode. This option has the effect of
causing AutoScript to immediately play the script specified by
path upon startup.
/r<path> Start AutoScript in Record mode. This option has the effect
of causing AutoScript to immediately start recording the script
specified by path upon startup.
/s Save screen contents to RAM instead of disk when displaying a
pop-up screen. This option will cause AutoScript to use about
4K more memory, but will make pop-up screens appear more quickly.
/u Unload AutoScript. Typing "AS /u <Enter>" at the DOS prompt
once AutoScript has been loaded will cause AutoScript to try
to unload itself and release the memory it was using. If
other applications have hooked any of the interrupts which
AutoScript was using, it will not be able to unload itself.
/? Display the command-line options.
11
2.4 Configuration Settings
When AutoScript is loaded, it looks for a configuration file which
contains values which affect its operation. You may specify the name of
the configuration file by using the /c command-line option. For
example, loading AutoScript by typing:
AS /cC:\MISC\MYCONFIG.CFG <Enter>
will cause AutoScript to look in the directory MISC, on drive C:, for
the file "MYCONFIG.CFG". If no configuration file name is given,
AutoScript will look for a file named "AS.CFG" in the current directory.
If this file is not found, AutoScript will search its home directory
(ie. the directory in which the currently running "AS.EXE" is located)
for the file. If no such file exists, AutoScript will create one in the
current directory, and store in it the default configuration settings.
Once AutoScript is loaded, you may wish to view and adjust the
configuration settings. Configuration settings can be viewed and
changed via the Settings pop-up window. To bring up the window, press
the Settings hot key. The current hot key setting is displayed whenever
"AS<Enter>" is typed at a DOS prompt, and the default key is Ctrl-4.
You will want to make sure that the hot key settings do not conflict
with keys used by the applications with which AutoScript will be used.
Note that wherever a reference to a numerical key (ie. "4", "5", etc.)
is made, the key referenced is the one on the main part of the keyboard,
and not on the numeric keypad.
The settings window displays, and allows you to modify the following
items:
Default Mode: The default mode to which AutoScript is set upon
start-up, or upon leaving Record or Play modes.
This is a multiple-choice item, and the choices are
Standby and Interactive.
Printer port: The port where data is sent when printing screen
text. This is a multiple-choice item. The choices
are LPT1, LPT2, and LPT3.
Scrn blank timeout: The number of minutes AutoScript waits for the PC to
be idle before it blanks the screen. The possible
values range from 0 - 255. A setting of 0 disables
this feature.
Unblank on scrn Controls whether or not AutoScript will unblank the
write: PC screen when data is written to the screen by the
PC's BIOS. This is a multiple-choice item.
Extended kbd Determines whether or not AutoScript will place the
buffer: user's keystrokes in an extended keyboard buffer.
This is a multiple-choice item.
12
Kbd repeat rate: Controls whether or not AutoScript's key repeat
feature is enabled and, if enabled, the number of
repeats per second. The possible values are in the
range 0 - 255, although a setting of more than about
100 will be too fast for many applications. Also,
depending on the speed of your PC and the
application that is running, a repeat rate which is
too high may cause a system "crash". A setting of 0
disables the key repeat feature, and permits the key
repeat to occur at the rate which is set in the PC's
keyboard.
Kbd repeat delay: The amount of time, in 18th's of a second, AutoScript
waits for a key to be held down before key repeat
begins. Valid settings are in the range 0 - 255,
although a setting of 0 will cause the key repeat to
begin as soon as a key is pressed. If the Kbd repeat
rate is set to 0, this setting will have no effect.
Max play speed: This setting limits the maximum speed at which
scripts are played.
Beep: Controls whether or not AutoScript will beep at the
beginning and end of script record and play and when
a key is pressed and the keyboard is locked. It
does not affect beeps caused by the Beep command in
a script. This is a multiple-choice item.
Key click: Controls whether or not keyboard click is enabled.
It affects the click for both keystrokes typed at
the keyboard, as well as keys "typed" by AutoScript
while playing a script. This is a multiple-choice
item.
Wait for disk: Determines whether or not script play is temporarily
suspended while the PC is accessing a disk. This is
a multiple-choice item.
Blink/bg intensity Determines whether blinking or background intensity
mode: should be enabled on EGA and VGA video cards when a
saved screen is displayed. When this item is set to
Blink, and a screen is displayed, any text in the
screen which has its blink attribute set will be
displayed blinking. When it is set to Intensity,
text with its blink attribute set will be displayed
with a bright background. This is a multiple-choice
item.
Multiplex ID: The multiplex interrupt ID used by AutoScript. It
may be set to any one-byte hexadecimal value, and
may also be set via the command-line when loading.
Log file: The name of the file to which AutoScript writes log
output. It may also be changed via the command-line
when loading AutoScript.
13
Batch file: The name of the batch file which AutoScript reads
when it is in batch mode. This file name is not
stored in the configuration file. It can be set
either by typing it on the command-line when
AutoScript is loaded (using the /b command-line
option), or by typing it on the appropriate line in
the Settings window. If a new file name is entered
on this line, AutoScript will automatically enter
batch mode (if it was not already in batch mode),
and begin reading the new batch file.
Record script: The hot key for putting AutoScript into Record mode.
Play script: The hot key for putting AutoScript into Play mode.
Stop recrd/play: The hot key for terminating script record and play.
Pause play: The hot key for pausing script play.
Repeat play: The hot key for replaying the last script played.
Blank scrn: The hot key for blanking the screen.
Settings: The hot key for bringing up the Settings window.
Actions: The hot key for bringing the Actions window.
To move around the Settings window, use the up and down arrow or Tab keys.
Multiple-choice items are changed using the spacebar. Hot keys are set
by pressing Enter, followed by the desired hot key. Pressing Enter twice
will set no key as the hot key, thereby effectively disabling the
particular feature. To save changes, press Ctrl-Enter. When changes
are saved, the configuration file is automatically updated to reflect the
changes. To exit the settings window without saving changes, press Escape.
Chapter 3 AutoScript Operation
3.1 Pop-Up Windows
3.1.1 Settings Window
The Settings window allows you to view and alter many parameters
affecting operation, as well as assigning hot keys. The items in this
window are described in Chapter 2.
To bring up the Settings window, press the Settings hot key. The
default key is Ctrl-4, but it can be changed in this window. Typing
"AS <Enter>" at a DOS prompt will cause AutoScript to display the
current Settings hot key.
3.1.2 Actions Window
Various actions can be performed via the Actions window. The
default hot key setting for bringing up this window it Ctrl-5, but it
can be changed in the Settings window.
14
The actions which can be done via this window depend on the mode in
which AutoScript currently is when the hot key is pressed. When
AutoScript is in Standby mode, the Actions hot key will be ignored. The
following actions can be done via this window:
Append Script: Interactive mode
Delay on/off: Record and Play modes
Beep: Record mode
Save screen: Interactive and Record modes
Display screen: Interactive and Record modes
Copy screen text: Interactive and Record modes
Print screen text: Interactive and Record modes
Stuff text file: Interactive and Record modes
Add comment: Record mode
Add command: Record mode
Single-step on/off: Play mode
Lock keyboard: Interactive and Play modes
Edit SP keys: Interactive mode
Unload: Interactive mode
To choose an action, press the key corresponding to the highlighted
letter in the name of the desired action, or use the up and down arrow
keys to move the highlight to the desired action, and press Enter.
Sections later in this chapter describe in detail how these features
work.
3.2 AutoScript Modes
AutoScript has four main operating modes: Standby, Interactive, Record,
and Play. In Standby mode, AutoScript ignores all hot keys except for
the Settings and Blank Screen hot keys. In Interactive mode, all
assigned hot keys are recognized. In Record mode, AutoScript records
scripts, and in Play mode, scripts are played.
When AutoScript is loaded, it enters its default mode, either Standby or
Interactive mode, depending on the configuration setting, unless the /p
or /r command-line options are used. You can change the default mode at
any time via the Settings pop-up window. The default mode is also the
mode to which AutoScript returns when it leaves Record or Play modes.
3.3 Extended Keyboard Buffer
When the extended keyboard buffer feature is enabled, your PC's internal
keyboard buffer is effectively increased in size from 15 to 200 keys.
Making use of this extended buffer allows you to type ahead up to 200
keys even though the application you are running is not yet ready to
accept them. This feature can be turned on or off via the Settings
window.
3.4 Key Repeat
When the key repeat feature is enabled, AutoScript will automatically
begin repeating a keystroke when a key has been held down for a
specified amount of time. Keys repeated by the keyboard are ignored.
The repeat delay (ie. the amount of time AutoScript waits before
repeating) and the repeat rate can be set via the Settings window.
15
Setting the repeat rate to 0 disables this feature, and causes
AutoScript to allow key repeat to occur at the delay and rate set in the
PC's keyboard. It is generally not recommended that you use this
feature unless you need to have a key repeat rate greater than 30
repeats per second (the highest rate available from the keyboard). The
reason is that some applications rely on the keyboard for key repeat
interrupts and therefore some compatibility problems may arise. The
utility KBRATE allows you to alter your keyboard's key repeat rate
and delay.
3.5 Key Click
When key click is enabled, AutoScript generates a click sound every time
a key is pressed or repeated, as well as every time a key is "typed" by
AutoScript while playing a script. Key click can be turned on or off
via the Settings window, as well as by the ClickOn and ClickOff
script commands. Since many PCs already have their own built-in key
click, the default setting in Off. If you want key click for keys
"typed" by AutoScript, you must turn this feature on.
3.6 Blanking The Screen
When the screen blanking feature is enabled, AutoScript will blank the
PC's screen after the specified amount of idle time has elapsed, or when
the blank screen hot key is pressed. The screen blank timeout and hot
key can be set via the Settings window. You can also specify whether or
not the screen should be unblanked when the BIOS writes data to video
memory. After the screen has been blanked, AutoScript will unblank it
upon any keypress. The screen can also be blanked and unblanked by the
BlankScrn and UnblankScrn script commands.
3.7 Locking The Keyboard
When the keyboard is locked, AutoScript prevents all keystrokes from
reaching the foreground process. Even keystrokes which cause BIOS
actions, such as Print Screen, Ctrl-Alt-Delete, and Ctrl-C, are
disabled. Also disabled are changes in the Caps Lock, Num Lock, and
Scroll Lock states. If Beep is enabled (in the Settings window),
AutoScript will generate a beep in response to every keypress when the
keyboard is locked.
The keyboard can be locked by either choosing the Lock Keyboard
action in the Actions window, or by a LockKbd script command. When
you lock the keyboard using the Lock Keyboard action, you will be
prompted to enter a password. The password may be between 1 an 10
characters in length, and may contain any combination of numbers and
letters, as well as any other characters which can be typed without the
help of the Shift, Ctrl, or Alt keys. No distinction is made between
upper and lower-case letters. For example:
ABC=123 is a valid password, whereas
ABC*? is not a valid password.
When the keyboard is locked with a LockKbd script command, a NULL
password (ie. a string with length 0) is also allowed.
16
The keyboard can be unlocked either by typing the password, or by the
UnlockKbd script command. If a NULL password is given, the keyboard
will remain locked until an UnlockKbd command is executed.
3.8 Saving/Displaying Text Screens
AutoScript allows you to save any text-mode screen to a file, and to
display saved screens. When AutoScript saves a screen, it saves the
video mode, the cursor size and location, the number of rows of text, as
well as all of the characters and attributes on the screen. The screen
can be saved either by choosing the Save Screen action in the
Actions window, or by a SaveScrn script command. When you choose
the Save Screen action, you will be prompted to enter a file name. If
you choose this action while in Record mode, a SaveScrn command will be
inserted in the script being recorded.
Saved screens can be displayed, either by choosing the Display
Screen action in the Actions window, or by a DisplScrn script
command. When you choose the Display Screen action, you will be
prompted to enter a file name. AutoScript will automatically set the PC
to appropriate video mode, fill the screen, and display the cursor as it
was in the saved screen.
3.9 Copying Screen Text to a File
AutoScript allows you to copy some or all of the text on a text-mode
screen to a file. The resulting file will be an ordinary text file with
a newline character pair (ie. 0Dh, 0Ah) at the end of each line. Using
this in conjunction with the Stuff Text File feature, you have the
ability to "cut and paste" text between applications.
You can copy screen text either by choosing the Copy Screen Text
action in the Actions window, or by a CopyScrnTxt script command.
When you choose the Copy Screen Text action, a block of a different
color will appear in the upper-left corner of the screen. Using the
arrow and Tab keys, position the block on the upper-left corner of the
block of text which you wish to copy. Next, press the Spacebar, and
then extend the highlighted area, using the arrow and Tab keys, to cover
the entire block of text, and press Enter. You will then be prompted to
enter a file name. Pressing Escape at any time during this process will
terminate this action. If you choose this action while in Record mode,
a CopyScrnTxt command will be inserted in the script being recorded.
3.10 Printing Screen Text
Similar to the copy screen text feature, AutoScript also allows you to
send a block of text on a text screen to your printer. You can do this
either by choosing the Print Screen Text action in the Actions
window, or by a PrntScrnTxt script command. The procedure for
selecting the text to be printed is the same as that for copying screen
text. If you choose this action while in Record mode, a PrntScrnTxt
command will be inserted in the script being recorded.
17
3.11 Stuffing Text Files
AutoScript allows you to stuff the contents of any text file into the
keyboard buffer. All characters in the file above 01Fh are stuffed into
the buffer, as are the HT (0Bh) and CR (0Dh) characters. All other
characters are ignored. When used in conjunction with the copy screen
text feature, this feature allows you to "cut and paste" between
applications.
You may stuff a text file either by choosing the Stuff Text File
action in the Actions window, or by a StuffTxtFile script command.
If you choose this action while in Record mode, a StuffTxtFile command
will be inserted in the script being recorded.
While stuffing a text file, AutoScript behaves in much the same way as
it does when playing a script. Therefore, the maximum play speed
setting affects the speed at which the file is stuffed, and single-step
mode can be used. Also, AutoScript will not lose any characters of the
file being stuffed because the application is not ready to accept them
(ie. the keyboard buffer is full). Instead, it will keep trying to
stuff each character until it is accepted.
3.12 Incremental File Names
For the save screen, copy screen text, and save data features,
AutoScript allows you to provide file names containing one or more
consecutive question marks. When AutoScript encounters a file name for
one of these three feature containing question marks, it replaces the
question marks with a number. Each subsequent time a file name
containing question marks is encountered, the number is incremented.
The numbering begins with 0, and the number is padded with 0s to replace
all of the question marks. Separate file numbers are stored for each of
the three features, and these numbers are reset to zero each time
a script is recorded. The maximum size of the numbers depends on the
number of consecutive question marks included in the file name. This
feature allows, for example, a script being played to create numerous
files, each with a unique name, with only one command included in a loop.
As an example, if your script contains several commands, or one command
within a loop, to save the screen to a file with its name given as
"SCRN???.SAV", the files created will be named "SCRN000.SAV",
"SCRN001.SAV", "SCRN002.SAV", and so on.
File names specified in script commands can also contain variables or
registers. The value in the specify variable will be expanded into text,
and included in the file name. See chapter 5 for details.
3.13 Recording Scripts
Scripts can be created by running AutoScript in Record mode. In
this mode, all keystrokes and most actions are recorded in a script.
You can enter Record mode either loading AutoScript with the /r
command-line option, or by pressing the Record hot key after AutoScript
is loaded.
18
To begin recording via the command-line, load AutoScript by typing: "AS
/rfilename [/d] [/k]" at the DOS prompt, where filename is the name of
the script file to be created, and "/d" and "/k" are optional, depending
on whether you want AutoScript to record delays and/or keyboard status
changes (see the next section). If AutoScript was already loaded, this
command will have no effect. Once AutoScript has finished loading
itself, it will immediately enter Record mode. If Beep is enabled,
AutoScript will beep to inform you that it has begun recording.
To begin recording while AutoScript is loaded, press the Record
Script hot key. The default setting is Ctrl-1, but it can be changed
via the Settings window. AutoScript will prompt you to enter a script
name, a unique hot key for playing back the script, a description, and
whether or not delays and keyboard status changes should be recorded.
The script name must be a legal DOS file name. Filling in the other
fields is optional. To assign the script a hot key, press the desired
key combination at the Key field. Any key combination will be accepted,
except for Enter, Ctrl-Enter, Esc, Ctrl, LShift, RShift, and Alt. To
bypass the Key field, press Enter. The Description field can be filled
with any text. This text will be stored as a comment at the beginning
of the script. The Record Delays and Record Kbd Stat Changes
fields control whether or not delays and/or keyboard status changes will
be recorded (see the next section). To check these fields, use the
Spacebar. To uncheck these fields, press Delete. To begin recording,
press Enter at the last field or Ctrl-Enter at any field. To exit
without recording, press Esc. When you exit this window by pressing
Enter or Ctrl-Enter, AutoScript will immediately enter Record mode. If
Beep is enabled, AutoScript will beep to inform you that it has begun
recording.
When you have finished recording, press the Stop Record/Play hot key
combination. The default setting is Ctrl-3. If Beep is enabled,
AutoScript will beep to inform you that it has terminated recording.
AutoScript will then save the script to a file, and return to the
default mode.
3.13.1 Recording Keystroke Delays and Keyboard Status Changes
When recording a script, you have the options of recording the delays
between keystrokes and/or commands and changes in the keyboard status.
When recording delays is enabled, AutoScript will automatically record
the time elapsed between keystrokes and commands by inserting the
appropriate Delay commands into the script. Time elapsed while in a
pop-up window (eg. the Actions window) is not included in the recorded
delays.
Recording delays is useful for preserving the time relationships between
various keystrokes which will cause the playback to appear more natural,
as if someone were actually typing at the keyboard. Recording the time
delays also may help insure that keystrokes are not lost by the
application being run by AutoScript. Although AutoScript will not lose
any keystrokes during playback (ie. if the keyboard buffer is full,
AutoScript will keep trying to push the keystroke into the PC's keyboard
buffer until it is successful), some applications discard keystrokes
which they are not ready to process.
19
Recording keyboard status changes means that AutoScript will record the
changes in keyboard status which result from every press and release of
the Ctrl, Alt, and Shift keys, as well as the state changes in the Caps
Lock, Num Lock, and Scroll Lock states. It is only necessary to record
these changes when the application being run during playback actually
uses this information. Recording or not recording these keyboard status
changes has no effect on the keys actually recorded. For example, if an
uppercase "G" is typed, a "G" will be recorded even if the keyboard
status change (ie. the pressing of the Shift or Caps Lock keys) is not.
3.13.2 Inserting Comments
At any time while recording a script, a comment may be entered into the
script by choosing the Add Comment action in the Actions window. You
will be prompted to enter the text of the comment. Any text can be
typed on the prompt line.
3.13.3 Inserting Commands
While in Record mode, several actions in the Actions window have effects
on the script being recorded. Choosing the Delays On/Off action causes
AutoScript to start or stop recording the delays between keystrokes.
This feature may be useful when only certain keystrokes in the script
are time-critical. In such a case, you might begin recording with the
record delays option off, turn it on for a few keystrokes, and then turn
it off again.
The Save Screen, Display Screen, Copy Screen Text, Print Screen Text,
and Stuff Text File actions also result in the corresponding commands
being inserted into the script.
Pressing Ctrl-C, Ctrl-Break, Pause, Print Screen, and SysRq while in
Record mode will cause AutoScript to record the corresponding command.
Pressing a key after the Pause key will cause AutoScript to record an
Unpause command.
You may also enter any other commands into the script by choosing the
Add Command action, and typing a command line as you would include in a
text file being submitted to the script compiler. More than one command
may be typed on the prompt line, providing that the last command fits
in its entirety. See Chapter 5 for descriptions of the script commands.
3.14 Appending Scripts
You may add to an existing script by choosing the Append Script action
in the Actions window. When you choose this action, you will be
prompted for the script name, and whether or not the keystroke delays
and keyboard status changes are to be recorded. This prompt window
works the same as the Record Script window, except that it does not
contain fields for a hot key or description. When you exit this window,
AutoScript will enter Record mode, and append recorded keystrokes and
commands to the end of the specified script.
20
3.15 Playing Scripts
Scripts can be played by loading AutoScript with the /p command-line
option, or once AutoScript is loaded, by either pressing the Play
Script hot key, and entering the script file name on the prompt line,
or by pressing the hot key for the particular script, if one has been
assigned. If you edit the last script played via its own hot key, you
must reload the script using the Play Script or Repeat Play hot keys
(or play or record another script) before pressing its hot key again.
The reason for this is that AutoScript stores the last script played
in its internal memory, and will be unaware that changes have occurred
to the script since it was stored. If Beep is enabled when a script is
played, AutoScript will beep to indicate that it has entered Play mode.
You can replay the last script played by pressing the sript replay hot
key (default Ctrl-6).
3.15.1 Pausing Play
While AutoScript is playing a script, you can pause play by pressing the
Pause Play hot key. The default setting is Ctrl-LShift. When this key
is pressed, script play will stop, and will not resume until either the
unpause key is pressed or an action is done. The unpause key is the same
as the pause key, but without the modifier. The default unpause key
therefore is LShift.
3.15.2 Changing Settings During Play
During script play you can change settings. The Settings pop-up window
is brought up the same way as it is in Interactive mode. When the
window is brought up, play is automatically paused. Any changes to
settings which affect script play, such as maximum play speed, will take
effect immediately after play is resumed.
3.15.3 Single-Stepping
While in playing a script, you can put AutoScript into single-step mode.
In single-step mode, AutoScript plays scripts one keystroke at a time,
pausing each time a keystroke is encountered in the script, and
advancing as the step key is pressed. Imbedded delays within the script
are ignored, and script commands are executed immediately as they are
encountered. This mode is useful for software testing. To turn on
single-step mode, choose the Single-Step On action in the Actions
window. When you choose this action, you will be prompted to press the
key which you want to be the step key. Any single key (without a
modifier) except Esc is valid. However, if the Alt key is pressed,
AutoScript will set the step key to ANYKEY, which means that all keys
will act as the step key. To turn off single-step mode, choose the
Single-Step Off action. Single-stepping can also be turned on and
off by the SingStepOn and SingStepOff script commands.
3.15.4 Locking Keyboard During Play
While playing a script, you can lock the keyboard just as you can in
Interactive mode. Script play will continue as normal, with the
exception that WaitForString commands in the script will be ignored.
21
3.15.5 Using Text Files as Scripts
You can provide the name of an ordinary ASCII text file anywhere a
script file name is required. If you do this, AutoScript will stuff the
contents of the file into the keyboard buffer as it does in the stuff
text file feature.
3.16 Assigning Script Play Hot Keys
AutoScript lets you assign up to 10 hot keys for playing individual
scripts. When you press one of these hot keys in Interactive mode,
AutoScript will immediately begin playing the script assigned to it. A
hot key can be assigned to a script at the time the script is recorded
by pressing the desired key at the Key prompt in the Record Script
prompt window, or at any other time AutoScript is in Interactive mode,
via the Edit SP Keys window.
To bring up the Edit SP Keys window, choose the Edit SP Keys action in
the Actions window. Move the cursor to the desired field using the up
and down arrow keys. To assign or change a hot key, press Enter at the
Key prompt, followed by the desired key. Pressing Enter again will assign
no hot key to the script. In this way, you can remove key assignments.
The key combinations: Esc, Ctrl-Enter, Ctrl, Shift, and Alt are not
accepted as hot key assignments. When entering a script file name, you
should provide the full path specification so that AutoScript will be
able to find the file regardless of the current directory. To save your
changes, press Ctrl-Enter, and to quit without saving changes, press Esc.
3.17 Batch Mode
AutoScript provides a useful batch mode feature. This feature allows
you to submit to AutoScript a list, in the form of a batch file, of one
or more scripts to be played at later times and/or dates. An unlimited
number of scripts can be specified, and each script can be given a
different date and time. Dates can be specified up to a month in
advance. In addition, you can have AutoScript play a particular script
at the specified time, regardless of the date, by typing "**" in place
of the date. You can also "chain" scripts so that they will be played
one immediately after another. For each batch script which you want to
be played immediately following the termination of previous script,
place a plus sign "+" in the first column of the line containing the
name of that script.
The format of the batch file is as follows:
dd-hh:mm:ss script file name 1
dd-hh:mm:ss script file name 2
: :
dd-hh:mm:ss script file name n (n is limited only by disk capacity)
22
In the above description, dd represents the day of the month (1-31), hh,
mm, and ss are the time of day in hours, minutes, and seconds,
respectively, expressed in 24-hour format, and script file name is the
name of the script file. You should include a complete path
description, including the disk drive letter. The characters separating
the dd, hh, mm, ss, and file name fields can be any character, providing
that exactly one character separates each field. The script file names
must begin in the 13th column of each line. To make AutoScript play a
script at the same time every day, place "**" in the date field. To
"chain" a script to the previous script, place "+" in the first column,
instead of the date and time. For example, a file which looks like
this:
21-13:27:00 script1.scr
21-22:00:00 script2.scr
+ script3.scr
+ script4.scr
**-23:45:33 script5.scr
will cause AutoScript to play "script1.scr" at 1:27 PM on the 21st of the
month, "script2.scr" at 10:00 PM on the same day, "script3.scr"
immediately after "script2.scr" finishes, and "script4.scr" immediately
after "script3.scr". A file which looks like this:
**-10:45:33 script1.scr
**-13:24:00 script2.scr
will cause AutoScript to play "script1.scr" at 10:45:33 AM and
"script2.scr" at 1:24:00 PM every day that AutoScript is loaded with
this batch file.
AutoScript can be placed in batch mode, either by using the /b
command-line option, followed by the batch file name, or by entering a
batch file name on the appropriate line in the Settings window. At any
time AutoScript is loaded, the batch file name can be entered or changed
in the Settings window. While AutoScript is in batch mode, it behaves
exactly as it does when not in batch mode, except that the scripts are
played at the specified times. If AutoScript is in Play or Record mode
when the time arrives to play a batch script, it will not play the batch
script immediately. Instead, it will wait up to 59 minutes to return to
Standby or Interactive mode, and then play the batch script.
To take AutoScript out of batch mode withou unloading, delete the batch
file name in the Settings window.
3.18 Unloading AutoScript
There are three ways to unload AutoScript: via the DOS command line,
by the Unload action in the Actions window, and by an Unload script
command.
To unload AutoScript via the DOS command line, at the DOS prompt (not
from a DOS shell within another application) type:
AS /u <Enter>.
23
AutoScript will try to unhook the interrupts which it was using, and if
successful, it will free its memory. If any of the interrupts were
hooked by another program, AutoScript will be unable to unload itself,
but will instead, deactivate itself and remain in memory. When trying
to unload AutoScript via the DOS command-line, AutoScript will respond
in such a situation with the message:
"Unable to unload",
Once AutoScript has been deactivated, it will ignore all hot keys, and
all features will be disabled. It will then be removable only via the
DOS command-line. To remove AutoScript, first remove all TSRs which
were loaded after it, as well as any applications which have hooked the
interrupts.
Chapter 4 Creating Scripts With a Text Editor
Scripts can be created and edited using any text editor. The resultant
text file is then converted into a binary script file using the
AutoScript script compiler (AC.EXE). Binary script files can be
converted to ASCII text files with the AutoScript script uncompiler
(AUC.EXE).
Text files submitted to the script compiler may contain the following
elements: line comments, block comments, commands, conditions, and
keystrokes. The following sections describe each of these elements.
4.1 Line and Block Comments
Line and block comments are ignored by the script compiler, and
therefore do not appear in the output script file. They should not be
confused with script Comment commands which are actually contained
within the binary script file, but are ignored by AutoScript during
script play. Line comments are delimited by a semicolon. The script
compiler will ignore all characters following a semicolon until the
beginning of a new line. Block comments are delimited by forward slash
"/" characters at the beginning and end of the comment. The compiler
will ignore all characters between two block comment delimiters. Line
and block comments may not occur within a command statement or a
keystroke string.
4.2 Commands and Conditions
Script commands and conditions may appear in either upper or lower-case
(or a mixture thereof), and may appear more than one per line, providing
they are separated by at least one white-space character (ie. space,
tab, or newline), and do not appear within a keystroke string. A wide
variety of features are provided by the script commands. Condition
checks provide for conditional branching capability within a script.
Chapter 5 describes all of the AutoScript script commands and
conditions.
24
4.3 Keystrokes
Text files submitted to the script compiler can also contain keystrokes.
A keystroke can be any ASCII character (including both upper and
lower-case letters), as well as keys such as F1, F2, Enter, Home, etc..
Some keystrokes may be prefixed by "Alt-", "Ctrl-", or "Shft-".
Keystrokes which are not defined by a single character, such as "Enter"
or "Alt-A", must be enclosed in brackets "< >". These keystrokes
represent a word consisting of an ASCII byte and a keyboard scan code
byte, and are what are actually placed in the PC's BIOS keyboard buffer
during script play, and read by the application program. Do not confuse
these keystrokes with hot keys and the key names which are given as
arguments for some script commands. Those keys represent the code bytes
which are produced by the keyboard when particular keys are pressed, and
may or may not correspond to words placed in the BIOS keyboard buffer.
Table 4-1 lists the multi-character names to be used for keystrokes.
Keystroke names which begin with "KP" refer the numeric keypad keys. To
include keystrokes in the script, type a string of keystrokes, enclosed
in quotes. The keystrokes \, ", and < must be preceded by a backslash \
character. The ASCII representation of the contents of the variables and
registers can be stuffed into the keyboard buffer as keystrokes by
including the syntax "\(var)" in the keystroke string, where var is one
or the variables or registers (see description of SetVal command). The
variable value can be stuffed in either hex or decimal format. To specify
hex format an 'H' is placed before the variable name. For decimal format,
a width specifier (1-6) may be included by placing a number before the
variable name. For example, is variable A has a value of 11, the
keystroke string: "\(HA)" will be expanded to "000B", while "\(3A)" will
expand to "011". The StuffVal and StuffValH commands can also be used
for this purpose.
A typical line in a text script file might look like this:
"EDIT A:\\MYFILE.SCA<Enter><F1><Esc><Alt-F><DArrow><DArrow><Enter>"
╔═════════════════════════════════════════════════════════════════╗
║ F1 F2 F3 F4 F5 F6 F7 ║
║ F8 F9 F10 F11 F12 Esc Bs ║
║ Tab Enter Space Ins Del Home End ║
║ PgUp PgDn LArrow UArrow DArrow RArrow KP/ ║
║ KP* KP- KP+ KP1 KP2 KP3 KP4 ║
║ KP5 KP6 KP7 KP8 KP9 KP0 KPHome ║
║ KPUArrow KPPgDn KPLArrow KPRArrow KPEnd KPDArrow KPPgDn ║
║ KPIns KPDel KPEnter ║
╚═════════════════════════════════════════════════════════════════╝
Table 4-1 - Keystrokes
25
Chapter 5 Command and Condition Descriptions
This chapter describes the syntax and usage of the script commands and
conditions. The syntax for a given command or condition is the same
whether it is included in a text file to be compiled by the script
compiler, or entered in the Add Command window during script recording.
In the following descriptions, anywhere that a number is required as an
argument, it may be specified in either decimal of hexadecimal format.
hexadecimal numbers are distinguished by a "h" as their last character.
For example: the number: "103" is equivalent to "67h". Whenever a
string argument needs to contain the characters " or \, the character
must be preceded by a backslash. Therefore, to include a quotation
mark, you would type \", and to include a backslash, you would type \\.
The string expansion of any variable or register can be included as part
of any string by placing the variable or register name in parenthesis after
the backslash. Either hex and decimal format may be specified. To specify
hex format, place an 'h' before the variable or register name. For decimal
format, a width specifier may be included. The variable expansion will be
padded to the left with zeroes to fill the specified width. For example,
if variable G contained a value of 12, the string "\(3G)" would expand to
"012", and "\(hG) would expand to "000C".
5.1 Commands
Command: Alarm
Purpose: Pauses play and produces an alarm sound which persists until
a key is pressed. Play will remain paused until the unpause
key is pressed. The unpause key is the same as the Pause Play
hot key without a modifier.
Syntax: Alarm
Example: If Not DataStrR(0,124h,"abcdef")
Alarm
────────────────────────────────────────────────────────────────────────
Command: And
Purpose: Used between two conditions. "AND"s the results of the
conditions.
Syntax: And
Example: If DataStrR(0,124h,"abcdef") And DataByteR(0,136h,a6h)
Log("Both string and byte match")
See Also: Else, If, Not, Or
────────────────────────────────────────────────────────────────────────
26
Command: Beep
Purpose: Generates a short beep.
Syntax: Beep
See Also: Tone
────────────────────────────────────────────────────────────────────────
Command: BeginBlock
Purpose: Denotes the beginning of a block. When used in conjunction
with conditions, if the condition is true, the commands
within the block are executed. If the condition is false,
the entire block is skipped. Blocks and loops may be nested
up to 10 levels deep.
Syntax: BeginBlock
Example: If DataStrR(0,124h,"abcdef")
BeginBlock
Beep
Log("String matched")
EndBlock
See Also: EndBlock, EscapeBlock, BeginLoop, EndLoop, EscapeLoop
────────────────────────────────────────────────────────────────────────
Command: BeginLoop
Purpose: Denotes the beginning of a loop. Loops are similar to
blocks, except that the commands contained within a loop may
be repeated a number of times. If a loop immediately
follows a condition, the entire loop is skipped if the
condition is false. Loops and blocks may be nested up to 10
levels deep.
Syntax: BeginLoop(NumRepeats)
NumRepeats: number between 1 and 65500 or a register or
variable name (see SetVal description). A
value of 65535 (ffffh) will cause an infinite
loop.
Example: SetVal(A,1)
BeginLoop(793) do this loop 793 times
"This is the \(A)th iteration of the loop.<Enter>"
ModVal(a,1,+)
Log("Looped again.")
EndLoop
See Also: BeginBlock, EndBlock, EscapeBlock, EndLoop, EscapeLoop
────────────────────────────────────────────────────────────────────────
27
Command: BlankScrn
Purpose: Blanks the PC's screen.
Syntax: BlankScrn
See Also: UnblankScrn
────────────────────────────────────────────────────────────────────────
Command: ClickOff
Purpose: Disables key click.
Syntax: ClickOff
See Also: ClickOn
────────────────────────────────────────────────────────────────────────
Command: ClickOn
Purpose: Enables key click.
Syntax: ClickOn
See Also: ClickOff
────────────────────────────────────────────────────────────────────────
Command: ClrScrn
Purpose: Clears the PC's screen and video memory.
Syntax: ClrScrn
────────────────────────────────────────────────────────────────────────
Command: Comment
Purpose: Denotes a script comment. The comment is ignored by AutoScript.
Syntax: Comment(TheComment)
TheComment: a text string, up to 60 characters in
length, enclosed in quotes.
Example: Comment("This is a comment")
────────────────────────────────────────────────────────────────────────
28
Command: CopyScrnTxt
Purpose: Copies the text from the specified region of a text screen
to a file.
Syntax: CopyScrnTxt(TopRow,LeftCol,BottomRow,RightCol,Filename)
TopRow,LeftCol,BottomRow,RightCol:
the top-left and bottom-right coordinates
of the text to copy. Row/column numbering
starts at 0,0.
Filename: the name of the file to which the text is
to be saved, enclosed in quotes.
Example: CopyScrnTxt(0,0,24,79,"screen.sav") copy all text on scrn
See Also: PrntScrnTxt, SaveScrn, ScrnTxtF
────────────────────────────────────────────────────────────────────────
Command: CtrlBreak
Purpose: Has the same affect as pressing Ctrl-Break on the keyboard.
Syntax: CtrlBreak
────────────────────────────────────────────────────────────────────────
Command: CtrlC
Purpose: Has the same affect as pressing Ctrl-C on the keyboard.
Syntax: CtrlC
────────────────────────────────────────────────────────────────────────
Command: Delay
Purpose: Delays script play for a specified number of clock ticks.
A clock tick is approximately 1/18th of a second.
Syntax: Delay(NumTicks)
NumTicks: a number between 1 and 65500, or the name of
any variable or register (see SetVal), the
number of clock ticks to wait.
Example: Delay(18) ;wait about 1 second
See Also: PausePlay, WaitForString, WaitUntil
────────────────────────────────────────────────────────────────────────
29
Command: DelFile
Purpose: Deletes the specified file.
Syntax: DelFile(Filename)
Filename: the name of the file to delete, enclosed in quotes.
Example: DelFile("C:\\files\\afile.abc")
────────────────────────────────────────────────────────────────────────
Command: DisableKey
Purpose: Disables the specified key. When you have specified one or
more keys to be disabled, AutoScript causes the disabled
key(s) to be missed by the foreground process. If you
specify one or more keys to be enabled (with the EnableKey
command), AutoScript causes all but the enabled key(s) to be
missed by the foreground process. You can enable or disable
up to a total of 20 keys. If no keys are yet enabled or
disabled when this command is encountered, AutoScript will
be set to disable the specified key. If AutoScript has
already been set to enable one or more keys, and the
specified key is in the key list, it will be removed from the
list. If the key is not in the list, the list will be
cleared, and AutoScript will be set to disable the specified
key. If AutoScript is already set to disable one or more
keys when this command is encountered, and the specified key
is not already in the list, it will be added to the list.
Syntax: DisableKey(Key)
Key: one of the keys as listed in Table 5-1.
Example: DisableKey(Tab) disable the Tab key
See Also: EnableKey
────────────────────────────────────────────────────────────────────────
Command: DisplScrn
Purpose: Displays a text screen which was previously saved.
Syntax: DisplScrn(Filename)
Filename: the name of the screen file, enclosed in quotes.
See Also: SaveScrn
────────────────────────────────────────────────────────────────────────
Command: Else
Purpose: Used after a condition. If the condition was true, the
following command, keystroke, block, or loop will be skipped.
If the condition was false, the following command, keystroke,
block, or loop will be executed.
30
Syntax: Else
Example: If DataStrR(0,124h,"abcdef")
Log("String matched")
Else
Log("String not matched")
See Also: And, If, Not, Or
────────────────────────────────────────────────────────────────────────
Command: EnableBlink
Purpose: Enables blinking or background intensity for screens
subsequently displayed by the DisplScrn command and Display
Screen action, on EGA and VGA displays. When blinking is
enabled, and a screen is displayed, any text in the screen
which has its blink attribute set will be displayed blinking.
When blinking is disabled (bg intensity is enabled), text with
its blink attribute set will be displayed with a bright
background.
Syntax: EnableBlink(X)
X: 0: disable blinking (enable bg intensity).
1: enable blinking
See Also: SetVidMode
────────────────────────────────────────────────────────────────────────
Command: EnableKey
Purpose: Enables the specified key. When you have specified one or
more keys to be enabled, AutoScript causes all but the
enabled key(s) to be missed by the foreground process. If
you specify one or more keys to be disabled (with the
DisableKey command), AutoScript causes the disabled key(s)
to be missed by the foreground process. You can enable or
disable up to a total of 20 keys. If no keys are yet
enabled or disabled when this command is encountered,
AutoScript will be set to enable the specified key (and
thereby disable all other keys). If AutoScript has already
been set to disable one or more keys, and the specified key
is in the key list, it will be removed from the list. If
the key is not in the list, the list will be cleared, and
AutoScript will be set to enable the specified key (and
thereby disable all other keys). If AutoScript is already
set to enable one or more keys when this command is
encountered, and the specified key is not already in the
list, it will be added to the list. If ANYKEY is given as
the key, all disabled keys will be enabled.
Syntax: EnableKey(Key)
Key: one of the keys as listed in Table 5-1.
Example: EnableKey(Enter) ;disable all keys but the Enter key
See Also: DisableKey
────────────────────────────────────────────────────────────────────────
31
Command: EndBlock
Purpose: Denotes the end of a block.
Syntax: EndBlock
Example: BeginBlock
"some keystrokes"
EndBlock
See Also: BeginBlock, EscapeBlock, BeginLoop, EndLoop, EscapeLoop
────────────────────────────────────────────────────────────────────────
Command: EndLoop
Purpose: Denotes the end of a loop. When this command is encountered,
AutoScript will return to the beginning of the loop if there
are more iterations left to do.
Syntax: EndLoop
Example: BeginLoop(10) ;loop 10 times
"some keystrokes"
EndLoop
See Also: BeginBlock, EndBlock, EscapeBlock, BeginLoop, EscapeLoop
────────────────────────────────────────────────────────────────────────
Command: EscapeBlock
Purpose: When this command is encountered, AutoScript will ignore all
commands and keystrokes until the end of the current block.
Syntax: EscapeBlock
Example: BeginBlock
"some keystrokes"
If DataStrR(0,124h,"abcdef") EscapeBlock
"some more keystrokes"
EndBlock
See Also: BeginBlock, EscapeBlock, BeginLoop, EndLoop, EscapeLoop
────────────────────────────────────────────────────────────────────────
Command: EscapeLoop
Purpose: When this command is encountered, AutoScript will ignore all
commands and keystrokes until the end of the current loop,
and no more loop iterations will be done.
Syntax: EscapeLoop
32
Example: BeginLoop(ffh)
If DataByteR(0,123h,6eh) EscapeLoop
Log("not finished yet")
EndLoop
Log("now we're finished")
See Also: BeginBlock, EndBlock, EscapeBlock, BeginLoop, EndLoop
────────────────────────────────────────────────────────────────────────
Command: GenIntr
Purpose: Generates an interrupt. The values that the registers are
to have when the interrupt is generated are set using the
SetRegister, SetVal, and/or ModVal commands. The values of
the registers immediately after the interrupt are saved for
use by the Register or Value condition.
Syntax: GenIntr(IntrNum)
IntrNum: the interrupt number.
Example: SetRegister(AH,12h) ;get video configuration
SetRegister(BL,10h) information
GenIntr(10h)
If Register(BH,0) Log("Color display installed")
Else Log("Monochrome Display installed")
See Also: Register, SetRegister
────────────────────────────────────────────────────────────────────────
Command: GetTime
Purpose: Gets the current date and time, and loads the Year, MONTH,
DAY, HOUR, MIN, and SEC variables.
Syntax: GetTime
Example: GetTime
WriteLine(10,10,4,"The date is: \(MONTH)/\(DAY)/\(YEAR)")
────────────────────────────────────────────────────────────────────────
Command: HideCur
Purpose: Saves the current location and size of the text cursor, and
then makes it invisible.
Syntax: HideCur
See Also: ShowCur
────────────────────────────────────────────────────────────────────────
33
Command: If
Purpose: Precedes a condition.
Syntax: If
Example: If DataStrR(0,124h,"abcdef")
Beep
See Also: And, Else, Not, Or
────────────────────────────────────────────────────────────────────────
Command: InsScr
Purpose: Plays the specified script, and then returns to the original
script.
Syntax: InsScr(ScriptName)
ScriptName: the name of the script to be played,
enclosed in quotes.
Example: InsScr("A:\\def\\myscript.scr")
See Also: LoadScr
────────────────────────────────────────────────────────────────────────
Command: KbdStatOff
Purpose: Turns off the specified bits in the PC's keyboard status
buffer, emulating the release of the Ctrl, Alt, and/or Shift
keys, and/or the turning off of the Caps Lock, Num Lock,
and/or Scroll Lock states.
Syntax: KbdStatOff(KbdStatDescr)
KbdStatDescr: any combination of the following letters:
A: Alt key
C: Ctrl key
S: Shift key
L: Left (in conj. with Alt/Ctrl/Shift)
R: Right (in conj. with Alt/Ctrl/Shift)
N: Num lock state
O: Scroll lock state
P: Caps lock state
Example: KbdStatOff(N) ;turn off Num lock state
KbdStatOn(LA) ;emulate pressing of left Alt key
KbdStatOff(LA) ;emulate release of left Alt key
See Also: KbdStatOn
────────────────────────────────────────────────────────────────────────
Command: KbdStatOn
Purpose: Turns on the specified bits in the PC's keyboard status
buffer, emulating the pressing of the Ctrl, Alt, and/or
Shift keys, and/or the turning on of the Caps Lock, Num
Lock, and/or Scroll Lock states.
34
Syntax: KbdStatOn(KbdStatDescr)
KbdStatDescr: as described for KbdStatOff.
Example: KbdStatOn(P) ;turn on Caps Lock state
See Also: KbdStatOff
────────────────────────────────────────────────────────────────────────
Command: LoadScr
Purpose: Causes AutoScript to play the specified script, and then
return to the default mode. Unlike the InsScr command, it
does not cause AutoScript to return to the original script
upon completion.
Syntax: LoadScr(ScriptName)
ScriptName: the name of the script to be played,
enclosed in quotes.
See Also: InsScr
────────────────────────────────────────────────────────────────────────
Command: LockKbd
Purpose: Locks the keyboard.
Syntax: LockKbd(Password)
Password: an ASCII string, up to 10 characters in
length, containing any combination of
letters and numbers, as well as any other
characters which can be typed without the
help of the Ctrl, Shift, or Alt keys,
enclosed in quotes.
Example: LockKbd("mypassword")
See Also: UnlockKbd
────────────────────────────────────────────────────────────────────────
Command: Log
Purpose: Stores the given string in the log file along with the date
and time.
Syntax: Log(LogString)
LogString: an ASCII string, up to 60 characters in
length, enclosed in quotes.
Example: If DataStrR(0,124h,"abcdef")
Log("String matched")
Else
Log("String not matched")
────────────────────────────────────────────────────────────────────────
35
Command: Mask
Purpose: Masks off the specified part of the screen for subsequent
screen comparisons. The next time the Screen condition is
encountered, the contents of masked parts of the screen will
not be compared. You can mask off up to five areas of the
screen. Masked areas may overlap. The screen masks are
cleared automatically when a script is played. You can also
clear the screen masks by giving this command with all zeros
as its arguments.
Syntax: Mask(TopRow,LeftCol,BottomRow,RightCol)
TopRow,LeftCol,BottomRow,RightCol:
the top-left and bottom-right coordinates
of the area to mask. Row/column numbering
starts at 0,0.
See Also: Scrn
────────────────────────────────────────────────────────────────────────
Command: ModVal
Purpose: Modifies the value stored in one of the variables or
registers. The specified variable or register is added to,
subtracted from, multiplied by, or divided by the given value.
Syntax: ModVal(Var,Val,Oper)
Var: A variable or register, one of the
following:
A, B, C, D, E, F, G, H, I, J,
YEAR, MONTH, DAY, HOUR, MIN, SEC,
AH, AL, BH, BL, CH, CL, DH, DL,
AX, BX, CX, DX, SI, DI, DS, ES.
Val: a value between 0 and 65500, or a variable
or register.
Oper: the modification operator, one of the
following: +, -, , /
Example: SetVal(A,1) ;variable A has a value of 1
SetVal(B,5) ;variable B has a value of 5
ModVal(A,1,+) ;A is now 2
ModVal(A,B,*) ;A is now 10
See Also: GenIntr, SetRegister, SetVal, Value
────────────────────────────────────────────────────────────────────────
Command: Not
Purpose: Reverses the outcome of the next condition.
Syntax: Not
Example: If Not DataStrR(0,124h,"abcdef")
Log("String not matched")
See Also: And, Else, If, Or
────────────────────────────────────────────────────────────────────────
36
Command: Or
Purpose: Used between two conditions. "OR"s the results of the
conditions.
Syntax: Or
Example: If DataStrR(0,124h,"abcdef") Or DataByteR(0,136h,a6h)
Log("Either string or byte matched")
See Also: And, Else, If, Not
────────────────────────────────────────────────────────────────────────
Command: OutByte
Purpose: Outputs a byte to an I/O port.
Syntax: OutByte(PortID,TheByte)
PortID: the I/O port ID.
TheByte: the byte to be output.
See Also: OutWord
────────────────────────────────────────────────────────────────────────
Command: OutWord
Purpose: Outputs a word to an I/O port.
Syntax: OutByte(PortID,TheWord)
PortID: the I/O port ID.
TheWord: the word to be output.
See Also: OutByte
────────────────────────────────────────────────────────────────────────
Command: Pause
Purpose: Pauses system operation. Similar to pushing the Pause key
on the keyboard. Script play continues in the background.
Syntax: Pause
See Also: PausePlay, PauseSys
────────────────────────────────────────────────────────────────────────
Command: PausePlay
Purpose: Temporarily suspends play until either the specified unpause
key is pressed, or the specified pause time elapses.
37
Syntax: PausePlay(PauseTime,UnpauseKey)
PauseTime: the maximum length of the pause in seconds.
value may be between 1 and 65500 or a
variable or register name (see SetVal).
UnpauseKey: one of the keys as listed in Table 5-1.
See Also: Pause, PauseSys
────────────────────────────────────────────────────────────────────────
Command: PauseSys
Purpose: Temporarily suspends the foreground process until either
the specified unpause key is pressed, or the specified
pause time elapses. Script play continues in the
background.
Syntax: PauseSys(PauseTime,UnpauseKey)
PauseTime: the maximum length of the pause in seconds.
value may be between 1 and 65500 or a
variable or register name (see SetVal).
UnpauseKey: one of the keys as listed in Table 5-1.
See Also: Pause, PausePlay
────────────────────────────────────────────────────────────────────────
Command: PrntScrn
Purpose: Generates a Print screen interrupt as is done when the Print
Screen key is pressed.
Syntax: PrntScrn
See Also: PrntScrnText
────────────────────────────────────────────────────────────────────────
Command: PrntScrnTxt
Purpose: Prints the text in the specified region of the screen.
Syntax: PrntScrnTxt(TopRow,LeftCol,BottomRow,RightCol)
TopRow,LeftCol,BottomRow,RightCol:
the top-left and bottom-right coordinates
of the text to print. Row/column numbering
starts at 0,0.
See Also: CopyScrnText, PrntScrn
────────────────────────────────────────────────────────────────────────
Command: Reboot
Purpose: Reboots the PC.
38
Syntax: Reboot(X)
X: 0: "cold" boot, same as pressing the reset
button.
1: "warm" boot, same as pressing
Ctrl-Alt-Del.
────────────────────────────────────────────────────────────────────────
Command: RestoreLine
Purpose: Restores the area of the screen overwritten by the last
WriteLine command.
Syntax: RestoreLine
See Also: WriteLine
────────────────────────────────────────────────────────────────────────
Command: RestoreScrn
Purpose: Restores the screen area overwritten by the last Window
command.
Syntax: RestoreScrn
See Also: Window
────────────────────────────────────────────────────────────────────────
Command: SaveDataA
Purpose: Saves a block of data from the PC's RAM to a file. You
specify the starting absolute segment and offset, the number
of bytes to save, and the name of the file to which the data
is to be saved. The segment and offset values are taken
from the beginning of memory (0000:0000).
Syntax: SaveDataA(Segment,Offset,NumBytes,Filename)
Segment: the segment address of the beginning of the
block between 0000h and ffffh.
Offset: the offset of the beginning of the block,
between 0000h and ffffh.
NumBytes: the number of bytes to save, between 1 and
65535.
Filename: the name of the file in which to save the
data, enclosed in quotes.
See Also: DataBlkA, SaveDataR
────────────────────────────────────────────────────────────────────────
Command: SaveDataR
Purpose: Save a block of data from the PC's RAM to a file. You
specify the starting relative segment and offset, the number
of bytes to save, and the name of the file to which the data
is to be saved. The segment and offset values are taken
relative to the beginning of the first segment of the current
foreground process. This command allows you to save the
values of program variables whose relative addresses are known.
39
Syntax: SaveDataR(Segment,Offset,NumBytes,Filename)
Segment: the segment address of the beginning of the
block, between 0000h and ffffh.
Offset: the offset of the beginning of the block,
between 0000h and ffffh.
NumBytes: the number of bytes to save. between 1 and
65535.
Filename: the name of the file in which to save the
data, enclosed in quotes.
See Also: DataBlkR, SaveDataA
────────────────────────────────────────────────────────────────────────
Command: SaveScrn
Purpose: Saves the current text-mode screen to the specified file.
Syntax: SaveScrn(Filename)
Filename: the file name, enclosed in quotes.
See Also: DisplScrn, Scrn
────────────────────────────────────────────────────────────────────────
Command: ScrEnd
Purpose: Terminates play, and returns to the default mode
(ie. Standby or Interactive mode).
Syntax: ScrEnd
────────────────────────────────────────────────────────────────────────
Command: SetRegister
Purpose: Sets the value that a register is to have before an
interrupt is generated by the GenIntr command.
Syntax: SetRegister(RegName,Value)
RegName: the register, one of the following:
AH, AL, BH, BL, CH, CL, DH, DL,
AX, BX, CX, DX, SI, DI, DS, ES.
Value: the value to place in the register.
Example: SetRegister(AX,1001h) ;set border color
SetRegister(BH,3) ;to cyan
Genintr(10h)
See Also: GenIntr, Register
────────────────────────────────────────────────────────────────────────
Command: SetVal
Purpose: Sets the value of a variable or register. This command
partially overlaps the SetRegister command.
40
Syntax: SetVal(Var,Val)
Var: A variable or register, one of the
following:
A, B, C, D, E, F, G, H, I, J,
YEAR, MONTH, DAY, HOUR, MIN, SEC,
AH, AL, BH, BL, CH, CL, DH, DL,
AX, BX, CX, DX, SI, DI, DS, ES.
Val: a value between 0 and 65500, or a variable
or register.
Example: SetVal(C,24) ;C now has a value of 24
SetVal(DH,C) ;register DH now has a value of 24
See Also: GenIntr, ModVal, Register, SetRegister, Value
────────────────────────────────────────────────────────────────────────
Command: SetVidMode
Purpose: Sets the PC's video mode
Syntax: SetVidMode(TheMode)
TheMode: the video mode.
See Also: EnableBlink
────────────────────────────────────────────────────────────────────────
Command: ShowCur
Purpose: Restores a text cursor which was hidden by the HideCur
command.
Syntax: ShowCur
See Also: HideCur
────────────────────────────────────────────────────────────────────────
Command: SingStepOff
Purpose: Turns off single-step mode.
Syntax: SingStepOff
See Also: SingStepOn
────────────────────────────────────────────────────────────────────────
Command: SingStepOn
Purpose: Turns on single-step mode. You supply the name of the key
which you want to be the step key.
Syntax: SingStepOn(Key)
Key: any key from Table 5-1.
See Also: SingStepOn
────────────────────────────────────────────────────────────────────────
41
Command: StandDelOff
Purpose: Turns off the standard delay.
Syntax: StandDelOff
See Also: StandDelOn
────────────────────────────────────────────────────────────────────────
Command: StandDelOn
Purpose: Turns on the standard delay. You specify the delay value in
clock ticks. A clock tick is about 1/18 of a second. When
the standard delay is on, AutoScript will wait the standard
delay time between each keystroke and command in Play mode,
and will disregard all Delay commands.
Syntax: StandDelOn(DelayTime)
DelayTime: the delay time in clock ticks, a number
between 1 and 65500 or a variable or
register name (see SetVal).
See Also: StandDelOff
────────────────────────────────────────────────────────────────────────
Command: StuffTxtFile
Purpose: Stuffs the contents of the specified text file into the
keyboard buffer (ie. "types" the contents of the file).
Syntax: StuffTxtFile(Filename)
Filename: the name of the text file, enclosed in
quotes.
────────────────────────────────────────────────────────────────────────
Command: StuffVal
Purpose: Stuffs the text expansion of a variable or register value into
the keyboard buffer. Has the same effect as including a \(var)
in the keystroke string. The string stuffed is padded to the
left with zeroes to fill the specified with if it is not 0.
Syntax: StuffVal(Var,Width)
Var: A variable or register, one of the
following:
A, B, C, D, E, F, G, H, I, J,
YEAR, MONTH, DAY, HOUR, MIN, SEC,
AH, AL, BH, BL, CH, CL, DH, DL,
AX, BX, CX, DX, SI, DI, DS, ES.
Width: The total width of the string to be stuffed,
between 0 and 6;
Example: "The value of variable D is"
StuffVal(D,0)
See Also: GenIntr, ModVal, SetVal, SetRegister, StuffValH
────────────────────────────────────────────────────────────────────────
42
Command: StuffValH
Purpose: Stuffs the text expansion of a variable or register value in
hexadecimal format into the keyboard buffer. Has the same
effect as including a \(hvar) in the keystroke string.
Syntax: StuffVal(Var)
Var: A variable or register, one of the
following:
A, B, C, D, E, F, G, H, I, J,
YEAR, MONTH, DAY, HOUR, MIN, SEC,
AH, AL, BH, BL, CH, CL, DH, DL,
AX, BX, CX, DX, SI, DI, DS, ES.
Example: "The hex value of variable D is"
StuffVal(D)
See Also: GenIntr, ModVal, SetVal, SetRegister, StuffVal
────────────────────────────────────────────────────────────────────────
Command: SysRq
Purpose: Has the same affect as pressing the SysRq key.
Syntax: SysRq
────────────────────────────────────────────────────────────────────────
Command: Tone
Purpose: Produces a tone of a specified frequency and duration.
Syntax: Tone(Freq,Duration)
Freq: the frequency in Hz, between 0 and 65535.
Duration: the duration of the tone in clock ticks,
between 0 and 255.
See Also: Beep
────────────────────────────────────────────────────────────────────────
Command: UnblankScrn
Purpose: Unblanks the PC's screen if it is blanked. If it is not
blanked, it resets the screen blank timer.
Syntax: UnblankScrn
See Also: BlankScrn
────────────────────────────────────────────────────────────────────────
Command: Unload
Purpose: Causes AutoScript to try to remove itself, and free its
memory. If any interrupts which AutoScript is using were
hooked after AutoScript was loaded, it will not be able to
remove itself. Instead, it will deactivate itself, but
remain in memory. After deactivation, all hot keys will be
43
ignored, and all features will be disabled. If the screen
was blank, or the keyboard was locked when this command is
encountered, the screen will be unblanked, and the keyboard
will be unlocked.
Syntax: Unload
────────────────────────────────────────────────────────────────────────
Command: UnlockKbd
Purpose: Unlocks the keyboard if it is locked.
Syntax: UnlockKbd
See Also: LockKbd
────────────────────────────────────────────────────────────────────────
Command: Unpause
Purpose: Terminates a pause started by the Pause or PauseSys commands.
Syntax: Unpause
See Also: Pause, PauseSys
────────────────────────────────────────────────────────────────────────
Command: WaitForString
Purpose: Causes AutoScript to suspend script play until the specified
string is typed at the keyboard. This command should not be
used when the kbd is locked.
Syntax: WaitForString(TheString)
TheString: an ASCII string, up to 10 characters in
length, containing any combination of
letters and numbers, as well as any other
characters which can be typed without the
help of the Ctrl, Shift, or Alt keys,
enclosed in quotes.
See Also: PausePlay, WaitUntil
────────────────────────────────────────────────────────────────────────
Command: WaitUntil
Purpose: Suspends script play until the specified time arrives. If
the specified time is earlier than the current time, but no
more than 59 minutes earlier, play proceeds immediately.
Syntax: WaitUntil(Hours,Mins,Secs)
Hours: time of day (hours) (24-hour format).
Mins: time of day (minutes).
Secs: time of day (seconds).
See Also: PausePlay, WaitForString
────────────────────────────────────────────────────────────────────────
44
Command: Window
Purpose: Draws a window over a text screen.
Syntax: Window(Row,Col,Height,Width,BorderType,Attribute)
Row: first row of window.
Col: first column of window.
Height: height of window in rows.
Width: width of window in columns.
BorderType: the border type of the window, one of the
following: Single, Double.
Attribute: the text attribute (usual BIOS format).
See Also: RestoreScrn, WriteLine
────────────────────────────────────────────────────────────────────────
Command: WriteLine
Purpose: Writes a line of text directly to the screen. The row and
column are taken relative to the window after the Window
command has been called, and before RestoreScrn has been
called.
Syntax: WriteLine(Row,Col,Attribute,TheText)
Row: row where text is to appear.
Col: column where text is to start.
Attribute: the text attribute (usual BIOS format).
TheText: the text to write, enclosed in quotes.
See Also: RestoreLine
────────────────────────────────────────────────────────────────────────
5.2 Conditions
AutoScript script conditions are commands which check a particular
condition, and return a true/false result. The And, If, Not, and Or
commands, along with the conditions, provide the facilities for
conditional execution within a script.
Condition: DataBlkA
Purpose: Compares a block of data in RAM with the contents of a file.
The data block is specified by its absolute address (ie. the
segment and offset addresses relative to the beginning of
memory). The number of bytes compared equals the file
size. If the bytes in the block match the bytes in the file,
the condition returns the result true.
Syntax: DataBlkA(Segment,Offset,Filename)
Segment: the segment address of the beginning of the
block, between 0000h and ffffh.
Offset: the offset of the beginning of the block,
between 0000h and ffffh.
Filename: the name of the data file, enclosed in
quotes.
45
See Also: DataBlkR, DataByteA, DataByteR, DataDwordA, DataDwordR,
DataStrA, DataStrR, DataWordA, DataWordR, SaveDataA
────────────────────────────────────────────────────────────────────────
Condition: DataBlkR
Purpose: Compares a block of data in RAM with the contents of a file.
The data block is specified by giving the segment and offset
addresses relative to the beginning of the first segment of
the current foreground process. If the bytes in the block
match the bytes in the file, the condition returns the
result true. The number of bytes compared equals the
file size.
Syntax: DataBlkR(Segment,Offset,Filename)
Segment: the segment address of the beginning of the
block, between 0000h and ffffh.
Offset: the offset of the beginning of the block,
between 0000h and ffffh.
Filename: the name of the data file, enclosed in
quotes.
See Also: DataBlkA, DataByteA, DataByteR, DataDwordA, DataDwordR,
DataStrA, DataStrR, DataWordA, DataWordR, SaveDataR
────────────────────────────────────────────────────────────────────────
Condition: DataByteA
Purpose: Compares a byte of data in RAM with the byte specified. The
byte is referenced by its absolute address (ie. the segment
and offset addresses relative to the beginning of memory).
If the bytes match, the condition returns the result true.
Syntax: DataByteA(Segment,Offset,TheByte)
Segment: the segment address of the byte.
Offset: the offset of the byte.
TheByte: the byte to compare.
See Also: DataBlkA, DataBlkR, DataByteR, DataDwordA, DataDwordR,
DataStrA, DataStrR, DataWordA, DataWordR
────────────────────────────────────────────────────────────────────────
Condition: DataByteR
Purpose: Compares a byte of data in RAM with the byte specified.
The byte address is specified by giving the segment and
offset addresses relative to the beginning of the first
segment of the current foreground process. If the bytes
match, the condition returns the result true.
Syntax: DataByteR(Segment,Offset,TheByte)
Segment: the segment address of the byte.
Offset: the offset of the byte.
TheByte: the byte to compare.
46
See Also: DataBlkA, DataBlkR, DataByteA, DataDwordA, DataDwordR,
DataStrA, DataStrR, DataWordA, DataWordR
────────────────────────────────────────────────────────────────────────
Condition: DataDWordA
Purpose: Compares a double word (4 bytes) of data in RAM with the
double word specified. The double word is referenced by
its absolute address (ie. the segment and offset addresses
relative to the beginning of memory). If the dwords match,
the condition returns the result true.
Syntax: DataDWordA(Segment,Offset,TheDword)
Segment: the segment address of the byte.
Offset: the offset of the byte.
TheDword: the double word to compare.
See Also: DataBlkA, DataBlkR, DataByteA, DataByteR, DataDwordR,
DataStrA, DataStrR, DataWordA, DataWordR
────────────────────────────────────────────────────────────────────────
Condition: DataDWordR
Purpose: Compares a double word (4 bytes) of data in RAM with the
double word specified. The address is specified by giving
the segment and offset addresses relative to the beginning
of the first segment of the current foreground process. If
the dwords match, the condition returns the result true.
Syntax: DataDwordR(Segment,Offset,TheDword)
Segment: the segment address of the byte.
Offset: the offset of the byte.
TheDword: the double word to compare.
See Also: DataBlkA, DataBlkR, DataByteA, DataByteR, DataDwordA,
DataStrA, DataStrR, DataWordA, DataWordR
────────────────────────────────────────────────────────────────────────
Condition: DataStrA
Purpose: Compares data in RAM with the ASCII string provided. The
string is referenced by its absolute address (ie. the
segment and offset addresses relative to the beginning of
memory). If the string matches, the condition returns the
result true.
Syntax: DataStrA(Segment,Offset,TheString)
Segment: the segment address of the beginning of the
string.
Offset: the offset of the byte.
TheString: the string to compare, enclosed in quotes.
See Also: DataBlkA, DataBlkR, DataByteA, DataByteR, DataDwordA,
DataDwordR, DataStrR, DataWordA, DataWordR
────────────────────────────────────────────────────────────────────────
47
Condition: DataStrR
Purpose: Compares data in RAM with the ASCII string provided. The
address is specified by giving the segment and offset
addresses relative to the beginning of the first segment of
the current foreground process. If the string matches, the
condition returns the result true.
Syntax: DataStrR(Segment,Offset,TheString)
Segment: the segment address of the beginning of the
string.
Offset: the offset of the byte.
TheString: the string to compare, enclosed in quotes.
See Also: DataBlkA, DataBlkR, DataByteA, DataByteR, DataDwordA,
DataDwordR, DataStrA, DataWordA, DataWordR
────────────────────────────────────────────────────────────────────────
Condition: DataWordA
Purpose: Compares a word of data in RAM with the word specified. The
word is referenced by its absolute address (ie. the segment
and offset addresses relative to the beginning of memory).
If the words match, the condition returns the result true.
Syntax: DataWordA(Segment,Offset,TheWord)
Segment: the segment address of the byte.
Offset: the offset of the byte.
TheWord: the word to compare
See Also: DataBlkA, DataBlkR, DataByteA, DataByteR, DataDwordA,
DataDwordR, DataStrA, DataStrR, DataWordR
────────────────────────────────────────────────────────────────────────
Condition: DataWordR
Purpose: Compares a word of data in RAM with the word specified. The
word address is specified by giving the segment and offset
addresses relative to the beginning of the first segment of
the current foreground process. If the words match, the
condition returns the result true.
Syntax: DataWordR(Segment,Offset,TheWord)
Segment: the segment address of the byte.
Offset: the offset of the byte.
TheWord: the word to compare
See Also: DataBlkA, DataBlkR, DataByteA, DataByteR, DataDwordA,
DataDwordR, DataStrA, DataStrR, DataWordA
────────────────────────────────────────────────────────────────────────
Condition: EnvironVar
Purpose: Compares the string given with the strings in the DOS
environment block. The condition returns true if the given
string matches one of the environment variable strings. The
comparison is case-insensitive.
48
Syntax: EnvironVar(EnvString)
EnvString: a string, enclosed in quotes.
Example: If EnvironVar("PROMPT=%p")
Beep
────────────────────────────────────────────────────────────────────────
Condition: InByte
Purpose: Inputs a byte from the specified I/O port and compares it to
the byte provided. If the bytes match, the condition
returns true.
Syntax: InByte(PortID,TheByte)
PortID: the I/O port ID.
TheByte: the byte to be compared.
See Also: InWord
────────────────────────────────────────────────────────────────────────
Condition: InWord
Purpose: Inputs a word from the specified I/O port and compares it to
the word provided. If the words match, the condition
returns true.
Syntax: InWord(PortID,TheWord)
PortID: the I/O port ID.
TheWord: the word to be compared.
See Also: InByte
────────────────────────────────────────────────────────────────────────
Condition: KbdLocked
Purpose: Returns true if the keyboard is currently locked by
AutoScript.
Syntax: KbdLocked
────────────────────────────────────────────────────────────────────────
Condition: ProgName
Purpose: Compares the string provided with the name of the current
foreground application (less the ".EXE" or ".COM"). If the
strings match, the condition returns true. The comparison
is case-insensitive.
Syntax: ProgName(NameString)
NameString: an ASCII string, enclosed in quotes.
Example: If ProgName("myprog") ;see if MYPROG.EXE is running
LoadScr("myprog.scr") ;if so, play script: myprog.scr
Else LoadScr("another.scr") ;play a different script
────────────────────────────────────────────────────────────────────────
49
Condition: Register
Purpose: Compares the value that the specified register contained
immediately following execution of a GenIntr command, with
the value provided. If the values match, the condition
returns true.
Syntax: Register(RegName,Value)
RegName: the register, one of the following:
AH, AL, BH, BL, CH, CL, DH, DL,
AX, BX, CX, DX, SI, DI, DS, ES.
Value: the number to compare with the register value.
Example: SetRegister(AH,12h) ;get video configuration
SetRegister(BL,10h) ;information
Genintr(10h)
If Register(BH,1) Log("Monochrome Display installed")
Else Log(Color display installed")
See Also: GenIntr, SetRegister
────────────────────────────────────────────────────────────────────────
Condition: Scrn
Purpose: Compares the contents of the current screen with the screen
saved in a file by the SaveScrn command. Areas of the
screen masked by the Mask command are not compared. The
condition returns true if the screens match.
Syntax: Scrn(Filename)
Filename: name of the screen file, enclosed in quotes.
See Also: Mask, SaveScrn
────────────────────────────────────────────────────────────────────────
Condition: ScrnTxt
Purpose: Compares a line of text on the screen with the string provided.
The condition returns true if the text matches.
Syntax: ScrnTxt(Row,Col,TheString)
Row: the row on the screen where the text appears.
Col: the starting column of the screen text.
Row/col numbering starts at 0,0.
TheString: the string to compare, enclosed in quotes.
See Also: ScrnTxtA, ScrnTxtF
────────────────────────────────────────────────────────────────────────
Condition: ScrnTxtA
Purpose: Looks for the specified text string anywhere on the screen.
The condition returns true if the text string is found.
Syntax: ScrnTxtA(TheString)
TheString: the string to find, enclosed in quotes.
50
See Also: ScrnTxt, ScrnTxtF
────────────────────────────────────────────────────────────────────────
Condition: ScrnTxtF
Purpose: Compares a block of text on the screen with the contents of
a file created by the CopyScrnTxt command. The condition
returns true if the screen text matches the file contents.
Syntax: ScrnTxtF(TopRow,LeftCol,BottomRow,RightCol,Filename)
TopRow,LeftCol,BottomRow,RightCol:
the top-left and bottom-right coordinates
of the text to copy. Row/col numbering
starts at 0,0.
Filename: the name of the file which contains the
text to be compared, enclosed in quotes.
Example: If ScrnTxtF(1,3,18,29,"scrntxt.sav") ;see if text matches
Beep
See Also: CopyScrnTxt, ScrnTxt, ScrnTxtA
────────────────────────────────────────────────────────────────────────
Condition: UserKey
Purpose: Compares a the given key with the last key pressed by the
user. The condition returns true if the keys match.
Syntax: UserKey(Key)
Key: any key from Table 5-1.
────────────────────────────────────────────────────────────────────────
Condition: Value
Purpose: Compares the value in the specified register or variable with
a given value or the value from another register or variable.
This command partially overlaps the functionality of the
Register condition.
Syntax: Value(Var,Val,Oper)
Var: A variable or register, one of the
following:
A, B, C, D, E, F, G, H, I, J,
YEAR, MONTH, DAY, HOUR, MIN, SEC,
AH, AL, BH, BL, CH, CL, DH, DL,
AX, BX, CX, DX, SI, DI, DS, ES.
Val: a value between 0 and 65500, or a variable
or register.
Oper: the comparison operator, one of the
following: =, <, <
Example: SetVal(A,1) ;variable A has a value of 1
If Value(A,1,=) Log("A equals 1")
If Value(B,A,>) Log("B is greater than A")
See Also: GenIntr, ModVal, SetVal, SetRegister
51
The following are the key names recognized by the script compiler. Note
that the left and right Shift keys are listed separately:
╔═════════════════════════════════════════════════════════════════╗
║ A B C D E F G H I ║
║ J K L M N O P Q R ║
║ S T U V W X Y Z Esc ║
║ 1 2 3 4 5 6 7 8 9 ║
║ 0 = \ [ ] ; ' , . ║
║ / Bs Tab Capslk LShift RShift Enter Space Ctrl ║ ║
║ Alt F1 F2 F3 F4 F5 F6 F7 F8 ║
║ F9 F10 F11 F12 Ins Del Home End PgUp ║
║ PgDn UArrow DArrow LArrow RArrow ScrlLk NumLk KP* KP- ║
║ KP+ ANYKEY (only for unpause, single-step, and EnableKey) ║
╚═════════════════════════════════════════════════════════════════╝
Table 5-1 - Key Names
Chapter 6 Autoscript Utilities
6.1 Script Compiler
The AutoScript script compiler is a utility which converts ASCII text
files into binary script files. To use the script compiler to compile
a script, first create a text file, following the syntax rules given in
Chapter 5. Then type:
AC filename [outputfile] <Enter>
where filename is the name of the input text file, and outputfile is an
optional name which the output binary script file is to be given. If
you do not provide an output file name, the output file will be given
the same name as the input file, with the extension ".SCR".
6.2 Script Uncompiler
The AutoScript script uncompiler is a utility which converts AutoScript
binary script files to ASCII text files which conform to the syntax rules
given in Chapter 5. It essentially does the inverse of what the script
compiler does. To uncompile a script file, type:
AUC filename [outputfile] <Enter>
where filename is the name of the binary script file, and outputfile is
an optional name which the output text file is to be given. If you do
not provide an output file name, the output file will be given the same
name as the input file, with the extension ".SCA".
6.3 Screen Comparison Utility
The AutoScript screen comparison utility allows you to compare two text
screens saved by AutoScript. To use this utility, type:
ASC filename1 filename2 <Enter>
52
where filename1 and filename2 are the names of two screen files created
by AutoScript. The screen comparison utility will display the first
screen as it was saved. Using the space bar, you can scroll between
views of the first screen, the differences between the first and second
screens (ie. the characters and/or attributes on the first screen which
are different than those in the same locations on the second screen), the
second screen, and the differences between the second and first screens.
Pressing F1 at any time will show you which screen you are currently
viewing, and Escape will exit the utility.
6.4 KBRATE
The program KBRATE is a small utility which allows you to change your
keyboard's repeat (typematic) rate and delay. The rate and delay set
with this utility will stay in effect until it is changed or the PC is
rebooted, and has nothing to do with whether or not AutoScript is loaded.
To use this utility, type:
KBRATE rate delay <Enter>
where rate and delay are indexes into tables of typematic rates and
delays, respectively. The following are the valid typematic rates and
delays, and the appropriate values for the arguments rate and delay.
Typematic Rates (repeats per second):
0: 30.0 8: 15.0 16: 7.5 24: 3.7
1: 26.7 9: 13.3 17: 6.7 25: 3.3
2: 24.0 10: 12.0 18: 6.0 26: 3.0
3: 21.8 11: 10.9 19: 5.5 27: 2.7
4: 20.0 12: 10.0 20: 5.0 28: 2.5
5: 18.5 13: 9.2 21: 4.6 29: 2.3
6: 17.1 14: 8.6 22: 4.3 30: 2.1
7: 16.0 15: 8.0 23: 4.0 31: 2.0
Typematic Delays (milliseconds):
0: 250
1: 500
2: 750
3: 1000 (1 sec)
Chapter 7 Compatibility Issues
AutoScript is compatible with DOS 3 and higher and most DOS
applications. It will not work under Microsoft Windows. Other
keyboard enhancement programs should not be loaded together with
AutoScript, as they will likely conflict with each other. Some DOS
applications, such as word processors provide their own key repeat
feature. When running such an application, AutoScript's key repeat
feature should be disabled (ie. repeat rate should be set to 0). Keys
repeated by the application will be inaccessible by AutoScript, and
therefore cannot be recorded. Also, some applications intercept the
PC's keypress interrupt (int 9), and therefore they may prevent
AutoScript from detecting some keystrokes.
53
Hot key assignments should be changed, if necessary, before an
application is run, so that they will not conflict with any keys defined
by the application. When AutoScript detects that one of its hot keys
has been pressed, it causes the keypress to be missed by other processes.
This will usually result in the foreground application not detecting the
keypress.
Chapter 8 User Support
I am most interested in receiving comments and suggestions from users.
I hope that I will be able to make future improvements to the software
and documentation based on user feedback. I will also be happy to
help users with problems or questions they have regarding AutoScript.
Please contact me if you have any problems, comments, or suggestions.
Larry Michaels
15712 Hilton
Southfield, MI 48075-6010
(810)569-5520
Thank you for trying AutoScript.
54
APPENDIX - New in Version 2.0
This version (2.0) includes the the following new features:
- Hot key for replaying the last script played.
- InsScr now works correctly within loops.
- Ten user variables for storing values, conditional branching,
inclusion in text strings, and parameters for some commands,
and the SetVal, ModVal commands and Value condition for use with
the variables.
- Date and time variables for use in conditional branching,
inclusion in text strings, and parameters for some commands.
- Window command for drawing windows over text screens.
- ScrnTxtA condition for searching for a given text string anywhere
on the screen.
- The EnableKey command has been improved to allow enabling all
disabled keys.
- The ScrnTxtF Condition is now implemented properly.
- The DataBlkA and DataBlkR conditions are now implemented better.
55
Index to Commands and Conditions Reference
Alarm.............................................................25
And...............................................................25
Beep..............................................................26
BeginBlock........................................................26
BeginLoop.........................................................26
BlankScrn.........................................................27
ClickOff..........................................................27
ClickOn...........................................................27
ClrScrn...........................................................27
Comment...........................................................27
CopyScrnTxt.......................................................28
CtrlBreak.........................................................28
CtrlC.............................................................28
Delay.............................................................28
DelFile...........................................................29
DisableKey........................................................29
DisplScrn.........................................................29
Else .........................................................29
EnableBlink.......................................................30
EnableKey.........................................................30
EndBlock..........................................................31
EndLoop...........................................................31
EscapeBlock.......................................................31
EscapeLoop........................................................31
GenIntr...........................................................32
GetTime...........................................................32
HideCur...........................................................32
If................................................................33
InsScr............................................................33
KbdStatOff........................................................33
KbdStatOn.........................................................33
LoadScr...........................................................34
LockKbd...........................................................34
Log...............................................................34
Mask..............................................................35
ModVal............................................................35
Not...............................................................35
Or................................................................36
OutByte...........................................................36
OutWord...........................................................36
Pause.............................................................36
PausePlay.........................................................36
PauseSys..........................................................37
PrntScrn..........................................................37
PrntScrnTxt.......................................................37
Reboot............................................................37
RestoreLine.......................................................38
RestoreScrn.......................................................38
SaveDataA.........................................................38
SaveDataR.........................................................38
SaveScrn..........................................................39
ScrEnd............................................................39
SetRegister.......................................................39
SetVal............................................................39
SetVidMode........................................................40
ShowCur...........................................................40
SingStepOff.......................................................40
56
SingStepOn........................................................40
StandDelOff.......................................................41
StandDelOn........................................................41
StuffTxtFile......................................................41
StuffVal..........................................................41
StuffValH.........................................................42
SysRq.............................................................42
Tone..............................................................42
UnblankScrn.......................................................42
Unload............................................................42
UnlockKbd.........................................................43
Unpause...........................................................43
WaitForString.....................................................43
WaitUntil.........................................................43
Window............................................................44
WriteLine.........................................................44
DataBlkA..........................................................44
DataBlkR..........................................................45
DataByteA.........................................................45
DataByteR.........................................................45
DataDWordA........................................................46
DataDWordR........................................................46
DataStrA..........................................................46
DataStrR..........................................................47
DataWordA.........................................................47
DataWordR.........................................................47
EnvironVar........................................................47
InByte............................................................48
InWord............................................................48
KbdLocked.........................................................48
ProgName..........................................................48
Register..........................................................49
Scrn..............................................................49
ScrnTxt...........................................................49
ScrnTxtA..........................................................49
ScrnTxtF..........................................................50
UserKey...........................................................50
Value.............................................................50