SRL Archive - Help and Support

Grabbing Price from GE


Claymore

2010-09-06 15:05:45

How do you do it? Doing this for a script im currently developing.

Naum

2010-09-06 15:24:12

Use GetPage on the URL of the grand exchange item. Then use Pos or Between (or both) to get the location of the price. Between('<b>Market price:</b>', '</span>', GetPage(URL)); should work.

E.G:
WriteLn(Between('<b>Market price:</b>', '</span>', GetPage('http://services.runescape.com/m=itemdb_rs/Guam_seed/viewitem.ws?obj=5291')));

Claymore

2010-09-06 16:14:53

It worked! Although theres this symbol [] next to the price. Figuring out how i can get rid of it. I tired copying and paste but it just dissapears when i paste it :S

Its a problem because if i do i:=StrToInt(Between(Marketprice..etc..etcc)));, it results as i:= -1.

Its prob due to that box thing i mentioned.

Cstrike

2010-09-06 16:17:32

From: Deathscytex
It worked! Although theres this symbol [] next to the price. Figuring out how i can get rid of it. I tired copying and paste but it just dissapears when i paste it :S


I wonder if you can break up the string and remove any char's that contain brackets?

Or read the string and take (if its an array for example) low(string)+1 [aka, zero]… high(string)-1

JPHamlett

2010-09-06 16:19:12

Why not use a "GetNumbers()" function to only get the numbers and get rid of the brackets?

Such as :


program new;
{$i srl/srl.scar}

begin
WriteLn(Getnumbers(Between('<b>Market price:</b>', '</span>', GetPage('http://services.runescape.com/m=itemdb_rs/Guam_seed/viewitem.ws?obj=5291'))));
end.

Claymore

2010-09-06 16:30:19

Nvm guys. found out ExtractFromStr! Thanks for help.

Naum

2010-09-06 16:30:57

Yeah, or trim() which gets rid of spaces before and after the string.