Private Sub Timer1_Timer()
logpath = App.Path & "\data\log\log.txt" 'log path lang to
On Error Resume Next ' --- resume lang kapagka may runtime errors
Dim line(5000) As String ' <---- multilines set to this value
Dim log_ctr, last_log, n As Integer 'Declarations
Open logpath For Input Lock Read As #1
'=== Loop reads the entries in log.txt and place to var for writing later ===
Do Until EOF(1)
Line Input #1, line(log_ctr)
log_ctr = log_ctr + 1
Loop
Close #1 'close file after
'---- Lets start writing the lines we read from the DO UNTIL loop
If last_log <> log_ctr Then
For n = last_log To log_ctr - 1 '== FOR LOOP TO WRITE TO LOG WINDOW
txtLog.SelText = line
& vbCrLf '----write the lines sa
'-- pag may word na exiting on the nth line...then
If InStrRev(line
, "exiting") > 0 Then
MsgBox "An error has occured that prevents connection", vbCritical + vbOKOnly, "SERVER LOGIN FAILED"
lblStatus.Caption = "Disconnected"
txtLog.Text = "An error has been detected. Check that your Globe Tattoo or Smart BRO is connected to your PC and that you have successfully connected its default software and then try again."
stoptimer
'-- if may soft, auth-failure naman:
ElseIf InStrRev(line
, "soft,auth-failure") > 0 Then
MsgBox "Authentication Failed: Check User/Pass", vbCritical + vbOKOnly, "SERVER LOGIN FAILED"
lblStatus.Caption = "Disconnected"
txtLog.Text = "Invalid username or password. Please check your Login details and make sure you supply the correct username and password that we have provided for you to connect to our servers. If you dont have an account, then please visit
http://unlisurf.infiniteserve.com to get one."
stoptimer
'else if may:
ElseIf InStrRev(line
, "There are no TAP") > 0 Then
' maginstal tau ng TAP...wala raw eh lol
lblStatus.Caption = "Disconnected"
MsgBox "No TAP Drivers detected. Installing..."
Shell App.Path & "\app\bin\addtap32.bat", vbHide
stoptimer
' and finally kapagka eto naman ang nakita nya:
ElseIf InStrRev(line
, "Initialization Sequence Completed") > 0 Then
frmMain.Width = 3075
frmMain.Height = 4845
lblStatus.Caption = "Connected...-_-"
cmdConnect.Caption = "CONNECTED"
stoptimer
'Close #1 close log file just incase
End If
'---- eto yung nag nenext line sa log.txt
'--- this will loop until the conditions above are met
Next
last_log = log_ctr
End If
End Sub