on $*:Text:/^[!@]world */Si:#:{
if (!$2) { notice $nick No world entered. }
elseif ($2 !isnum) { notice $nick The world will be a number. }
elseif ($2 < 1) || ($2 > 132) { notice $nick That world does not exist. }
else {
inc %_rsplayers 1
if ($2 == 126) { notice $nick World 126 will not work, it is server side, the script is not broken. Sorry. }
if ($2 > 125) { set $+(%,rsplayers.search,%_rsplayers) $calc($2 - 1) }
if ($2 <= 125) { set $+(%,rsplayers.search,%_rsplayers) $2 }
set $+(%,rsplayers.target,%_rsplayers) $iif($left($1,1) == @,msg $chan,notice $nick)
sockopen $+(rsplayers.,%_rsplayers) www.spaldox.com 80
}
}
on *:SOCKOPEN:rsplayers.*:{
sockwrite -n $sockname GET /statbots/BotWorlds.php?World= $+ $eval($+(%,rsplayers.search,%_rsplayers),2) HTTP/1.1
sockwrite -n $sockname Host: www.spaldox.com $+ $crlf $+ $crlf
}
on *:SOCKREAD:rsplayers.*:{
var %_rsplayers.id = $right($sockname,-10)
if ($sockerr) { $eval($+(%,rsplayers.target,%_rsplayers.id),2) $+(,[,4,Server Status,,],) An error occured in the search, please try again. }
else {
var %rsplayers.read
sockread %rsplayers.read
if ((Free isin %rsplayers.read || Members isin %rsplayers.read)) {
var %_rsplayers.id = $right($sockname,-10)
tokenize 32 %rsplayers.read
set $+(%,rsplayers.world,%_rsplayers.id) $1
set $+(%,rsplayers.players,%_rsplayers.id) $replace($2,FULL,$bytes(2000,b) $+ $chr(32) $+ $chr(40) $+ Full $+ $chr(41))
set $+(%,rsplayers.server,%_rsplayers.id) $replace($3,Free,F2P,Members,P2P)
set $+(%,rsplayers.location,%_rsplayers.id) $4-
}
}
}
on *:SOCKCLOSE:rsplayers.*:{
var %_rsplayers.id = $right($sockname,-10)
if ($eval($+(%,rsplayers.world,%_rsplayers.id),2) == $null) { $eval($+(%,rsplayers.target,%_rsplayers),2) An error occured in your search, please try again. }
else { $eval($+(%,rsplayers.target,%_rsplayers.id),2) $+(,[,4,Server Status,,],) $+(World,,4) $eval($+(%,rsplayers.world,%_rsplayers.id),2) $+(,,is) $+(a,,4) $eval($+(%,rsplayers.server,%_rsplayers.id),2) $+(,,world) which is located $+(in,,4) $eval($+(%,rsplayers.location,%_rsplayers.id),2) $+(,,and) $+(has,,4) $eval($+(%,rsplayers.players,%_rsplayers.id),2) $+(,,people) on it. }
}
on *:Disconnect:{
unset %rsplayers.*
}