RuneScape Stats

By PcDark on Jul 05, 2007

This stats snippet gets RuneScape statistics from a parser that I made located at http://parsers.o-ss.net/oneline/stats.php

The syntax to use the snippet is easy to use:

!(rs)stats

@(rs)stats

.(rs)stats

This is a remote script, and goes into your remotes section (alt+r)

on $*:TEXT:/^[!@.](rs)?stats */Si:#: {
  if (!$2) { .notice $nick Enter an RSN to look up! | halt }
  if ($len($2) > 12) { .notice $nick RSN too long! | halt }
  var %x = 1
  while ($sock(rsstats. $+ %x)) inc %x
  .set %target. $+ %x $iif($left($1,1) == @,.msg $chan,.notice $nick)
  .set %rsn. $+ %x $replace($2-,$chr(32),+)
  sockopen rsstats. $+ %x parsers.o-ss.net 80
}
on *:sockopen:rsstats.*: {
  var %x = $right($sockname,1)
  if ($sockerr > 0) { %target. [ $+ [ %x ] ] Socket Error: $sockerr | cleanup $sockname | halt }
  sockwrite -nt $sockname GET /oneline/stats.php?user= $+ %rsn. [ $+ [ %x ] ] $+ &showcmb=1&showcollons=1 HTTP/1.1
  sockwrite -nt $sockname Host: parsers.o-ss.net
  sockwrite -nt $sockname $crlf
}
on *:sockread:rsstats.*: {
  var %x = $right($sockname,1)
  if ($sockerr > 0) { %target. [ $+ [ %x ] ] Socket Error: $sockerr | cleanup $sockname | halt }
  var %read | sockread %read
  if (: 0 isin %read) { %target. [ $+ [ %x ] ] %rsn. [ $+ [ %x ] ] is not in the Hi-Scores.  You have to be in the top million of any skill with a skill level of at least 30. | cleanup $sockname }
  if (combat isin %read) { %target. [ $+ [ %x ] ] $remove(%read,END) }
  if (overall isin %read) { %target. [ $+ [ %x ] ] $remove(%read,END,|) | cleanup $sockname }
}
alias cleanup {
  unset %target. $+ $right($1,1)
  unset %rsn. $+ $right($1,1)
  sockclose $1
}

Comments

Sign in to comment.
Bielie   -  May 13, 2011

agreed.. :P As you can see its a straight copy of one of my old scripts. It still contains aliases that doesnt excist if you dont custom made them.

 Respond  
napa182   -  May 12, 2011

lol @ Jethro_, but so true...

 Respond  
Jethro   -  May 12, 2011

Bielie, I'll call that gettok overkill.

 Respond  
Bielie   -  May 12, 2011

heres an example of how its build up. http://hiscore.runescape.com/index_lite.ws?player=Zezima

You can strip that by using something like this

on *:SOCKREAD:Stats*: {
  if (!$sockerr) {
    var %statsg
    sockread %statsg
    tokenize 32 %statsg
    if (404 isin $1-) { endsc $sockname $gettok($hget(Stats,$remove($sockname,stats)),2,124) $big($gettok($hget(Stats,$remove($sockname,stats)),1,124)) is either not ranked at all or doesnt exsist. 5Maby your defname is not correct. Check how to change it by typing 6!helpdef }
    if ($gettok(%statsg,2,44) isnum) {
      set %stats %stats $gettok( $logo(stats) 14of $big($gettok($hget(Stats,$remove($sockname,stats)),1,124)) $c2(---) 14Overall:6|14- 14Attack:6|14- 14Defence:6|14- 14Strength:6|14- 14Constitution:6|14- 14Ranged:6|14- 14Prayer:6|14- 14Magic:6|14- 14Cooking:6|14- 14Woodcutting:6|14- 14Fletching:6|14- 14Fishing:6|14- 14Firemaking:6|14- 14Crafting:6|14- 14Smithing:6|14- 14Mining:6|14- 14Herblore:6|14- 14Agility:6|14- 14Thieving:6|14- 14Slayer:6|14- 14Farming:6|14- 14Runecrafting:6|14- 14Hunter:6|14- 14Construction:6|14- 14Summoning:6|14- 14Dungeoneering:6|14- 14Duel Tournament:6,%skill,124) $gettok(%statsg,2,44)
      if (!$gettok(Overall|Attack|Defence|Strength|Constitution|Ranged|Prayer|Magic|Cooking|Woodcutting|Fletching|Fishing|Firemaking|Crafting|Smithing|Mining|Herblore|Agility|Thieving|Slayer|Farming|Runecrafting|Hunter|Construction|Summoning|Dungeoneering,%skill,124)) endsc $sockname $gettok($hget(Stats,$remove($sockname,stats)),2,124) %stats
      inc %skill 
    }
  }
}
 Respond  
poborski   -  May 11, 2011

everytime i test now it just tells me i need to be in top 1 million even 2 there is something wrong cuz should show the ranked stats idk wat to do to correct it right know kinda blocked :x

 Respond  
poborski   -  May 11, 2011

oh thanks bielie cuz everytime i tried to test command only gave me link

 Respond  
Bielie   -  May 11, 2011

wont work you need the lite version of hiscores

 on *:SOCKOPEN:Stats*: {
sockwrite -nt $sockname GET /index_lite.ws?player= $+ $gettok($sock($sockname).mark,1,124) HTTP/1.1
sockwrite -nt $sockname Host: hiscore.runescape.com
sockwrite -nt $sockname $crlf 
 Respond  
poborski   -  May 08, 2011

on $:TEXT:/^!@.?stats /Si:#: {
if (!$2) { .notice $nick Enter an RSN to look up! | halt }
if ($len($2) > 12) { .notice $nick RSN too long! | halt }
var %x = 1
while ($sock(rsstats. $+ %x)) inc %x
.set %target. $+ %x $iif($left($1,1) == @,.msg $chan,.notice $nick)
.set %rsn. $+ %x $replace($2-,$chr(32),+)
sockopen rsstats. $+ %x hiscore.runescape.com 80
}
on :sockopen:rsstats.: {
var %x = $right($sockname,1)
if ($sockerr > 0) { %target. [ $+ [ %x ] ] Socket Error: $sockerr | cleanup $sockname | halt }
sockwrite -nt $sockname GET /lookup.php?type=stats&user= $+ $3 ] HTTP/1.1
sockwrite -nt $sockname Host: hiscore.runescape.com 80
sockwrite -nt $sockname $crlf
}
on :sockread:rsstats.: {
var %x = $right($sockname,1)
if ($sockerr > 0) { %target. [ $+ [ %x ] ] Socket Error: $sockerr | cleanup $sockname | halt }
var %read | sockread %read
if (: 0 isin %read) { %target. [ $+ [ %x ] ] %rsn. [ $+ [ %x ] ] is not in the Hi-Scores. You have to be in the top million of any skill with a skill level of at least 30. | cleanup $sockname }
if (combat isin %read) { %target. [ $+ [ %x ] ] $remove(%read,END) }
if (overall isin %read) { %target. [ $+ [ %x ] ] $remove(%read,END,|) | cleanup $sockname }
}
alias cleanup {
unset %target. $+ $right($1,1)
unset %rsn. $+ $right($1,1)
sockclose $1
}

 Respond  
Bielie   -  Apr 21, 2010

The parser link isnt working. Please fix this script since its useless if the parser doesnt work.

 Respond  
mirrorkiss   -  Jun 19, 2009

parser is bad >.>

 Respond  
Metallboy100   -  Aug 20, 2007

not bad

 Respond  
Anti   -  Jul 10, 2007

It just showed me like some ugly number i was hoping to see the full stats you know like Range - 61 Cooking - yaddy You know the works now that would be a kick anus snippet!

 Respond  
PcDark   -  Jul 07, 2007

What\'s wrong with it?

 Respond  
Anti   -  Jul 06, 2007

I don\'t like it that much .. well good job i guess :D

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.