home *** CD-ROM | disk | FTP | other *** search
- <******************************************************* language=slang
-
- Sample SLANG Modem Dialup Script
-
- Description:
-
- Simple Example #5 -- Written in the SLANG scripting language
-
- This script dials the modem. It then checks "polls" the
- serial line to see if the modem has connected with the remote
- modem.
-
- If the connection has been made the script enters a user-id
- after a short delay, then a password after another short
- delay and, finally, packet mode is enabled so enable TCP/IP
- data transfers. The last thing the script does is run two
- DOS applications: PCMAIL and VMAIL. VMAIL is left running
- after the script is done.
-
- If no connetion is made the script informs the user and ends.
-
- This script does not store a user id or password directly,
- but uses the ones that were entered in WDial's Configuration
- Window.
-
- To Use This Script:
-
- Change "0000" to the phone number of the remote machine you
- would like to connect to.
-
- Be sure the enter your password and user id in WDial's
- Configuration Window.
-
- 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, once the
- modem connection has been made the following will be true:
-
- o the remote machine will always be ready for your
- user-id after a set interval
-
- o like-wise for your password
-
- It is more robust than simpler examples in that it checks to
- see if the modem connected or not, and acts accordingly.
- There is no provision for retries, or verification of the
- remote host, all of which are possible in SLANG. The script
- also assumes that there will be a user id and password prompt
- after set intervals.
-
- Built-In SLANG Functions Used:
-
- send Send a character string to the modem.
- cr Return a Carriage-Return character.
- poll Wait for the serial line to change state.
- pause Wait a specified number of milliseconds.
- username Return username from WDial's Configuration Window.
- password Return password from WDial's Configuration Window.
- shell Run a program, wait until program is done running.
- start Run a program, don't wait for it to complete.
- 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 *>
-
- (poll, physical, open, 30000, <* Wait for the modem to connect *>
- { <* IF THE MODEM CONNECTED SUCESSFULLY *>
- (pause, 3000) <* Wait for remote machine's prompt *>
- <* Log-in to the remote modem/host *>
- (send, (username) ) <* Send your user id *>
- (send, (cr) ) <* Carrage-Return after user id *>
- (pause, 5000) <* Wait for a password prompt *>
- <* Send the password *>
- (send, (password) ) <* Send password *>
- (send, (cr) ) <* Carrage-Return after password *>
- (pause, 5000) <* Pause for a moment *>
- (changemode, packet) <* Change to "packet" mode *>
-
- (shell, pcmail) <* Run mailer *>
- (start, vmail) <* Run mail reader *>
-
- } <* END IF THE MODEM CONNECTED *>
-
- , <* Comma delimits "Else" part of "poll" *>
-
- { <* ELSE IF THE MODEM DOSN'T CONNECT *>
- (output,
- {
-
- The Modem didn't connect. End of Script.
-
- } <* everything between { } is displayed *>
- ) <* End of the "output" function *>
- } <* END IF THE MODEM DOESN'T CONNECT *>
- ) <* End of the "poll" function *>
-