Adblock breaks this site

[TUT]Highscores Grabber[TUT]

Discussion in 'Programming General' started by master447, Jul 3, 2010.

  1. master447

    master447 Active Member
    Banned

    Joined:
    Nov 5, 2007
    Posts:
    169
    Referrals:
    0
    Sythe Gold:
    0
    [TUT]Highscores Grabber[TUT]

    this is for vb express 2010,

    well ive seen a lot of people requesting on how to get a high-scores grabber. this is done through praising, most people do not know what that is so im just gonna skip to the chase.

    This is a brief tutorial and will only cover 1 stat dont want to make it to easy for people ;)


    1)Add 2 labels and a button to your program,


    2)double click the button so that you have the code brought up.


    3)anywhere add this chuck of code,

    Code:
        Public Function parseHtml(ByVal Name As String) As String()
            Dim Html As String
            Dim word As Integer = 0
            Html = GetPageHTML("http://hiscore.runescape.com/index_lite.ws?player=" + TextBoxX1.Text)
            Dim result(Html.Length) As String
            Dim length As Integer = Html.Length
            If (Html = "") Then
                Dim nil(1) As String
                Return nil
            End If
            For i As Integer = 0 To length - 1
                If (IsNumeric(Html.Chars(i)) = False) Then
                    If (Html.Chars(i) = "-") Then
                        result(word) = "N/a"
                        word = word + 1
                        i = i + 2
                    Else
                        word = word + 1
                    End If
                Else
                    result(word) = result(word) & Html.Chars(i)
                End If
            Next
            Return result
        End Function
    then for your button code use this,

    Code:
        Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
            scores = parseHtml(TextBoxX1.Text)
            Try
                Label1.Text = "Level:" + scores(4)
                Label2.Text = "Xp:" + scores(5)
            Catch ex As Exception
                Label1.Text = "Xp:N\A"
                Label2.Text = "Level:N\A"
                ProgressBar1.Value = 0
            End Try
    ok so the part that is like
    Code:
                Label1.Text = "Level:" + scores(4)
                Label2.Text = "Xp:" + scores(5)
    the scores(4) is attack level 5 is the xp i think im doing this from my head. so mess around with it till u get it right, so just add more labels and code to your program to get all the stats,
     
  2. freddy1990

    freddy1990 Active Member

    Joined:
    Jul 1, 2005
    Posts:
    149
    Referrals:
    1
    Sythe Gold:
    0
    [TUT]Highscores Grabber[TUT]

    Heh, I think normally a tutorial would explain how the code works :p
    Also, is GetPageHTML even a default VB function?
     
  3. Blupig

    Blupig BEEF TOILET
    $5 USD Donor

    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant
    [TUT]Highscores Grabber[TUT]

    Code:
    Dim WC as New WebClient
    Dim STR as String = WC.DownloadString("website")
    
    EDIT: Before I forget OP, please post in the right section next time.
     
  4. TheHacker

    TheHacker Guru

    Joined:
    Apr 1, 2009
    Posts:
    1,088
    Referrals:
    0
    Sythe Gold:
    0
    [TUT]Highscores Grabber[TUT]

    Hmmm interesting, nice
     
  5. Burn Notice

    Burn Notice Newcomer
    Banned

    Joined:
    Aug 23, 2010
    Posts:
    23
    Referrals:
    0
    Sythe Gold:
    0
    [TUT]Highscores Grabber[TUT]

    Confused on what it does
     
  6. Itz_you202

    Itz_you202 Active Member

    Joined:
    Aug 13, 2010
    Posts:
    176
    Referrals:
    0
    Sythe Gold:
    0
    [TUT]Highscores Grabber[TUT]

    I don't get it :s.
     
  7. blindkilla

    blindkilla Guru
    $25 USD Donor New

    Joined:
    Jun 22, 2005
    Posts:
    1,896
    Referrals:
    0
    Sythe Gold:
    6
    Discord Unique ID:
    282000633404456960
    Discord Username:
    sogord
    [TUT]Highscores Grabber[TUT]

    It's a highscores grabber (as the OP clearly states), but I'm sure you guys were just posting to get your post count up.
     
< [HELP] YouTube subscriber bot. | Looking for VOLUNTEER developers >


 
 
Adblock breaks this site