home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computerworld Gratis 30 Hours of Connection
/
Image(2).iso
/
infovia
/
win31
/
simple1.sc_
/
simple1.sc
Wrap
Text File
|
1994-05-31
|
3KB
|
75 lines
<******************************************************* language=slang
Sample SLANG Modem Dialup Script
Description:
Simple Example #1 -- Written in the SLANG scripting language
This script dials the modem, enters a user-id after a short
delay, then a password after another short delay. Lastly,
packet mode is enabled so enable TCP/IP data transfers.
To Use This Script:
Change "0000" to the phone number of the remote machine you
would like to connect to.
Change "my-user-id" to your user id on the remote machine.
Change "my-password" to your password on the remote machine.
Adjust the intervals in the (pause,...) functions to suit
your needs. These are in milliseconds (5000 milliseconds ==
5 seconds).
This script assumes that your modem, and the remote host,
terminate commands with an ASCII Carrage-Return character.
If, instead, a Carrage-Return/Line-Feed (CRLF) is required,
change "(cr)" to "(cr)(lf)" everywhere in the script it is
necessary.
Notes:
This is a very simple dial script. It assumes that:
o the modem connection will always be made
o the remote machine will always be ready for your
user-id after a set interval
o like-wise for your password
In short, this script closely parallels scripts written in
FTP's first dialing script language, COMSCRPT. It is
optimistic and makes no provisions for errors. More complex
examples provided demonstrate error handling, and many other
options using features of SLANG.
Built-In SLANG Functions Used:
send Send a character string to the modem.
cr Return a Carriage-Return character.
pause Wait a specified number of milliseconds.
changemode Changes mode of connection from "raw" to
"packet".
************************************************************************>
(send, <* Dial the remote modem/host *>
{ATDT0000} <* Modem command and phone number *>
(cr) <* Carrage-Return after modem cmd *>
) <* End of "send" function *>
(pause, 25000) <* Wait for the modem to connect *>
(send, <* Log-in to the remote modem/host *>
{my-user-id} <* Send your user id *>
(cr) <* Carrage-Return after user id *>
) <* End of "send" function *>
(pause, 5000) <* Wait for a password prompt *>
(send, <* Send your password *>
{my-password} <* Your actual password *>
(cr) <* Carrage-Return after password *>
) <* End of "send" function *>
(pause, 5000) <* Pause for a moment *>
(changemode, packet) <* Change to "packet" mode *>