Results 1 to 3 of 3

Thread: [Solved]Doesn't check all players.

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2004
    Posts
    43

    Resolved [Solved]Doesn't check all players.

    VB Code:
    1. Private Sub Command1_Click()
    2. If Winsock1.State = 0 Then Winsock1.Connect
    3.    Dim strHttpRequest As String
    4.  
    5.    strHttpRequest = "GET /statistics/?subtopic=whoisonline&world=" & txtWorld.Text & vbCrLf
    6.  
    7.    strHttpRequest = strHttpRequest & _
    8.                     "Host: tibia.com" & vbCrLf
    9.    'add optional header "Accept"
    10.    strHttpRequest = strHttpRequest & "Accept: */*" & vbCrLf
    11.    'add the "Connection" header to force
    12.    'the server to close the connection
    13.    '
    14.    'send the request
    15.    Winsock1.SendData strHttpRequest
    16.    Command1.Enabled = False
    17.    Timer1.Enabled = True
    18.  
    19. End Sub
    20. Private Sub Command2_Click()
    21. Dim Char, Char2 As String
    22. Dim CharPos1, CharPos2 As String
    23. Dim I As Integer
    24. For I = 0 To lstPlayer.ListCount
    25. Char = lstPlayer.List(I)
    26. CharPos1 = InStr(1, strData, Char, vbTextCompare)
    27. If CharPos1 > 1 Then
    28. lstStatus.AddItem Char + " : Online"
    29. I = I + 1
    30. ElseIf CharPos1 <= 1 Then
    31. lstStatus.AddItem Char + " : Offline"
    32. I = I + 1
    33. End If
    34. Next I
    35.  
    36. I = 0
    37. For I = 0 To lstPlayer.ListCount
    38. If lstStatus.List(I) = ": Offline" Then
    39. lstStatus.RemoveItem I
    40. End If
    41. I = I + 1
    42. Next I
    43.  
    44. End Sub
    45.  
    46. Private Sub Command3_Click()
    47. MsgBox lstPlayer.List(I)
    48. Open "vip.ini" For Output As #1
    49. Print #1, strData
    50. Close #1
    51.  
    52. End Sub
    53.  
    54. Private Sub Form_Load()
    55. Winsock1.Connect
    56. End Sub
    57.  
    58.  
    59. Private Sub Timer1_Timer()
    60.    Command1.Enabled = True
    61.    Timer1.Enabled = False
    62.    Winsock1.Close
    63. End Sub
    64.  
    65. Private Sub Winsock1_Connect()
    66. lblStatus.Caption = "Online"
    67. End Sub
    68.  
    69. Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    70. Winsock1.PeekData strData
    71. 'Text1.Text = strData & vbCrLf
    72. End Sub

    If now it only adds those who are online and doesn't check offline status. If you want to see for yourself I've added the exe file, to test write in the world 'Eternia'.
    Attached Files Attached Files
    Last edited by Forge; Nov 22nd, 2004 at 06:32 AM.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    The website only tells you about the ones that are online currently. They don't tell you all of the players. You could keep a list of certain players, and then check to see if THEY are online.

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2004
    Posts
    43
    Well, I searched the string if that player was online then it would give me a value over 0, so if there was a value over 0 then I would add it to the online list on my program. I've made it easier and seperated Offline and Onlines right now.

    Why it didn't check all players were due to my fatal misstake I = I + 1 as I forgot it added automatically.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width