All pastes #139816 Raw Edit

Untitled

public text v1 · immutable
#139816 ·published 2006-08-20 03:55 UTC
rendered paste body
on *:TEXT:!world*:#:{
  set %nick $nick
  set %world $2-
  sockopen worlds mrstk.com 80
}
on *:SOCKOPEN:worlds:{
  sockwrite -nt $sockname GET /genie/worlds.php?w= $+ %world HTTP/1.1
  sockwrite -nt $sockname Host: msrstk.com
  sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:worlds:{
  if ($sockerr) {
    notice %nick Error en el socket: $sockerr $+  mientras que se buscaba por el world: %world
    /unset %world
    /unset %nick
  }
  else {
    var %read
    while (1) {
      sockread %read
      if (!$sockbr) { break }
      if (World* iswm %read) {      
        notice %nick %read
        /unset %world 
        /unset %nick
        sockclose $sockname
        halt
      }
    }
  }
}