NCDS
2010-10-08 00:10:51
InForesterRandom was broken, obviously causing SolveForester to fail.
Current InForesterRandom:
Colors were outdated, and the NPC dots simply are not focused around the center anymore.
Fixed:
Succesful debug:
Current InForesterRandom:
function InForesterRandom: Boolean;
var
Count, fX, fY, X, Y: Integer;
Pts: TPointArray;
begin
if (FindColor(X, Y, 60909, MMCX - 20, MMCY - 20, MMCX + 20, MMCY + 20)) then //Exists NPC dots
if (not(InBlack)) then //No black in Forester
begin
FindColorsTolerance(Pts, 60909, MMX1, MMY1, MMX2, MMY2, 0);
Count := Length(Pts);
if (Count < 10) then Exit; //More than 10 NPC dots (pheasants)
if (CountColorTolerance(clWhite, MMX1, MMY1, MMX2, MMY2, 50) < 20) then //No white walls
begin
ForesterCenter(fX, fY);
{$ifdef Simba}
FilterPointsDist(pts,0,50,fx,fy);
{$else}
FilterPointsPie(Pts, 0.0, 360.0, 0.0, 50.0, fX, fY);
{$endif}
Result := (Length(Pts) = Count); //All NPC's concentrated in centre
end;
end;
end;
Colors were outdated, and the NPC dots simply are not focused around the center anymore.
Fixed:
function InForesterRandom: Boolean;
var
Count, X, Y: Integer;
Pts: TPointArray;
begin
if (FindColor(X, Y, 62965, MMCX - 20, MMCY - 20, MMCX + 20, MMCY + 20)) then //Exists NPC dots
if (not(InBlack)) then //No black in Forester
begin
FindColorsTolerance(Pts, 62965, MMX1, MMY1, MMX2, MMY2, 0);
Count := Length(Pts);
if (Count < 10) then Exit; //More than 10 NPC dots (pheasants)
Result := (Length(Pts) = Count);
end;
end;
Succesful debug:
Compiled succesfully in 624 ms.
SRL Compiled in 0 msec
Forester: We should talk to the freaky forester.
Forester: Kill The 3 Tailed Pheasant.
Forester: Killed Pheasant.
Forester: Leaving Forester.
Forester: Forester random solved.
Successfully executed.
