n3ss3s
2008-04-05 10:13:35
Well CountItemsDTM and CountItemsBMP are just bumping up the compiling time since there is the CountItems in Inventory.scar…
2008-04-05 10:13:35
2008-04-05 10:20:01
2008-04-05 10:35:33
2008-04-05 10:39:54
2008-04-05 12:07:42
am i wrong or does countitems in inventory.scar count all the items in the inventory? and CountitemsDTM and BMP count a certain item, for use in a proggy or any other reason you would use them.
2008-04-05 12:40:53
From: n3ss3s
Atleast the whole amount.scar isn't outdated.
Bah. If you would bother to view the functions CountItemsDTM, CountItemsBMP etc use, you would see they do the same as the CountItems in inventory.scar, which counts how many instances of an item is there in the inventory, not stacks.
Amount<identifier> is for stacks, and the Count ones count the instances.
2008-04-05 12:58:56
2008-04-05 13:00:54
From: n3ss3s
Well it wasn't any actual "problem", but it was just plain stupid to have two of the function with same purpose, and no, it isn't fixed.
2008-04-05 13:27:25
2008-04-05 23:49:16
2008-04-06 04:13:21
{*******************************************************************************
function CountItems(identifier: Integer; identifiertype: string; tol: TIntegerArray): Integer;
By: WT-Fakawi / Sumilion
Description: Performs a count of inventory items by "identifier" with tol[0]
as color tolerance, tol[1] as contour tolerance in case of bmp masks. Valid identifiertypes are :
bmp, mask, color, dtm.
*******************************************************************************}
function CountItems(identifier: Integer; identifiertype: string; tol: TIntegerArray): Integer;
var
i, x, y, coltol, contol: Integer;
TB: Tbox;
begin
result := 0;
case LowerCase(identifiertype) of
'bmpmask', 'bitmapmask', 'bmp mask', 'bitmap mask', 'mask':
try
begin coltol := tol[0]; contol := tol[1] end;
except
srl_Warn('CountItems', 'Tol was incorrect', warn_AllVersions);
Exit;
end;
'dtm': begin end;
'bmp', 'bitmap', 'color':
try
coltol := tol[0];
except
srl_Warn('CountItems', 'Tol was incorrect', warn_AllVersions);
Exit;
end;
else begin
srl_Warn('CountItems', 'Invalid identifier type: ' + identifiertype, warn_AllVersions);
Exit;
end;
end;
GameTab(4);
for i := 1 to 28 do
begin
TB := InvBox(i);
if ExistsItem(i) then
try
case LowerCase(identifiertype) of
'bmp', 'bitmap':
if FindBitmapSpiralTolerance(identifier, x, y, TB.x1, TB.y1, TB.x2, TB.y2, coltol) then
Inc(Result);
'bmpmask', 'bitmapmask', 'bmp mask', 'bitmap mask', 'mask':
if FindBitmapMaskTolerance(identifier, x, y, TB.x1, TB.y1, TB.x2, TB.y2, coltol, contol) then
Inc(Result);
'color':
if FindColorTolerance(x, y, identifier, TB.x1, TB.y1, TB.x2, TB.y2, coltol) then
Inc(Result);
'dtm':
if FindDtm(identifier, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
Inc(Result);
end;
except end;
end;
end;