man slaughter
02-18-2008, 10:56 AM
function worldInfo(worldnum,askedmfdata:Integer):String;
var
winfo: array [0..7] of String; dataloader,rawimf,tempwfstr:String; iwf:Integer;
begin
dataloader:= GetPage('http://www.runescape.com/slj.ws?hires.x=36&hires.y=223&plugin=0')
rawimf:= Between('e('+inttostr(worldnum)+',',');',dataloade r);
winfo[0]:=inttostr(worldnum);
for iwf := 1 to 7 do
begin
tempwfstr:=rawimf;
delete(tempwfstr, pos(',',rawimf), 255);
winfo[iwf]:=tempwfstr;
delete(rawimf, pos(',',rawimf)-Length(tempwfstr), 1+Length(tempwfstr));
end;
if(Length(winfo[1])=0) then
begin
//will return null if there is an error.
winfo[askedmfdata]:= '"null"';
end;
Result:= winfo[askedmfdata];
end;
world number: 0, returns the current world number given.
members bool: 1, returns 0 if its an F2P world and 1 if Members.
status: 2, returns 0 if its online, 1 if its offline and 2 if its FULL.
activity str: 3, returns the activity in that world. eg:worldInfo(17,3) returns '"Bounty Hunter"'.
activity bol = 4, returns a 0 if no activity 1 if there is. activity str returns '-' if none.
world prefix = 5, returns string with the prefix of a world eg: worldInfo(17,3) returns '"nav1"'
population = 6, returns the current population, usefull when calculating respawn.
world location = 7, returns a number representing the worlds location.
if you need to fomat the world location here:
Function formatWorldLocation(fwlnum:Integer):String;
begin
case (inttostr(fwlnum)) of
'0' : Result:= 'US West 1';
'1' : Result:= 'US West 2';
'2' : Result:= 'US West 3';
'3' : Result:= 'UK 2';
'4' : Result:= 'US West 5';
'5' : Result:= 'UK 1';
'6' : Result:= 'Canada East';
'7' : Result:= 'US East 2';
'8' : Result:= 'US Central 3';
'9' : Result:= 'US Central 2';
'10' : Result:= 'Netherlands 1';
'11' : Result:= 'US Central 1';
'12' : Result:= 'US West 4';
'13' : Result:= 'US East 1';
'14' : Result:= 'US East 3';
'15' : Result:= 'Australia';
'16' : Result:= 'Sweden';
'17' : Result:= 'Canada West';
'18' : Result:= 'Finland';
'19' : Result:= 'Netherlands 2';
'20' : Result:= 'US Central 2';
'21' : Result:= 'United States 1';
'22' : Result:= 'United States 2';
'23' : Result:= 'United States 3';
else Result:= 'Unknown';
end;
end;
eg: writeln(worldInfo(1,6)); // returns the population of the respective world.
eg: writeln(worldInfo(1,2)); // returns the the status respective world.(online = 0, offline = 1, full = 2 )
ill be back to add stuff later bye comment.
var
winfo: array [0..7] of String; dataloader,rawimf,tempwfstr:String; iwf:Integer;
begin
dataloader:= GetPage('http://www.runescape.com/slj.ws?hires.x=36&hires.y=223&plugin=0')
rawimf:= Between('e('+inttostr(worldnum)+',',');',dataloade r);
winfo[0]:=inttostr(worldnum);
for iwf := 1 to 7 do
begin
tempwfstr:=rawimf;
delete(tempwfstr, pos(',',rawimf), 255);
winfo[iwf]:=tempwfstr;
delete(rawimf, pos(',',rawimf)-Length(tempwfstr), 1+Length(tempwfstr));
end;
if(Length(winfo[1])=0) then
begin
//will return null if there is an error.
winfo[askedmfdata]:= '"null"';
end;
Result:= winfo[askedmfdata];
end;
world number: 0, returns the current world number given.
members bool: 1, returns 0 if its an F2P world and 1 if Members.
status: 2, returns 0 if its online, 1 if its offline and 2 if its FULL.
activity str: 3, returns the activity in that world. eg:worldInfo(17,3) returns '"Bounty Hunter"'.
activity bol = 4, returns a 0 if no activity 1 if there is. activity str returns '-' if none.
world prefix = 5, returns string with the prefix of a world eg: worldInfo(17,3) returns '"nav1"'
population = 6, returns the current population, usefull when calculating respawn.
world location = 7, returns a number representing the worlds location.
if you need to fomat the world location here:
Function formatWorldLocation(fwlnum:Integer):String;
begin
case (inttostr(fwlnum)) of
'0' : Result:= 'US West 1';
'1' : Result:= 'US West 2';
'2' : Result:= 'US West 3';
'3' : Result:= 'UK 2';
'4' : Result:= 'US West 5';
'5' : Result:= 'UK 1';
'6' : Result:= 'Canada East';
'7' : Result:= 'US East 2';
'8' : Result:= 'US Central 3';
'9' : Result:= 'US Central 2';
'10' : Result:= 'Netherlands 1';
'11' : Result:= 'US Central 1';
'12' : Result:= 'US West 4';
'13' : Result:= 'US East 1';
'14' : Result:= 'US East 3';
'15' : Result:= 'Australia';
'16' : Result:= 'Sweden';
'17' : Result:= 'Canada West';
'18' : Result:= 'Finland';
'19' : Result:= 'Netherlands 2';
'20' : Result:= 'US Central 2';
'21' : Result:= 'United States 1';
'22' : Result:= 'United States 2';
'23' : Result:= 'United States 3';
else Result:= 'Unknown';
end;
end;
eg: writeln(worldInfo(1,6)); // returns the population of the respective world.
eg: writeln(worldInfo(1,2)); // returns the the status respective world.(online = 0, offline = 1, full = 2 )
ill be back to add stuff later bye comment.