Reflection FTW (inventory.scar):
PHP Code:
{*******************************************************************************
function R_CountItemsStacks(ID : Integer) : Integer;
By: Nava2
Description: Returns amount of Item of ID in the inventory, counting stacks.
*******************************************************************************}
function R_CountItemsStacks(ID : Integer) : Integer;
var
Inv, I: Integer;
begin
Result := 0;
Inv := GetInterface(149, 0);
for I := 0 to 27 do
if SmartGetFieldArrayInt(Inv, InventoryItemIDs, i) = ID then
Result := Result + SmartGetFieldArrayInt(Inv, InventoryItemStackSizes, i);
SmartFreeObject(Inv);
end;
So:
SCAR Code:
Procedure CountFeather;
begin
if R_CountItemStacks(FeatherID) >= 100000 then
Writeln('Feathers have reached over 100k');
end;
Or in color(amount.scar):
PHP Code:
{*******************************************************************************
function ItemAmount(Area, ItemType: string; Item: Integer; Tol: TIntegerArray): Integer;
By: masquerader modified by ZephyrsFury
Description: Counts the number of items found with a color in a certain area. (Counts stacks)
Parameters:
Area - 'inv', 'shop', 'bank', 'trade', 'your trade'.
ItemType - 'dtm', 'bmp', 'color', 'bmpmask'.
Item - name/value of your dtm/bmp/color/bmpmask.
Tol - 'dtm' - [] (dtm's can't have tolerance).
'bmp' - [BMPTol].
'color' - [COLOUR Tol, Min Colour Count].
'bmpmask' - [BMPTol, ContourTol].
*******************************************************************************}
function ItemAmount(area, ItemType: string; Item: Integer; Tol: TIntegerArray): Integer;
var
Coords: TPointArray;
i, h: Integer;
begin
Result := 0;
Coords := ItemCoordinates(Area, ItemType, Item, Tol);
h := High(Coords);
for i := 0 to h do
Result := Result + GetAmount(Coords[i].x, Coords[i].y);
end;
So:
SCAR Code:
Procedure CountFeather;
Var
Feathers, FeatherColor: integer;
begin
FeatherColor := 234235; //note that isn't actual feather color
Tolerance := 15; //could be anything really
if ItemAmount('inv', 'color', FeatherColor, Feathers, [Tolerance, 1]) > 100000 then
begin
Writeln('You have' + IntToStr(Feather) + 'feathers');
end;
I used a color, you could use a bitmap though.(or dtm)
Hope it helps!