Setting up for the Internet
22
In addition, you should split the different parts of your script into
procedures
(a procedure is a section of script that
begins with a name that you can then use to jump to the commands it contains from anywhere else in the script).
•
Each procedure should begin with a name followed by a colon, then be followed by instructions on the next line. E.g.
in
start:
WAIT 15
“start”
is the name of the procedure. You can make the script jump to the
start
procedure from anywhere else in the
script by using the command:
GOTO start
The maximum length of a procedure name (or “label”) is 20 characters.
Waiting for prompts
To use a script to tell the machine to wait for a prompt:
You should use a
WAIT
command for each of the prompts your Internet Service Provider sends you during the
logging in process.
1.
Open the script editor.
2.
Create a new procedure for the prompt you want the script to wait for by typing the procedure name followed by a
colon. E.g.
waitforlogin:
3.
On a new line, type
WAIT
followed by the number of seconds you want the machine to wait for the prompt. Then
start another new line and type a
‘{‘
character. You will now have something like:
waitforlogin:
WAIT 15
{
When writing scripts, it is often useful to indent each new line using the Tab key. This helps you to identify
procedure names when looking over your script.
4.
On another new line enter the prompt the machine should wait for in “” marks, then type the name of the procedure
the script should jump to when it receives the prompt. (This will be the procedure which contains the command for
sending the appropriate response.) Start a new line then add a
‘}’
character. You should now have something like:
waitforlogin:
WAIT 15
{
“ogin:” sendlogin
}
Because the scripting tool is case-sensitive, and your Internet Service Provider may send the prompt ‘
login:
’ or
‘
Login:
’, it is often better to miss out the first letter or two when entering the prompt in the
WAIT
command.
If you are typing the procedure name (
sendlogin
in the above example) somewhere other than at the beginning of a
procedure, you should not put a colon at the end.