[VB6] fast and easy highscore lookup...

Discussion in 'Archives' started by asda123, Apr 1, 2008.

Thread Status:
Not open for further replies.
[VB6] fast and easy highscore lookup...
  1. Unread #1 - Apr 1, 2008 at 8:20 PM
  2. asda123
    Joined:
    May 13, 2007
    Posts:
    415
    Referrals:
    0
    Sythe Gold:
    0

    asda123 Forum Addict
    Banned

    [VB6] fast and easy highscore lookup...

    Oh god, why do you make this so confusing when it is possible with just a few lines, making it faster and more reliable - whilst still being completely customizable, this literally took me 3minutes to write.

    You need these components on Form1:

    1) Textbox - (Name it User) // This is where the users name you want to search will be entered.

    2) Command Button - (Name it Command1) // This is where the users click when they want to search.

    3) Array of Textbox - (Name it TxtValue - Number 0 to 80) // This is where the scores are show, refer to image to see how i set it out. To make an array just make one textbox copy and paste it and you will be asked if you want to add it to a control array - click yes you do.

    4) Inet Control - (Name it Inet1) // Used to connect to the high scores page on the internet and then to split the data received.

    This is how i set out the form..
    [​IMG]


    Next you simply just add this code to the command button by double clicking (I had to save it as an image because sythe refused to post when i have any code in the text).
    [​IMG]

    You may post this elsewhere but please credit me (asda123 from sythe.org).
     
  3. Unread #2 - Apr 1, 2008 at 8:27 PM
  4. dgameman1
    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0

    dgameman1 Active Member
    Banned

    [VB6] fast and easy highscore lookup...

    I don't completely understand what you said.. BUT THANKYOU very much for this =]
     
  5. Unread #3 - Apr 1, 2008 at 8:30 PM
  6. asda123
    Joined:
    May 13, 2007
    Posts:
    415
    Referrals:
    0
    Sythe Gold:
    0

    asda123 Forum Addict
    Banned

    [VB6] fast and easy highscore lookup...

    Pretty much just double click on the command button then you will have to type the code yourself, because whenever i attempted to post the code it said thread number not found and when there was no code it worked perfectly fine.
     
  7. Unread #4 - Apr 1, 2008 at 11:33 PM
  8. dgameman1
    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0

    dgameman1 Active Member
    Banned

    [VB6] fast and easy highscore lookup...

    Mind if i post that in code for you?
    Well i dont care if you say yes or no lol soo here it is///

    Code:
    Private Sub Command1_Click()
    
    Dim strlines() As String
    Dim strElemnts() As String
    Dim textboxIndex As Integer
    
    textBoxIndex = 0
    
    strLines = Split(Inet1.OpenURL("http://hiscore.runescape.com/index_lite.ws?player=" & User.Text), Char(10))
    
    If InStr(strLines(0), "Page not found") Then
    MsgBox "User Not Found!" 'Edit this line if you want to change the error user not found message
    GoTo TheEnd
    End If
    
    For i = 0 To Ubound(strLines)
    
    	strElements = Split(strLines(i), ","
    	If (strElements(x)) = "-1" Then strElements(x) = "NA" 'Edit this line if you want to change the error not in highscores message
    		TxtValue(textBoxIndex).Text = strElements(x)
    		textBoxIndex = textBoxIndex + 1
    	Next x
    
    Next i
    
    TheEnd:
    End Sub
     
  9. Unread #5 - Apr 18, 2008 at 12:27 PM
  10. flappy
    Referrals:
    0

    flappy Guest

    [VB6] fast and easy highscore lookup...

    what is the Inet thing? i dont know where to find taht at ...
     
  11. Unread #6 - Apr 18, 2008 at 1:05 PM
  12. superman1478
    Joined:
    Jan 21, 2007
    Posts:
    701
    Referrals:
    2
    Sythe Gold:
    0

    superman1478 Apprentice

    [VB6] fast and easy highscore lookup...

    Press Ctrl+t, scroll down until you see "Microsoft Internet Transfer Controls 6.0" then check mark the box next to it and click apply.
     
  13. Unread #7 - Apr 18, 2008 at 1:10 PM
  14. flappy
    Referrals:
    0

    flappy Guest

    [VB6] fast and easy highscore lookup...

    this doesnt work no matter what i do... now it says that Char(10) is not recognized
     
  15. Unread #8 - Apr 18, 2008 at 1:29 PM
  16. flappy
    Referrals:
    0

    flappy Guest

    [VB6] fast and easy highscore lookup...

    okay well first off dgamemans code has a few errors so i would post the code but the stupid forums wont let me ...

    --------------------------------------------------------------
    --------------------------------------------------------------


    and second of all i dont think i am labeling them right i am naming each box TxtValue0, TxtValue1, TxtValue2, and so forth ...

    now when i compile i come up with an error here:


    TxtValue(textboxIndex).Text = strElements(x)


    it says:

    Compile Error:

    Sub or Function Cannot be Defined.

    and then highlights TxtValue
     
  17. Unread #9 - Apr 18, 2008 at 1:59 PM
  18. flappy
    Referrals:
    0

    flappy Guest

    [VB6] fast and easy highscore lookup...

    okay well i no longer get that i get a runtime error "424": object required on the line of code that opens the site



    strlines = Split(Inet1 .......
     
  19. Unread #10 - Apr 18, 2008 at 5:14 PM
  20. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    [VB6] fast and easy highscore lookup...

    I use to know how to dynamically create the iNet control using a certain method when declaring the object. I forgot which one, but it saved a bit of time.
     
  21. Unread #11 - Apr 19, 2008 at 2:29 AM
  22. flappy
    Referrals:
    0

    flappy Guest

    [VB6] fast and easy highscore lookup...

    any help here?
     
  23. Unread #12 - Apr 19, 2008 at 10:52 AM
  24. Covey
    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    [VB6] fast and easy highscore lookup...

    Code:
    Dim Inet1 As Object
    Set Inet1 = CreateObject("InetCtls.Inet")
     
  25. Unread #13 - Apr 19, 2008 at 11:19 AM
  26. flappy
    Referrals:
    0

    flappy Guest

    [VB6] fast and easy highscore lookup...

    what does this do?
     
  27. Unread #14 - Apr 20, 2008 at 5:46 PM
  28. dgameman1
    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0

    dgameman1 Active Member
    Banned

    [VB6] fast and easy highscore lookup...

    Triple post much? Oh and this is a "fast and easy highscore lookup..." code.
     
  29. Unread #15 - Apr 20, 2008 at 8:01 PM
  30. flappy
    Referrals:
    0

    flappy Guest

    [VB6] fast and easy highscore lookup...

    well no crap lol i meant what does coveys code do
     
  31. Unread #16 - Apr 20, 2008 at 10:44 PM
  32. Jazz00006
    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0

    Jazz00006 Apprentice
    Visual Basic Programmers

    [VB6] fast and easy highscore lookup...

    If you read his post properly, you will see that he has quoted Swan on creating a Inet control dynamicly. This means that you do NOT have to place it on your form for it to be used, it creates it when the form is loaded (Form_Load) and allows the programmer to save space on his form.



    A working demonstration can be found here: http://sythe.org/showthread.php?t=389973
     
  33. Unread #17 - Oct 12, 2008 at 5:42 AM
  34. AlexOwnzl0l
    Referrals:
    0

    AlexOwnzl0l Guest

    [VB6] fast and easy highscore lookup...

    it says compile error sub or fucntion not defined then it highlights TxtValue
     
  35. Unread #18 - Oct 23, 2008 at 5:11 AM
  36. Kariem
    Joined:
    Oct 23, 2008
    Posts:
    3
    Referrals:
    0
    Sythe Gold:
    0

    Kariem Newcomer

    [VB6] fast and easy highscore lookup...

    Sorry for bumping this old thread, I know I'm new, but if you can help, please help.
    I don't get an error anymore, I fixed the link.

    The new link is(?):
    http://hiscore.runescape.com/hiscorepersonal.ws?user1= after = the name.

    I replaced that link for the old one, and added On Error Resume Next
    But now I get this:
    [​IMG]
    [​IMG]

    Does someone know what's wrong?
     
  37. Unread #19 - Oct 23, 2008 at 5:36 AM
  38. Jazz00006
    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0

    Jazz00006 Apprentice
    Visual Basic Programmers

    [VB6] fast and easy highscore lookup...

    For starters, your URL is wrong.

    http://hiscore.runescape.com/index_lite.ws?player= is the correct link, it links to the programmer friendly version, which is why you are getting errors when splitting the info.

    Retry with the correct URL and then post your errors, as they will most likely be different with different info to display.
     
  39. Unread #20 - Oct 23, 2008 at 5:47 AM
  40. Kariem
    Joined:
    Oct 23, 2008
    Posts:
    3
    Referrals:
    0
    Sythe Gold:
    0

    Kariem Newcomer

    [VB6] fast and easy highscore lookup...

    1. I can't choose User.text only:
    User.Item
    User.UBound
    User.LBound
    User.Count

    I don't know which to choose, I did all of them but all of them contains:"Page not found" that msgbox shizzle

    my code is:

    Code:
    Private Sub Command1_Click()
    
    On Error Resume Next
    Dim strLines() As String
    Dim strElements() As String
    Dim textBoxIndex As Integer
    
    textBoxIndex = 0
    
    strLines = Split(Inet1.OpenURL("http://hiscore.runescape.com/index_lite.ws?player=" & Username.UBound), Chr(10))
    
    If InStr(strLines(O), "Page not found") Then
    MsgBox ("User not found!"), vbCritical, ("Error")
    GoTo TheEnd:
    End If
    
    For i = 0 To UBound(strLines)
    
    strElements = Split(strLines(i), ",")
    For X = 0 To UBound(strElements)
    If (strElements(X)) = "-1" Then strElements(X) = "N/A"
    txtValue(textBoxIndex).Text = strElements(X)
    textBoxIndex = textBoxIndex + 1
    Next X
    
    Next i
    TheEnd:
    
    End Sub
    
    User = Username here, I changed it :p
     
< Cant remember? | Price check 80 holy pally >

Users viewing this thread
1 guest
Thread Status:
Not open for further replies.


 
 
Adblock breaks this site