Adblock breaks this site

[VB6] fast and easy highscore lookup...

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

Thread Status:
Not open for further replies.
  1. asda123

    asda123 Forum Addict
    Banned

    Joined:
    May 13, 2007
    Posts:
    415
    Referrals:
    0
    Sythe Gold:
    0
    [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).
     
  2. dgameman1

    dgameman1 Active Member
    Banned

    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0
    [VB6] fast and easy highscore lookup...

    I don't completely understand what you said.. BUT THANKYOU very much for this =]
     
  3. asda123

    asda123 Forum Addict
    Banned

    Joined:
    May 13, 2007
    Posts:
    415
    Referrals:
    0
    Sythe Gold:
    0
    [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.
     
  4. dgameman1

    dgameman1 Active Member
    Banned

    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0
    [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
     
  5. flappy

    flappy Guest

    Referrals:
    0
    [VB6] fast and easy highscore lookup...

    what is the Inet thing? i dont know where to find taht at ...
     
  6. superman1478

    superman1478 Apprentice

    Joined:
    Jan 21, 2007
    Posts:
    701
    Referrals:
    2
    Sythe Gold:
    0
    [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.
     
  7. flappy

    flappy Guest

    Referrals:
    0
    [VB6] fast and easy highscore lookup...

    this doesnt work no matter what i do... now it says that Char(10) is not recognized
     
  8. flappy

    flappy Guest

    Referrals:
    0
    [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
     
  9. flappy

    flappy Guest

    Referrals:
    0
    [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 .......
     
  10. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    [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.
     
  11. flappy

    flappy Guest

    Referrals:
    0
    [VB6] fast and easy highscore lookup...

    any help here?
     
  12. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    [VB6] fast and easy highscore lookup...

    Code:
    Dim Inet1 As Object
    Set Inet1 = CreateObject("InetCtls.Inet")
     
  13. flappy

    flappy Guest

    Referrals:
    0
    [VB6] fast and easy highscore lookup...

    what does this do?
     
  14. dgameman1

    dgameman1 Active Member
    Banned

    Joined:
    May 25, 2006
    Posts:
    122
    Referrals:
    0
    Sythe Gold:
    0
    [VB6] fast and easy highscore lookup...

    Triple post much? Oh and this is a "fast and easy highscore lookup..." code.
     
  15. flappy

    flappy Guest

    Referrals:
    0
    [VB6] fast and easy highscore lookup...

    well no crap lol i meant what does coveys code do
     
  16. Jazz00006

    Jazz00006 Apprentice
    Visual Basic Programmers

    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0
    [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
     
  17. AlexOwnzl0l

    AlexOwnzl0l Guest

    Referrals:
    0
    [VB6] fast and easy highscore lookup...

    it says compile error sub or fucntion not defined then it highlights TxtValue
     
  18. Kariem

    Kariem Newcomer

    Joined:
    Oct 23, 2008
    Posts:
    3
    Referrals:
    0
    Sythe Gold:
    0
    [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?
     
  19. Jazz00006

    Jazz00006 Apprentice
    Visual Basic Programmers

    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0
    [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.
     
  20. Kariem

    Kariem Newcomer

    Joined:
    Oct 23, 2008
    Posts:
    3
    Referrals:
    0
    Sythe Gold:
    0
    [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 >
Thread Status:
Not open for further replies.


 
 
Adblock breaks this site