All pastes #390537 Raw Edit

Untitled

public text v1 · immutable
·published 2007-03-11 15:12 UTC
rendered paste body
alias players sockclose players | sockopen players runescape.com 80
on *:sockopen:players: { 
  sockwrite -n $sockname GET /title.ws HTTP/1.1 
  sockwrite -n $sockname Host: runescape.com $+ $crlf $+ $crlf
}
on *:sockread:players: { 
  if ($sockerr) { echo -a Error. | halt }
  else {
    sockread %temp 
    if (*There are currently* iswm %temp) { 
      notice %playerschan There are  $+ $bytes($gettok(%temp,4,32),b) $+  people playing Runescape right now!
      .timerSOCKET 1 2 sockclose players
    } 
  }
}
on *:sockclose:players:{
}
on *:TEXT:!players:*: { 
  set %playerschan $nick
  players 
}