All pastes #621665 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-07-16 10:14 UTC
rendered paste body
alias stats {
  if ($1 == $null) {
    echo -a You must specify a player to lookup.
    halt
  }
  set %stats.user $1
  sockopen stats slushpuppy.silverinterlocution.org 80
}
on *:SOCKOPEN:stats: {
  sockwrite -n $sockname GET /rsstats.php?stats= $+ %stats.user HTTP/1.1
  sockwrite -n $sockname Host: slushpuppy.silverinterlocution.org
  sockwrite -n $sockname $crlf
}
on *:SOCKREAD:stats: {
  var %stats.read
  sockread %stats.read
  if (*does* iswm %stats.read) {
    //echo -a %stats.user was not found in the highscores. | unset %stats.*
    halt
  }
  if (*overall* iswm %stats.read) {
    echo -a $htmlfree(%stats.read)
    unset %stats.*
  }
}

alias cmb {
  if ($1 == $null) {
    echo -a You must specift a player to lookup.
    halt
  }
  set %cmb.user $1
  sockopen cmb slushpuppy.silverinterlocution.org 80
}
on *:SOCKOPEN:cmb: {
  sockwrite -n $sockname GET /pestcontrol.php?pestcontrol= $+ %cmb.user HTTP/1.1
  sockwrite -n $sockname Host: slushpuppy.silverinterlocution.org
  sockwrite -n $sockname $crlf
}
on *:SOCKREAD:cmb: {
  var %cmb.read
  sockread %cmb.read
  if (*0<br>* iswm %cmb.read) {
    //echo -a %cmb.user was not found in the highscores for any combat skill. | unset %cmb.*
    halt
  }
  if (*<br>* iswm %cmb.read) {
    //echo -a Combat level: $htmlfree(%cmb.read) | unset %cmb.user
  }
  if (*<b>* iswm %cmb.read) {
    //echo -a $htmlfree(%cmb.read)
  }
  if (*<i>* iswm %cmb.read) {
    //echo -a $htmlfree(%cmb.read)
  }
}

alias -l htmlfree { 
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)