Returns a array of worlds in integers. Sorted on population
. Less to high.
SCAR Code:
Function FindWorlds(Members : Boolean): TIntegerArray;
var
I,j,K,T: integer;
WorldListArray : TStringArray;
WorldList : String;
begin;
WorldList := Between('d.write("</tr>");'#10'}'#10#10' '#10' '#10' ','</script>',GetPage('http://www.runescape.com/slj.ws?lores.x=1&plugin=2&order=MPWLA'));
WorldList := Replace(WorldList,#10#10' '#10' '#10' ','');
J := pos(';', WorldList);
repeat
SetArrayLength(WorldListArray, i + 2);
WorldListArray[i] := copy(WorldList, 1, J-1);
delete(WorldList, 1, pos(WorldListArray[i], WorldList)+Length(WorldListArray[i]));
i := i + 1;
J := pos(';', WorldList);
until(J = 0)
SetLength(WorldListArray,I);
SetLength(Result,100);
For I := 0 to Length(WorldListArray) -1 do
begin;
J := LastPos(',',WorldListArray[I]);
K := LastPosEx(',',WorldListArray[I],J);
if GetNumbers(Copy(WorldListArray[i],K+1,J-K-1)) <> '0' then
begin;
if members then if WorldListArray[I][Pos(',',WorldListArray[I])+1] = '1' then
begin;
Result[T] := StrToInt(Copy(WorldListArray[i],3,Pos(',',WorldListArray[I])-3));
inc(T);
end;
if not Members then if WorldListArray[I][Pos(',',WorldListArray[I])+1] = '0' then
begin;
Result[T] := StrToInt(Copy(WorldListArray[i],3,Pos(',',WorldListArray[I])-3));
inc(T);
end;
end;
end;
SetLength(Result,T);
end;