home *** CD-ROM | disk | FTP | other *** search
/ Multimedia Magazine 7 / Multimedia-No7-11-1995.iso / BOUTIQUE / MMEDIA / LOGIN.CMD < prev    next >
OS/2 REXX Batch file  |  1995-04-21  |  2KB  |  88 lines

  1. # this TRUMPET script wiil log in to compulink, and go directly to SLIP
  2. # operation.
  3. # before using it , you need to set the username + password at
  4. # the variables below.
  5. # also, you may need to change the modem setup strings.
  6. # if you need to enter more telephone numbers, take note that :
  7. #  a. each number must be exactly 7 digits (no commas,- etc)
  8. #  b. it must be separated by the previous by exactly ONE space
  9. #  c. you must set the variable %numcount equal to the total
  10. #     number of telephone numbers you will use
  11. #  All this is necessary because the string parsing logic is
  12. #  very simple. I am sure somebody can improve it...
  13. # Note that , since Clink instists on sending screen formatting codes
  14. # even though you set the terminal to TTY, the trumpet screen display
  15. # gets VERY confused. Still, the script works, and connection is
  16. # established
  17. #
  18. # uncomment the following line if you need to see what is happening..
  19. #trace on
  20. #
  21. # set up some strings for dialling up
  22. #
  23. #MUST have all numbers as 7 digits
  24. $numbers = "9242220 9242247 9242227 9241747"
  25. %numcount = 4
  26. $username = "<your name here>"
  27. $password = "<your password>"
  28. $modemsetup = "AT&F"
  29. #end
  30. #
  31. #----------------------------------------------------------
  32. #
  33. # initialize modem
  34. #
  35. output $modemsetup\r
  36. if ! [input 10 OK\n]
  37.   display "Modem is not responding"\n
  38.   abort
  39. end
  40. #
  41. # dial
  42. #
  43. %num = 0
  44. %tries = 20
  45. repeat
  46.  $number = copy($numbers,1+(%num*8),7)
  47. # change T to P for pulse dialling
  48.  outputecho 60 "ATDT"$number\r
  49.  read 30 $result
  50.  %ok = pos("CONNECT",$result) <> 0
  51.  %num = (%num + 1) % %numcount
  52.  %tries = %tries -1
  53.  if %tries = 0
  54.   abort
  55.  end
  56. until %ok
  57. #
  58. #  wait till it's safe to send because some modem's hang up
  59. #  if you transmit during the connection phase
  60. #
  61. wait 30 dcd
  62. #
  63. #  wait for the username prompt
  64. #
  65. input 30 "ogin:"
  66. outputecho 30 "clink"\r
  67. input 30 "):"
  68. output "T"
  69. input 30 "ID..."
  70. outputecho 30 $username\r
  71. input 30 "word.:"
  72. output $password\r
  73. input 30 "?"
  74. outputecho 30 "n"\r
  75. input 30 "Main:"
  76. outputecho 30 "join internet"\r
  77. input 30 "ogin:"
  78. outputecho 30 $username\r
  79. input 30 "word:"
  80. output $password\r
  81. input 30 "(ansi)"
  82. outputecho 30 "tty"\r
  83. input 30 "$"
  84. outputecho 30 "tia"\r
  85. input 30 "SLIP software"
  86. sleep 1
  87. display \n\n\n"Connected"
  88.