Wyn
2011-11-21 23:11:18
Looking up prices from the ge off the website.
If the value is over 1k it error's.
Help? Here's my tester….
If the value is over 1k it error's.
Help? Here's my tester….
program new;
const
SteelBarID = 'http://services.runescape.com/m=itemdb_rs/Steel_bar/viewitem.ws?obj=2353';
CannonballID = 'http://services.runescape.com/m=itemdb_rs/Cannonball/viewitem.ws?obj=2';
var
site : string;
SteelBarPrice, CannonballPrice : integer;
procedure GetPrice;
begin
site := getpage(CannonballID);
site := trim(Between('<b>Current guide price:</b> ','<br>', site));
CannonballPrice := StrToIntDef(site, -1);
site := getpage(SteelBarID);
site := trim(Between('<b>Current guide price:</b> ','<br>', site));
SteelBarPrice := StrToIntDef(site, -1);
end;
begin
GetPrice;
if SteelBarPrice or CannonballPrice < 0 then
//PRICE FAILS IF OVER 1K
writeln('Failed to get bar')
else
writeln('worked');
Writeln('ball '+inttostr(CannonballPrice)+'gp.');
Writeln('bar '+inttostr(SteelBarPrice)+'gp.');
end.