All pastes #157496 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-09-01 16:36 UTC
rendered paste body
on *:TEXT:!world*:*:{
  if ($2 !isnum) || (!$2) { /msg $chan well done now try doing that with a real server | return }
  /set %world $2
  /set %nick $nick
  if $sock(rs_worldz) { /sockclose rs_worldz }
  /sockopen rs_worldz mrstk.com 80
}
on *:sockopen:rs_worldz: { 
  /sockwrite -nt $sockname GET /genie/worlds.php?w= $+ %world  HTTP/1.1
  /sockwrite -nt $sockname Host: mrstk.com 
  /sockwrite -nt $sockname $crlf
}

on *:sockread:rs_worldz*:{
  if $sockerr {
    msg %nick there was an error during the socket reading process ( $+ $sockerr $+ ) of %world
    /unset %nick | /unset %world
  }
  else {
    var %read
    /sockread %read
  }
  if (World * iswm %read) {
    .notice %nick $remove(%read,<br />)
    /unset %nick | /unset %world
    /sockclose rs_worldz
    halt  
  }
}
alias htmlfree { var%x,%y = $regsub ($1-,/(<[^>]+>)/g,$null,%x) | return %x }