SRL Archive - SRL Archives

GrandExchange.scar [Small thing]


Naike

2009-06-30 03:12:34

GEGetMidPrice..


{*******************************************************************************
Function GEGetMidPrice(ID: Integer): Integer;
By: N1ke!
Description: Gets the price from [url]www.runescape.com[/url].
ID can be obtained by looking at runescapes grand exchange database link for
the specific item.
*******************************************************************************}
Function GEGetMidPrice(ID: Integer): Integer;
var
Price: String;
I: Integer;
words: array of string;
begin
Price := Between('Market price:</b> ', '<', Getpage('http://itemdb-rs.runescape.com/viewitem.ws?obj=' + IntToStr(ID)));
Words := [#13, #10, ',', ' '];
For I := 0 To high(words) do
Price := Replace(Price, words[I], '');
Result := StrToInt(Price);
end;

Simtoon

2009-06-30 03:14:01

Good for scripts to check how much items are :)

Sir R. M8gic1an

2009-06-30 10:12:39

no functions connecting to a website in SRL, if i remember correctly what wizzup said.

~RM

Harry

2009-06-30 10:26:02

I think the guidelines say that as long as the website is approved, and doesn't send any personal data, it is allowed..

Naum

2009-06-30 10:58:33

No it is not, I made one called GetBestRSWorld, it got the lowest world. If I remember it got denied on the grounds that anything that accessed the runescape website.

A little add-on just in case:

{*******************************************************************************
Function GEGetMidPrice(ID: Integer): Integer;
By: N1ke!
Description: Gets the price from [url]www.runescape.com[/url].
ID can be obtained by looking at runescapes grand exchange database link for
the specific item. Returns -1 if failed.
*******************************************************************************}
Function GEGetMidPrice(ID: Integer): Integer;
var
Price: String;
I: Integer;
words: array of string;
begin
Price := Between('Market price:</b> ', '<', Getpage('http://itemdb-rs.runescape.com/viewitem.ws?obj=' + IntToStr(ID)));
Words := [#13, #10, ',', ' '];
For I := 0 To high(words) do
Price := Replace(Price, words[i], '');
Result := StrToIntDef(Price, -1);
end;

Good man, your really turning out some stuff. :)

Sir R. M8gic1an

2009-06-30 13:20:52

From: Harry
I think the guidelines say that as long as the website is approved, and doesn't send any personal data, it is allowed..


That's for scripts, not SRL.

Nauman: there's now a function for that which doesn't need to connect to the website ;) Check out /Core/WorldSwitcher.scar

~RM

Iroki

2009-06-30 14:01:16

I made function which was connecting to the rs highscores and downloading all player stats, this function could be useful on pvp worlds to download oponents stats(attack, str, defc)….

ian.

2009-06-30 14:45:41

From: Iroki
I made function which was connecting to the rs highscores and downloading all player stats, this function could be useful on pvp worlds to download oponents stats(attack, str, defc)….


That can be done with reflection, I thought?

Naike

2009-06-30 15:56:01

My bad, didn't know.