I have seen couple people that says the current one missed one digit.
Example real amount 480;
Script saw it as 80;
I edited this:Code:{*******************************************************************************
function GetAmount(ItemX, ItemY: Integer): Integer;
By: ZephyrsFury Edited By Home
Description: Returns the amount of an item at coordinates (ItemX, ItemY).
Returns approximate values for 'K' and 'M'.
*******************************************************************************}
function GetAmount(ItemX, ItemY: Integer): Integer;
var
S: string;
Col, II: Integer;
B: TBox;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if (FindColorsTolerance(TPA, 65536, ItemX - 50, ItemY - 50, ItemX + 50, ItemY + 50, 0)) then
begin
SortTPAFrom(TPA, Point(ItemX, ItemY));
ATPA := SplitTPAEx(TPA, 5, 5);
B := GetTPABounds(ATPA[0]);
if (Length(ATPA[0]) < 15) or (B.X2 - B.X1 < 5) or (B.Y2 - B.Y1 < 5) then Exit;
Result := 1;
for II := 2 downto 0 do
if (FindColorsTolerance(TPA, 7575987 * II * II - 6796134 * II + 65535, B.X1 - 10, B.Y1 - 10, B.X2 + 10, B.Y2 + 10, 0)) then
Break;
if (II < 0) then Exit;
SortTPAFrom(TPA, Point((B.X1 + B.X2) shr 1, (B.Y1 + B.Y2) shr 1));
ATPA := SplitTPAEx(TPA, 5, 5);
TPA := ATPA[0];
Col := 7575987 * II * II - 6796134 * II + 65535;
B := GetTPABounds(TPA);
S := Trim(GetTextAtEx(B.X1 - 10, 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 else
if (Pos('K', S) > 0) then Result := Result * 1000;
end;
end;
To:Code:S := Trim(GetTextAtEx(B.X1 , B.Y1 - 1, 0, StatChars, False, False, 0, 1, Col, 5, True, tr_AllChars));
I know a small fix, but still something :)Code:S := Trim(GetTextAtEx(B.X1 - 10, B.Y1 - 1, 0, StatChars, False, False, 0, 1, Col, 5, True, tr_AllChars));
~Home

