For price getting with items that have things like "K", "M", "B" in them:
Simba Code:
(* Extracts the numbers in a string, accepts special letters (k, m, b) *)
function CashStringToInt(S: string): Integer;
var
i, ii: Integer;
Numbs: TStringArray;
Temp: string;
begin
Temp := '';
Numbs := ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'k', 'm', 'b'];
for i := 1 to High(S) do
for ii := 0 to High(Numbs) do
if S[i] = Numbs[ii] then
case ii of
0..9: Temp := Temp + Numbs[ii];
10..12:
begin
Result := StrToInt(Temp);
case ii of
10: Result := Result * 100; //Since price is given to 1 decimal,
11: Result := Result * 100000; //instead of multiplying by the entire
12: Result := Result * 100000000; //factor, you must multiply by factor/10
end;
end;
end;
if (Result = 0) then
Result := StrToInt(Temp);
end;
(* Gets Price of given item with the ID "ItemID" via ge database website *)
function GetPrice(ItemID: Integer): Integer;
begin
Result := CashStringToInt(Between('<b>Current guide price:</b>', '<br><br>', GetPage('http://services.runescape.com/m=itemdb_rs/Shark/viewitem.ws?obj=' + ToStr(ItemID))));
end;
Just give credit
How much profit per hour is this? I have been needing to get rc up
E: Also flight you should get on rs