All pastes #571796 Raw Edit

date on stats script?

public text v1 · immutable
·published 2007-06-17 10:04 UTC
rendered paste body
on $*:text:/^[!@](rsstats|stats|rstats)/Si:#: {
  set %stats.text $iif($left($1,1) == @, msg $chan, notice $nick)
  set %nick $replace($2-,$char(32),+)
  if ($sock(stats)) { Please wait, bot is busy. }
  else {
    sockopen stats www.slushpuppy.silverinterlocution.org 80
  }
}
on *:sockopen:stats: {
  sockwrite -nt $sockname GET /rsstats.php?stats= $+ %nick HTTP/1.1
  sockwrite -nt $sockname Host: www.slushpuppy.silverinterlocution.org
  sockwrite -nt $sockname $crlf
}
on *:sockread:stats: {
  if ($sockerr) { Please, tell $me about this problem. }
  else {
    var %rsstats
    sockread %rsstats
    if (*does not feature* iswm %rsstats) { 
      %stats.text Sorry, but %nick does not feature in the highscores.
      unset %stats.text, %nick
      sockclose $sockname
    }
  }
  if (*:* iswm %rsstats) { tokenize 32 %rsstats | %stats.text $1- | unset %nick, %stats.text | sockclose stats }
}