marpis
2009-01-28 16:46:08
I found the CountItems function quite hard to use, in fact, i didnt understand it. I made a simplier one, that only uses dtms (dtms are the only real usable way to find items in inventory in most cases, as we all know)
It does NOT tell you how many arrows you have or such. It DOES tell you how many logs, bones or lobsters etc you have.
It does NOT tell you how many arrows you have or such. It DOES tell you how many logs, bones or lobsters etc you have.
function CountItemsDTM(itemdtm: Integer) : integer;
var i : integer;
Box : TBox;
begin
for i:= 1 to 28 do
begin
Box:= InvBox(i);
if ExistsItem(i) then
begin
if FindDtm(itemdtm, x, y, Box.x1, Box.y1, Box.x2, Box.y2) then
Inc(Result);
end;
end;
end;