didnt work im on srl 32 hers the function in 120:
SCAR Code:
function GetAmount(ItemX, ItemY: Integer): Integer;
var
S: string;
X, Y, Col, II: Integer;
B: TBox;
colPts: TPointArray;
ATPA: T2DPointArray;
begin
if (FindColor(X, Y, 65536, ItemX - 10, ItemY - 10, ItemX + 10, ItemY + 10)) then
begin
Result := 1;
for II := 2 downto 0 do
if (FindColorsTolerance(colPts, 7575987 * II * II - 6796134 * II + 65535, ItemX - 20, ItemY - 30, ItemX + 20, ItemY + 10, 0)) then
Break;
if (II > 2) then Exit;
ATPA := SplitTPAEx(colPts, 5, 5);
SortATPASize(ATPA, True);
colPts := ATPA[0];
Col := 7575987 * II * II - 6796134 * II + 65535;
B := GetTPABounds(colPts);
S := Trim(GetTextAtEx(B.X1, B.Y1 - 1, 0, StatChars, False, False, 0, 1, Col, 5, True, tr_AllChars));
Result := StrToIntDef(GetNumbers(S), 1);
if (Pos('M', S) > 0) then Result := Result * 1000000;
if (Pos('K', S) > 0) then Result := Result * 1000;
end;
end;