All pastes #242194 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-11-07 00:18 UTC
rendered paste body
on *:TEXT:!stats*:#: { sockopen hiscore hiscore.runescape.com 80 | set %user $2 | set %n $nick }
on *:sockopen:hiscore: { 
  sockwrite -n $sockname GET /lang/en/aff/runescape/hiscorepersonal.ws?user1= $+ %user HTTP/1.0
  sockwrite -n $sockname Host: hiscore.runescape.com $+ $crlf $+ $crlf
  notice %n Searching the HighScores for %user
}
on *:sockread:hiscore:{
  if ($sockerr) {
    notice %n Error.
    halt
  }
  else {
    var %temptext
    sockread %temptext
    if (<td align="right">Attack *</td><td align="right"> iswm %temptext) {
      notice %n -
      notice %n Stats for %user $htmlfree(%temptext)
    }
  }
}
alias -l htmlfree {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}