SRL Archive - OSR Help

how to get numbers?


joj0r

2012-05-11 11:21:05

hi hey i've seen a few script that have gettext comments, i want to add this also to a script.
I want prices from the g.E Site
how can i get text from a website on a specific location? and on the runescape ge site ( here http://services.runescape.com/m=itemdb_rs/frontpage.ws ) there's also the problem that it's not static, when you type in an item, an extra box comes
does any of you know how i could do this? i thought about getting the numbers from other sites like runescape wiki etc.

Abu

2012-05-11 11:23:56

Here is one that a member called NexPB made:
procedure GetPriceGe;
var
url, price, final: String;
begin

Case (Lowercase(Ore)) of
'iron', 'iron ore': oreID := 440;
end;

url := ('http://www.master-bot.org/files/GEPrice.php?id=' + IntToStr(oreID));
price := GetPage(url);

if (orePrice = 0) then
begin
final := Trim(price);
if (final = '') then writeln('FAILED TO GET PRICES! RESTART SCRIPT.');
writeln('Price ore: ' + final);
orePrice := StrToInt(final);
end else
Exit;

end;

I've been given full rights to update his script but have chosen not to, so you can edit that function appropriately.

Just give credit to NexPB

joj0r

2012-05-11 11:43:08

so for example the price for nature runes would be

procedure GetPriceGe;
var
url, price, final: String;
begin

Case (Lowercase(Ore)) of
'Nature', 'Nature rune': oreID := 561;
end;

url := ('http://www.master-bot.org/files/GEPrice.php?id=' + IntToStr(oreID));
price := GetPage(url);

if (orePrice = 0) then
begin
final := Trim(price);
if (final = '') then writeln('FAILED TO GET PRICES! RESTART SCRIPT.');
writeln('Price ore: ' + final);
orePrice := StrToInt(final);
end else
Exit;

end;

and the variable final is the number at the end?

sorry i am new to pascal and want to try out editing existing scripts to get more knowledge^^

weequ

2012-05-11 12:07:22

From: joj0r
so for example the price for nature runes would be


and the variable final is the number at the end?

sorry i am new to pascal and want to try out editing existing scripts to get more knowledge^^
Final is the price in String (text) format like '160'. orePrice is the price in Integer (number) format like 160.

You can't do number operations to numbers in text format.

if '160' < '200' then //NOT ALLOWED

if '160' < 200 then //NOT ALLOWED

if 160 < 200 then //ALLOWED

'150' + '50' would be '15050'
but
150+50 would be 200.

joj0r

2012-05-11 13:08:13

okay i have addet the function and edited it, now it's compiling =)
but it's count the prices as 0 since the link is not working
www.master-bot.org/files/GEPrice.php?id=561 - page not found
does anyone know a working site?

when i use this link for esample from the rs site

http://services.runescape.com/m=itemdb_rs/viewitem.ws?obj=440

how can get the "current guide price" into my script?


thanks alot guys =)

Abu

2012-05-11 13:37:06

When you open that url via the function. Use a GetText function to grab the price:
http://docs.villavu.com/simba/scriptref/ocr.html#reading-text

joj0r

2012-05-11 13:41:38

From: abu_jwka
When you open that url via the function. Use a GetText function to grab the price:
http://docs.villavu.com/simba/scriptref/ocr.html#reading-text


woot it seems a bit difficult to me since i am really new to pascal^^
is there any other way? sites where the prices are already in a .txt data and simba can easily read them?
but thanks so much for helping :blushing:

putonajonny

2012-05-28 17:16:15

You can just include Online.simba then use GetGEPrice(ID); to get the price

joj0r

2012-05-28 18:02:56

and how should i fix this? just a normal procedure?

procedure GetPrice;
begin
GetGEPrice(NUMBER);
end;

where should i put that Online.Simba? thanks =]