Click to See Complete Forum and Search --> : RAS If then Multi Accounts


Netbairro
03-16-2002, 10:11 PM
We are college students using 4 internet accounts to access the ISP for email. We share these accounts and have created the script below. We have a problem if one dials to the ISP and the server Replys "Invalid Username or Password". We know that one of us is using the account so one have to move on to the next account and dial again. This is due to the fact that the ISP only allows one logon per account. Is there a way to get the script to move to the next account if the first one is logged on so that we do not have to dial everytime. Thanks in advance.

proc main
integer nTries = 3
string szLogin = "username:"
integer nLoginTimeout = 3
string szPW = "password:"
integer nPWTimeout = 3

string szPrompt = "annex:"
string szConnect = "^M"

boolean bUseSlip = FALSE
delay 1
transmit "^M^M"
while 0 < nTries do
waitfor szLogin then DoLogin
until nLoginTimeout

TryAgain:
transmit "^M" ; ping
nTries = nTries - 1

endwhile

goto BailOut

DoLogin:
delay 1
if $USERID == "1" then
transmit "jonnes"
endif
if $USERID == "2" then
transmit "randall"
endif
if $USERID == "3" then
transmit "fosmoz"
endif
if $USERID == "4" then
transmit "iac"
endif

transmit "^M"
waitfor szPW until nPWTimeout
if FALSE == $SUCCESS then
goto TryAgain
endif
if $PASSWORD == "1" then
transmit "jonnesbaz"
endif
if $PASSWORD == "2" then
transmit "shalom7"
endif
if $PASSWORD == "3" then
transmit "f9015u"
endif
if $PASSWORD == "4" then
transmit "b1136y"
endif

transmit "^M^M"

transmit szConnect

if bUseSlip then

set ipaddr getip 2
endif
goto Done

BailOut:
set screen keyboard on
halt

Done:

endproc