home *** CD-ROM | disk | FTP | other *** search
/ .net 1999 December / netCD65.iso / pc / Software / VirtualA / 32bit / vasetup.exe / %MYDIR% / CIX.SCR < prev    next >
Encoding:
Text File  |  1999-10-06  |  1.7 KB  |  60 lines

  1. ' Login procedure for telnet Cix
  2.  
  3. Declare Sub LogResult(result As String)
  4. Declare Function WaitForEitherTimed(s1 As String, s2 As String, timeout As Integer) As String
  5.  
  6. 'T:SendRlogin (subroutine) (CIX)
  7. Sub SendRloginCIX(t As Tracker)
  8.     Comms.Send "rlogin 194.153.0.50\r"
  9.     t.reset
  10. End Sub
  11.  
  12. 'T:SendRlogin (subroutine) (CIX)
  13. Sub SendRloginTOM(t As Tracker)
  14.     Comms.Send "rlogin 194.153.0.51\n"
  15.     t.reset
  16. End Sub
  17.  
  18. Function Login()
  19.     Dim t As Tracker
  20.     Dim LineEnd as String
  21.     Dim DialString as String
  22.  
  23.     'If connecting to tom then use \r not \n
  24.     DialString = LCase(ReadIni$(Session.IniSection, "Phone", Session.IniFileName))
  25.     if InStr(DialString, "tom.") > 0 Then
  26.         LineEnd = "\n"
  27.         Set t = CreateTracker("AnnexPrompt", "\nannex:", "SendRloginCIX")
  28.     else
  29.         LineEnd = "\r"
  30.         Set t = CreateTracker("AnnexPrompt", "\nannex:", "SendRloginTOM")
  31.     End If
  32.  
  33.     On Error Goto Login_error
  34.     If Not RepeatWaitWithKick("ogin:", LineEnd, 2) Then
  35.         t.delete
  36.         Login = False
  37.         Exit Function
  38.     End If
  39.     t.delete
  40.     Comms.Send "qix" + LineEnd
  41.     WaitForTimed "new user)", 900
  42.     Comms.Send Session.LoginName + LineEnd
  43.     If Session.Password<>"" Then
  44.         If WaitForEitherTimed("assword:", "Your pointers", 300)<>"assword:" Then
  45.             LogResult "Your pointers are being updated.  Please try again in a few minutes."
  46.             Login = False
  47.             Exit Function
  48.         End If
  49.         Comms.SendEncrypted Session.Password
  50.         Comms.Send LineEnd
  51.     End If
  52.     Login = True
  53.     Exit Function
  54. Login_Error:
  55.     If Err <> 1002 Then LogResult "Error " + Str$(Err) + ":" + Error$ + Basic.Eoln$ + "While trying to log on"
  56.     Login = False
  57.     Exit Function
  58. End Function
  59.  
  60.