SCAR Code:
{*******************************************************************************
function ItemCoordinates(Area, ItemType: string; Item, Tol: TIntegerArray): TPointArray;
By: masquerader modified by ZephyrsFury
Description: Returns a TPA with the positions of all occurances of Item.
Parameters:
Area - 'inv', 'shop', 'bank', 'trade', 'your trade'.
ItemType - DTM, Color, BitmapMask, Bitmap
Item - name/value of your dtm/bmp/color/bmpmask.
Tol - 'dtm' - [] (dtm's can't have tolerance).
'bmp' - [BMPTol].
'color' - [COLOUR Tol, Minimum Colour Count].
'bmpmask' - [BMPTol, ContourTol].
*******************************************************************************}
function ItemCoordinates(Area, ItemType: string; Item: Integer; Tol: TIntegerArray): TPointArray;
var
startx, starty, rowsize, colsize, colnumber, rownumber, col, row: Integer;
x1, y1, x2, y2: Integer;
itemx, itemy, L: Integer;
begin
if (CheckArea(area)) then
begin
AreaInfo(area, startx, starty, rowsize, colsize, colnumber, rownumber);
SetLength(Result, RowNumber * ColNumber);
for row := 0 to rownumber - 1 do
for col := 0 to colnumber - 1 do
begin
x1 := startx + col * colsize;
y1 := starty + row * rowsize;
x2 := x1 + colsize;
y2 := y1 + rowsize;
if FindItem(Itemx, Itemy, ItemType, Item, x1, y1, x2, y2, Tol) then
begin
Result[L].x := ItemX;
Result[L].y := ItemY;
Inc(L);
end;
end;
end;
SetLength(Result, L);
end;
It is an SRL function, i did not make it.