All pastes #440960 Raw Edit

Stuff

public text v1 · immutable
·published 2007-04-15 12:28 UTC
rendered paste body
ON $*:TEXT:/^[!@.](winfo)/Si:#:{ if ($2- == $null) { notice $nick 7Add a world 12to search! | halt } 
  if (W isin $2-) { notice $nick 4Error! 12Syntax:7!winfo 5 | halt } 
  if ($2- >= 141) { notice $nick 7Worlds only go12 to 140 7Sorry for that =( | halt } 
  set %return $iif($left($1,1) == @, msg $chan, notice $nick) 
  set %worldsearch $replace($2-,$chr(32),$chr(95)) 
  /sockopen worldsearch www.o-ss.net 80 
} 
on *:SOCKOPEN:worldsearch: { 
  sockwrite -nt $sockname GET /parsers/worlds.php?world= $+ %worldsearch HTTP/1.1 
  sockwrite -nt $sockname Host: www.o-ss.net 
  sockwrite -nt $sockname $crlf 
} 
on *:SOCKREAD:worldsearch: { 
  if ($sockerr) { 
    echo -a error 
    halt 
  } 
  var %read 
  sockread %read 
  if (*world_ $+ %worldsearch * iswm %read) { 
    /tokenize 32 $htmlfree(%read) 
    %return 7[Info for: World  $+ %Worldsearch $+ ]~Result:12Players:7 $+ $remove($2,_Players) 12Type:7 $+ $remove($4,end) 12Location:7 $+ $remove($3,end) $+($chr(91),$chr(75),$chr(101),$chr(114),$chr(115),$chr(116),$chr(83),$chr(99),$chr(114),$chr(105),$chr(112),$chr(116),$chr(93)) 
    sockclose $sockname 
    /unset %return 
    /unset %worldsearch 
  } 
}