Dim web As New Net.WebClient
Dim lviLevel, lvicount, lvimember, lviAgent As Integer
Dim lviLoop1, lviLoop2, lviloop3, lviloop4, lviloop5, lviloop6, lviloop7, lviloop8 As Integer
Dim strLevel, strName, strtime, strscore, strMember(2000), lvsLevel(20) As String
Dim lvbOK As Boolean
FileOpen(2, gfPath() + "Members.txt", OpenMode.Output)
For lviLevel = 1 To 20
Me.Text = "Updating " + lvsLevel(lviLevel)
FileClose(1)
FileOpen(1, gfPath() + "level" + Trim(Str(lviLevel)) + ".txt", OpenMode.Output)
strLevel = System.Text.Encoding.Default.GetString(web.DownloadData("[URL]http://www.the-elite.net/GE/stage[/URL]" + Trim(Str(lviLevel)) + ".htm"))
For lviLoop1 = 1 To Len(strLevel)
If Mid(strLevel, lviLoop1, 8) = "</table>" Then
Exit For
End If
If Mid(strLevel, lviLoop1, 4) = "<td>" Then
For lviLoop2 = lviLoop1 + 4 To Len(strLevel)
If Mid(strLevel, lviLoop2, 1) = ">" Then
For lviloop3 = lviLoop2 + 1 To Len(strLevel)
If Mid(strLevel, lviloop3, 1) = "<" Then
'We have the name!!! = strName
strName = Mid(strLevel, lviLoop2 + 1, lvicount)
lvicount = 0
For lviloop4 = lviLoop2 + 1 To Len(strLevel)
If Mid(strLevel, lviloop4, 4) = "<td>" Then
For lviloop5 = lviloop4 + 4 To Len(strLevel)
If Mid(strLevel, lviloop5, 1) = "<" Then
'We have the time!!! = strTime
strtime = Trim(Mid(strLevel, lviloop4 + 4, lvicount - 2))
lvicount = 0
For lviloop6 = lviloop5 To Len(strLevel)
If Mid(strLevel, lviloop6, 1) = ">" Then
For lviloop7 = lviloop6 + 1 To Len(strLevel)
If Mid(strLevel, lviloop7, 1) = "<" Then
'We have the score!!! = strScore
strscore = Mid(strLevel, lviloop6 + 1, lvicount)
lvicount = 0
lviLoop1 = lviloop7
lviAgent += 1
If lviAgent = 4 Then
lviAgent = 1
End If
Write(1, strName, lviAgent, strtime, strscore)
If lviLevel = 1 Then
lvbOK = True
For lviloop8 = 1 To 2000
If strMember(lviloop8) = strName Then
lvbOK = False
Exit For
End If
Next
If lvbOK Then
lvimember += 1
strMember(lvimember) = strName
Write(2, strName)
End If
End If
Exit For
End If
lvicount += 1
Next
Exit For
End If
Next
Exit For
End If
lvicount += 1
Next
Exit For
End If
Next
Exit For
End If
lvicount += 1
Next
Exit For
End If
Next
End If
Next
psbTotal.Increment(4)
Next
FileClose()