You can use
SCAR 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].
*******************************************************************************}
SCAR Code:
{*******************************************************************************
function CountItemsIn(Area, ItemType: string; Item: Integer; Tol: TIntegerArray): Integer;
By: masquerader modified by ZephyrsFury
Description: Counts the number of items found within the Area. (Does not count stacks)
Parameters:
Area - 'inv', 'shop', 'bank', 'trade', 'your trade'.
ItemType - SRL_DTM, SRL_Bitmap, SRL_BitmapMask, SRL_Color
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].
*******************************************************************************}