• Log in or sign up for an account here: https://www.sythe.org/login

Hiscores lookup

ajp121

Newcomer
Joined
Jul 22, 2008
Sythe Gold
0
Messages
10
Hey ive managed to get my program to get a users levels but im having trouble getting the xp for each skill as the string joins up the xp with the rank of the next skill in the string, as no commas seperate this like with the level.

Code:
    Private Sub btnLookUp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLookUp.Click
        Dim name As String = txtUser.Text
        Dim src As String
        Dim skill() As String
        Dim net As New Net.WebClient()
        src = net.DownloadString("http://hiscore.runescape.com/index_lite.ws?player=" + name)

        skill = src.Split(",")
        'just to test output:
        Label1.Text = skill(1)
        Label2.Text = skill(2)



        Skills()
    End Sub

skill(2) in the above code gives me the xp of the total level and the rank of attack, i do not know how to seperate these.
Any help with this would be great, im abit of a newbie.
 
Splitting the page using "," as a delimiter returns this:
Code:
71
2362
1187618100
180
99
57895409
113
99
53979359
319
99
37727836
62
99
59261315
76
99
36937262
219
99
14132317
9
99
61560194
5
99
200000000
991
99
22079278
16
99
104632668
159
99
27234122
9
99
116979706
549
99
13593918
73
99
17549671
252
99
15759831
4
99
51449695
309
99
13539614
5
99
200000000
160
99
18358162
116
99
19313985
230
99
15967700
2784
99
13145163
183
99
13218287
1912
85
3302608
2336
1944
-1
-1
-1
-1
-1
-1

What's wrong with that? Can't you just use skill(1), skill(2), etc. to get the data you specifically want ?
 
No because the html i get doesnt have a comma between the end of the xp of 1 skill and the rank of the next one, only line feeds. so when i split it it merges the 2 in the same section.
 
Why don't you split it by line feeds, and remove all commas? Seems like a plausible idea.
 
Instead of using "," as a delimiter, try "\n".

\n is a line feed.
 
Didnt work, tried replacing all commas with line feeds and vice versa and neither worked as it went through searching for all occurances of "\n" and not line feeds.

Is it because im using vb2005 and not vb6? (posted in the wrong forum and only just noticed sorry)

Thanks for the help so far anyway.
 
\n is always a line feed, regardless of language.
 
oh ok. dunno what im doing wrong then :(
can you help me abit more please?
my code:
Code:
    Private Sub btnLookUp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLookUp.Click
        Dim name As String = txtUser.Text
        Dim src As String

        Dim net As New Net.WebClient()
        src = net.DownloadString("http://hiscore.runescape.com/index_lite.ws?player=" + name)

        src = src.Replace("\n", ",")
        skill = src.Split(",")
        'just to test output:
        Label1.Text = skill(1)
        Label2.Text = skill(2)


    End Sub


    Public Function GetPageHTML(ByVal URL As String) As String
        ' Retrieves the HTML from the specified URL
        Dim objWC As New System.Net.WebClient()
        Try
            Return New System.Text.UTF8Encoding().GetString(objWC.DownloadData(URL))
        Catch ex As Exception
            Return ""

        End Try

    End Function

still merges xp of one skill with rank fo next.
 
I just think I should point out... This is .Net and your in the Visual Basic 6 section. I don't think anyone cares anymore, but whatever.
 
yeh i did point that out, only noticed half way through the topic.


edit: i still care =\
 
ok Nvm, thansk for your help cp_, solved my problem by using 2008 instead of 2005 (it keeps the spaces in the string)
 
Runescape Gamblingrunescape gambling
Back
Top