proc main integer nTries = 3 string szLogin = "username:" integer nLoginTimeout = 3 string szPW = "password:" integer nPWTimeout = 3 string szPrompt = "annex:" string szConnect = "3^M" ; Set this to FALSE if you don't want to get an IP ; address boolean bUseSlip = FALSE delay 2 transmit "^M^M" ; Attempt to login at most 'nTries' times while 0 < nTries do ; Wait for the login prompt before entering waitfor szLogin then DoLogin until nLoginTimeout TryAgain: transmit "^M" ; ping nTries = nTries - 1 endwhile goto BailOut DoLogin: ; Enter user ID transmit $IHRE_USERID, raw transmit "^M" ; Wait for the password prompt waitfor szPW until nPWTimeout if FALSE == $SUCCESS then goto TryAgain endif transmit $IHR_PASSWORD, raw transmit "^M" waitfor szPrompt transmit szConnect if bUseSlip then ; An alternative to the following line is ; ; waitfor "Your address is " ; set ipaddr getip ; ; if we don't know the order of the IP addresses. set ipaddr getip 2 endif goto Done BailOut: set screen keyboard on halt Done: endproc