Well CountItemsDTM and CountItemsBMP are just bumping up the compiling time since there is the CountItems in Inventory.scar...
Printable View
Well CountItemsDTM and CountItemsBMP are just bumping up the compiling time since there is the CountItems in Inventory.scar...
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.
Same as n3ss, if it doesnt give me some errors, it gives me a 'Mined : 0 Rocks' at my progress report....(Using CountItemsBmp and CountItemsDtm)...
yea i heard it was outdated, but not "duplicate". maybe be taken out, but not for being duplicated
and n3ss said it was just a rumour
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.Quote:
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.
Amount<identifier> is for stacks, and the Count ones count the instances.
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.
But you haven't been on MSN today except for like 5 minutes, which was when I forgot about this thread :p Come to msn...
If you come I will give you a cookie and a TPA ChooseOption ;)
I use CountItemsDTM and it's nice.
but it is true that having the duplicate is pointless, however DTM's are harder than bitmaps so some noobs might want to use them, and DTM's are better so all the smart people use DTM's
But look -
SCAR Code:{*******************************************************************************
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;
You can use a bitmap, mask or a dtm with it! So, CountItemsDTM and CountItemsBMP are useless.