User Manual
Additional Remote Networking Chat Scripts
5-4
5.2.2 Editing and Adding Entries
To replace, delete, or insert entries, specify the line numbers. Figure 5-5 displays a few examples.
Figure 5-5: Editing Script Entries
To determine the number of a particular line, display the script using the List Site Chat command. All chat
script entries for that site will be displayed.
5.2.3 Configuring Timeouts
The Define Site Chat Timeout command enables you to configure the timeout after an Expect command,
or a delay before a Send command is executed. Figure 5-6 displays some examples.
Figure 5-6: Setting Timeouts and Delays
The first command in Figure 5-6 will cause the SCS to wait two seconds for a response from the remote host
after sending an Expect command. If no response is received after two seconds, the chat script will fail or
return to the previous fail marker. The second command will send the “hello?” string after a 4-second delay.
The default Send timeout (delay before a Send command is executed) is 0; in other words, strings will be
sent right away. The default timeout for Expect commands is 30 seconds.
5.2.4 Setting Markers
The Fail parameter sets a marker in a chat script for a Timeout command. When the Timeout associated
with an Expect command expires (the expected string is not received within the specified number of
seconds), the SCS will return to the last command containing the Fail parameter. The script will be executed
from that point, continuously looping if the Expect command repeatedly fails.
Figure 5-7: Expect/Fail Scripts
The script in Figure 5-7 will send a carriage return, then wait for two seconds while a “login:” string is
expected. If the “login:” string is not received within two seconds, the chat script will loop back to the Fail
command and continue running from that point. Each time the Expect command fails (i.e. the “login:” string
is not received within two seconds), the Fail counter is decremented one value. When the Expect command
has failed four times (i.e. the “login:” string is never received), the looping will stop and the chat script will
exit.
Local>> DEFINE SITE irvine CHAT REPLACE 1 EXPECT "login:"
Local>> DEFINE SITE irvine CHAT DELETE 4
Local>> DEFINE SITE irvine CHAT AFTER 3 EXPECT "login:"
Local>> DEFINE SITE irvine CHAT BEFORE 3 EXPECT "login:"
Local>> DEFINE SITE irvine CHAT TIMEOUT 2 EXPECT "login:"
Local>> DEFINE SITE irvine CHAT TIMEOUT 4 SEND "hello?"
Local>> DEFINE SITE irvine CHAT TIMEOUT 4 FAIL
Local>> DEFINE SITE irvine CHAT SEND "\r"
Local>> DEFINE SITE irvine CHAT TIMEOUT 2 EXPECT "login:"