Bobzilla69
2011-05-02 06:07:00
I found that it wont actually count correctly, i used DebugATPA to see what was happening and it appeared not to be large enough to count each item box correctly or to large and not count an item completely.
below is the original and my alteration.
Thought?
changed this
to this
below is the original and my alteration.
Thought?
changed this
function CountItemsBlackLine(Count, Tol: Integer): Integer;
var
TPA: TPointArray;
I, H: Integer;
TPAA: T2DPointArray;
begin
GameTab(tab_Inv);
result := 0;
FindColors(TPA, SRL_OUTLINE_BLACK, MIX1, MIY1, MIX2, MIY2);
TPAA := TPAToATPAEx(TPA, 42, 36);
H := High(TPAA);
for I := 0 to H do
if InRange(GetArrayLength(TPAA[i]), Count - Tol, Count + Tol) then
Inc(Result);
end;
to this
function CountItemsBlackLine(Count, Tol: Integer): Integer;
var
I, B: Integer;
Search:TBox;
begin
GameTab(tab_Inv);
result := 0;
for i:=1 to 28 do
begin
Search:= InvBox(i);
B:= CountColor(SRL_OUTLINE_BLACK, Search.X1, Search.Y1, Search.X2, Search.Y2 );
if InRange(B, Count - Tol, Count + Tol) then
Inc(Result);
end;
end;