Results 1 to 2 of 2

Thread: HighScore Array List

  1. #1
    Join Date
    Feb 2007
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default HighScore Array List

    When getting stats off the highscores you can use the following text to help you parse the data.

    PHP Code:
    Overall Rank
    Overall Level
    Overall Expereince
    Attack Level
    Attack Experience and Rank
    Defence Level
    Defence Experience and Rank
    Strength Level
    Strength Experience and Rank
    Hitpoints Level
    10 
    Hitpoints Experience and Rank
    11 
    Ranged Level
    12 
    Ranged Experience and Rank
    13 
    Prayer Level
    14 
    Prayer Experience and Rank
    15 
    Magic Level
    16 
    Magic Experience and Rank
    17 
    Cooking Level
    18 
    Cooking Experience and Rank
    19 
    Woodcutting Level
    20 
    Woodcutting Experience and Rank
    21 
    Fletching Level
    22 
    Fletching Experience and Rank
    23 
    Fishing Level
    24 
    Fishing Experience and Rank
    25 
    Firemaking Level
    26 
    Firemaking Experience and Rank
    27 
    Crafting Level
    28 
    Crafting Experience and Rank
    29 
    Smithing Level
    30 
    Smithing Experience and Rank
    31 
    Mining Level
    32 
    Mining Experience and Rank
    33 
    Herblore Level
    34 
    Herblore Experience and Rank
    35 
    Agility Level
    36 
    Agility Experience and Rank
    37 
    Theving Level
    38 
    Theiving Experience and Rank
    39 
    Slayer Level
    40 
    Slayer Experience and Rank
    41 
    Farming Level
    42 
    Farming Experience and Rank
    43 
    Runecrafting Level
    44 
    Runecrafting Experience and Rank
    45 
    Hunter Level
    46 
    Hunter Experience and Rank
    47 
    Construction Level
    48 
    Construction Experience and Rank
    49 
    Summoning Level
    50 
    Summoning Rank 
    If you were to put the strength level in a label, you would do it like:

    Code:
    'after you get the data
    dim rawdata() as string
    me.lblStrLvl.text = rawdata(7)
    Here is a function I use when I make my custom clients:

    it is simply coded, no loops etc.
    Code:
    Function getStats(ByVal username As String)
            parsedData = Nothing
            'combat skills
            Dim Strength, Attack, Defence, Prayer, HitPoints, Magic, Range, Summoning As Integer
            'noncombat skills
            Dim Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblore, Agility, Theving, Slayer, Farming, Runecrafting, Hunter, Construction As Integer
          
            'http://hiscore.runescape.com/index_lite.ws?player=
    
            Dim rawdata As String
            'Gets the data of the stats
            Dim wc As New System.Net.WebClient
            Try
                Debug.WriteLine("Trying to get user data")
                rawdata = wc.DownloadString("http://hiscore.runescape.com/index_lite.ws?player=" & username)
    
            Catch ex As Exception
                Debug.WriteLine("---------------------------")
                Debug.WriteLine("An error has occured!")
                Debug.WriteLine(ex)
                Me.Refresh()
                Debug.WriteLine("---------------------------")
            End Try
            'parse the data
    
            Try
                Debug.WriteLine("Data is downloaded, now attempting to parse")
                parsedData = rawdata.Split(",")
            Catch ex As Exception
                Debug.WriteLine("---------------------------")
                Debug.WriteLine("An error has occured!")
                Debug.WriteLine(ex)
                Debug.WriteLine("---------------------------")
            End Try
            Debug.WriteLine("Data has been parsed! Now putting in user form.")
    
    
            Try
                'Levels 
                Strength = parsedData(7)
                Attack = parsedData(3)
                Defence = parsedData(5)
                Prayer = parsedData(13)
                HitPoints = parsedData(9)
                Magic = parsedData(15)
                Range = parsedData(11)
                Summoning = parsedData(49)
    
                Cooking = parsedData(17)
                Woodcutting = parsedData(19)
                Fletching = parsedData(21)
                Fishing = parsedData(23)
                Firemaking = parsedData(25)
                Crafting = parsedData(27)
                Smithing = parsedData(29)
                Mining = parsedData(31)
                Herblore = parsedData(33)
                Agility = parsedData(35)
                Theving = parsedData(37)
                Slayer = parsedData(39)
                Farming = parsedData(41)
                Runecrafting = parsedData(43)
                Hunter = parsedData(45)
                Construction = parsedData(47)
    
                '___________________________________
    
                If Strength < 0 Then Strength = 1
                If Attack < 0 Then Attack = 1
                If Defence < 0 Then Defence = 1
                If Prayer < 0 Then Prayer = 1
                If HitPoints < 0 Then HitPoints = 1
                If Magic < 0 Then Magic = 1
                If Range < 0 Then Range = 1
                If Summoning < 0 Then Summoning = 1
                If Cooking < 0 Then Cooking = 1
                If Woodcutting < 0 Then Woodcutting = 1
                If Fletching < 0 Then Fletching = 1
                If Fishing < 0 Then Fishing = 1
                If Firemaking < 0 Then Firemaking = 1
                If Crafting < 0 Then Crafting = 1
                If Smithing < 0 Then Smithing = 1
                If Mining < 0 Then Mining = 1
                If Herblore < 0 Then Herblore = 1
                If Agility < 0 Then Agility = 1
                If Theving < 0 Then Theving = 1
                If Slayer < 0 Then Slayer = 1
                If Farming < 0 Then Farming = 1
                If Runecrafting < 0 Then Runecrafting = 1
                If Hunter < 0 Then Hunter = 1
                If Construction < 0 Then Construction = 1
    
            Catch ex As Exception
                Debug.WriteLine("---------------------------")
                Debug.WriteLine("An error has occured!")
                Debug.WriteLine(ex)
                Debug.WriteLine("---------------------------")
            End Try
            '_____________________________________
    
    'insert code to put in textboxes here
    
    End Funtion
    I have attached a sample file using my function.
    Last edited by bballer; 04-29-2009 at 10:35 AM. Reason: added example exe file

  2. #2
    Join Date
    Aug 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your function doesn't return anything...It would be far more efficient if it returned a string array.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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