home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Multimedia Magazine 7
/
Multimedia-No7-11-1995.iso
/
BOUTIQUE
/
MMEDIA
/
LOGIN.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-04-21
|
2KB
|
88 lines
# this TRUMPET script wiil log in to compulink, and go directly to SLIP
# operation.
# before using it , you need to set the username + password at
# the variables below.
# also, you may need to change the modem setup strings.
# if you need to enter more telephone numbers, take note that :
# a. each number must be exactly 7 digits (no commas,- etc)
# b. it must be separated by the previous by exactly ONE space
# c. you must set the variable %numcount equal to the total
# number of telephone numbers you will use
# All this is necessary because the string parsing logic is
# very simple. I am sure somebody can improve it...
# Note that , since Clink instists on sending screen formatting codes
# even though you set the terminal to TTY, the trumpet screen display
# gets VERY confused. Still, the script works, and connection is
# established
#
# uncomment the following line if you need to see what is happening..
#trace on
#
# set up some strings for dialling up
#
#MUST have all numbers as 7 digits
$numbers = "9242220 9242247 9242227 9241747"
%numcount = 4
$username = "<your name here>"
$password = "<your password>"
$modemsetup = "AT&F"
#end
#
#----------------------------------------------------------
#
# initialize modem
#
output $modemsetup\r
if ! [input 10 OK\n]
display "Modem is not responding"\n
abort
end
#
# dial
#
%num = 0
%tries = 20
repeat
$number = copy($numbers,1+(%num*8),7)
# change T to P for pulse dialling
outputecho 60 "ATDT"$number\r
read 30 $result
%ok = pos("CONNECT",$result) <> 0
%num = (%num + 1) % %numcount
%tries = %tries -1
if %tries = 0
abort
end
until %ok
#
# wait till it's safe to send because some modem's hang up
# if you transmit during the connection phase
#
wait 30 dcd
#
# wait for the username prompt
#
input 30 "ogin:"
outputecho 30 "clink"\r
input 30 "):"
output "T"
input 30 "ID..."
outputecho 30 $username\r
input 30 "word.:"
output $password\r
input 30 "?"
outputecho 30 "n"\r
input 30 "Main:"
outputecho 30 "join internet"\r
input 30 "ogin:"
outputecho 30 $username\r
input 30 "word:"
output $password\r
input 30 "(ansi)"
outputecho 30 "tty"\r
input 30 "$"
outputecho 30 "tia"\r
input 30 "SLIP software"
sleep 1
display \n\n\n"Connected"