PDA

View Full Version : WORLDINFO Function by Oldarney



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.

mixster
02-18-2008, 02:31 PM
Just so you know, very few things suggested/coded by the public get added to SRL, but you never know.
Also, doesn't work properly - tried with 52,0 and it gave me all the info (you need to remove the writeln in the for bit). Also, you need to make sure you do it via html code and not just 'what you can see' (instead of 1 giving me a boolean, I get an integer and same with a few others, though this may be because you have it setup wrong at the bottom of your post). A tip - using 'case askedmfdata of' would be more efficient in the running of it.
Hope this doesn't sound too negative - it's a good idea, just not working 100%.
Edit: Also remember to use scar tags when posting scar script (not code) as it makes it easier to check through etc.

man slaughter
04-24-2008, 12:21 AM
Just so you know, very few things suggested/coded by the public get added to SRL, but you never know.
Also, doesn't work properly - tried with 52,0 and it gave me all the info (you need to remove the writeln in the for bit). Also, you need to make sure you do it via html code and not just 'what you can see' (instead of 1 giving me a boolean, I get an integer and same with a few others, though this may be because you have it setup wrong at the bottom of your post). A tip - using 'case askedmfdata of' would be more efficient in the running of it.
Hope this doesn't sound too negative - it's a good idea, just not working 100%.
Edit: Also remember to use scar tags when posting scar script (not code) as it makes it easier to check through etc.

i did say i was in a rush... its all good now (sry about the left over writeln's). i added a script to format the world location and fixed the 50 char limitation witch 3 worlds where breaking... (things like "High level - duel tournaments" broke the limatation) thats about it.

ShowerThoughts
04-25-2008, 10:50 AM
Your standards aarrghhhh your inents are good but you have to use captialised letters :S that looks much nicer

EvilChicken!
04-25-2008, 12:06 PM
Herm, his standards are slightly off.


Google DelFor for a standardizer app. ^_^

Santa_Clause
04-26-2008, 08:22 AM
Herm, his standards are slightly off.


Google DelFor for a standardizer app. ^_^

Delfor isn't completely accurate by the way, especially when dealing with cases.

EvilChicken!
04-26-2008, 12:07 PM
You told me that, I remember.
Is there a better program available?

Markus
04-26-2008, 02:16 PM
SourceFormatX (http://www.soft32.com/download_21306.html) owns all. For the unlimited demo version, http://astalavista.ms

man slaughter
06-08-2008, 05:57 AM
SourceFormatX (http://www.soft32.com/download_21306.html) owns all. For the unlimited demo version, http://astalavista.ms

thanks i was asking ben for soemthing like this, if not i was going to undoubtably make it. maybe not in scar but in AS3 or maybe C++. no offense scar stinks at stings.