PDA

View Full Version : Emptiest World



mixster
04-12-2008, 08:44 PM
After getting annoyed with using Prisoner's random world procedure (not because of the procedure itself) returning fairly full worlds. With that in mind, I remember seeing a function previously that returned the least populated world, thus I decided to make a function that did the same thing. Now, I have had a look around (tried a search, but it came up with pretty much every script thread and quite a lot of help ones too) and couldn't find it, so it could be the exact same code or it could be completely different, either way all I know is it works :) So here it is

function EmptiestWorld(members, prefix: Boolean): string;
var
website: string;
begin
case members of
False: website := GetPage('http://www.runescape.com/slj.ws?lores.x=1&plugin=0&order=MPLAW');
True: website := GetPage('http://www.runescape.com/slj.ws?lores.x=1&plugin=0&order=mPLAW');
end;
Delete(website, 1, Pos('function e(w,m,s,a,dt,h,p,l) ', website) + 50);
case prefix of
False: Result := Between(' e(', ',', website);
True:
begin
Delete(website, 1, Pos('",', website) + 3);
Result := Between(',"', '",', website);
end;
end;
end;

members: true for members and false for free world
prefix: true to return a prefix and false for a world number (depending on if you want to use it with SmartSetup or SmartSetupEx).

Enjoy! (and if you want to criticise, I have a handy report link in my sig) :)

faster789
04-12-2008, 11:27 PM
awsum!!..rep+ this can come handy!

drizzt
04-13-2008, 08:13 PM
this is really cool, but maybe a nice thing you could do is somehow get a random like 1 - 10 emptiest worlds?

mixster
04-13-2008, 08:23 PM
function EmptiestWorld(members: Boolean): string;
var
i: Integer;
website: string;
worlds: array of string;
begin
case members of
False: website := GetPage('http://www.runescape.com/slj.ws?lores.x=1&plugin=0&order=MPLAW');
True: website := GetPage('http://www.runescape.com/slj.ws?lores.x=1&plugin=0&order=mPLAW');
end;
Delete(website, 1, Pos('function e(w,m,s,a,dt,h,p,l) ', website) + 50);
while GetArrayLength(worlds) < 10 do
begin
SetArrayLength(worlds, GetArrayLength(worlds) + 1);
Delete(website, 1, Pos('",', website) + 3);
worlds[GetArrayLength(worlds) - 1] := Between(',"', '",', website);
Delete(website, 1, Pos('",', website) + 3);
end;
Result := worlds[Random(10)];
end;

That should work Drizzt, though I thought I might as well take out the world number part as it's much more reliable to use the world prefix anyway and it takes too much effort to code the same thing twice ;)

Brain
04-13-2008, 08:46 PM
well this looks pretty good...and I have you rep +, not because of this code, but because you rick rolled me...thanks...

drizzt
04-13-2008, 08:58 PM
well this looks pretty good...and I have you rep +, not because of this code, but because you rick rolled me...thanks...

thats why you look at the links before you click them :p RickRoll/Rickroll.php should give off some warning signs

Brain
04-13-2008, 09:44 PM
Yeah I suppose so, but a good rick roll always makes me laugh a little :p

mixster
04-13-2008, 10:17 PM
I would've gone for a more complex rick roll link so people who did check it out would still go on it, but I'm lazy and I reckon people would complain too much :) Anyway, I've gotten 5 people rep me for this in just over a day, which is probably the highest rep to time ratio I've had in a long time and I practically lived in the help section when I first started getting into Scar, which makes this very weird... Ahwell, thanks for the rep anyway :)

EvilChicken!
04-14-2008, 08:52 AM
Ogod. You own.

I can use tihs in my skript?
w´hithh credit åffcorse.

Lee Lok Hin
04-14-2008, 09:26 AM
Nice! Would this count toward negative for a srl-member application, because I did not make it myself? Anyway, nice function.

Btw, how about Report Me Here!!! (http://www.hidelinks.com/?waia84geuj)

And you rickroll seems to be down. =/

Torrent of Flame
04-14-2008, 09:35 AM
Nah his RickRoll worked for me.

I dotn get the RickRolled though? And I hate you for making me spend 5 minutes trying to click the "X" :P

mixster
04-15-2008, 12:24 AM
I hate you for trying to report me.
Anyway, @EvilChickin, go for it, I don't mind if you use it :)
@leelokhin, it won't count negatively unless you claim ownership of it and get found out. Just make sure you read a couple of tuts about applying for members before you do so you can increae your chance of getting in ;)