home *** CD-ROM | disk | FTP | other *** search
/ Computerworld Gratis 30 Hours of Connection / Image(2).iso / infovia / win31 / simple2.sc_ / simple2.sc
Text File  |  1994-06-21  |  3KB  |  82 lines

  1. <******************************************************* language=slang
  2.  
  3. Sample SLANG Modem Dialup Script
  4.  
  5. Description:
  6.  
  7.     Simple Example #2 -- Written in the SLANG scripting language
  8.  
  9.     This script dials the modem, enters a user-id after a short
  10.     delay, then a password after another short delay.  Lastly,
  11.     packet mode is enabled so enable TCP/IP data transfers.
  12.  
  13.     This script does not store a password directly, but prompts
  14.     the user for their password.  This removes the security
  15.     problem of storing a password in plain-text in a file.
  16.  
  17. To Use This Script:
  18.  
  19.     Change "0000" to the phone number of the remote machine you
  20.     would like to connect to.
  21.  
  22.     Change "my-user_id" to your user id on the remote machine.
  23.  
  24.     Adjust the intervals in the (pause,...) functions to suit
  25.     your needs.  These are in milliseconds (5000 milliseconds ==
  26.     5 seconds).
  27.  
  28.     This script assumes that your modem, and the remote host,
  29.     terminate commands with an ASCII Carrage-Return character.
  30.     If, instead, a Carrage-Return/Line-Feed (CRLF) is required,
  31.     change "(cr)" to "(cr)(lf)" everywhere in the script it is
  32.     necessary.
  33.  
  34. Notes:
  35.  
  36.     This is a very simple dial script.  It assumes that:
  37.  
  38.     o    the modem connection will always be made
  39.  
  40.     o    the remote machine will always be ready for your
  41.         user-id after a set interval
  42.  
  43.     o    like-wise for your password
  44.  
  45.     This script is is optimistic and makes no provisions for
  46.     errors.  More complex examples provided demonstrate error
  47.     handling, and many other options using features of SLANG.
  48.  
  49. Built-In SLANG Functions Used:
  50.  
  51.     send        Send a character string to the modem.
  52.     cr        Return a Carriage-Return character.
  53.     pause        Wait a specified number of milliseconds.
  54.     output        Output a string to the screen.
  55.     input        Input a string from the keyboard (hit ENTER
  56.             at end of string).
  57.     changemode    Changes mode of connection from "raw" to
  58.             "packet".
  59.  
  60. ************************************************************************>
  61.  
  62. (send,                <* Dial the remote modem/host        *>
  63.     {ATDT0000}        <*    Modem command and phone number    *>
  64.     (cr)            <*    Carrage-Return after modem cmd    *>
  65. )                <*    End of "send" function        *>
  66. (pause, 30000)            <* Wait for the modem to connect    *>
  67. (send,                <* Log-in to the remote modem/host    *>
  68.     {my-user-id}        <*    Send your user id        *>
  69.     (cr)            <*    Carrage-Return after user id    *>
  70. )                <*    End of "send" function        *>
  71. (pause, 5000)            <* Wait for a password prompt        *>
  72. (output,
  73.     {
  74.     Password Please? }        <*    Spaces in the { } are displayed    *>
  75. )                <*    End of "output" function    *>
  76. (send,                <* Send the password            *>
  77.     (input)            <*    Enter password from the keyboard*>
  78.     (cr)            <*    Carrage-Return after password    *>
  79. )                <*    End of "send" function        *>
  80. (pause, 3000)            <* Pause for a moment            *>
  81. (changemode, packet)        <* Change to "packet" mode        *>
  82.