TRiLeZ
2009-12-07 18:47:01
InPrisonPete was broken so I fixed it…
I also made a function to leave the prison but I don't think it is needed until all of the the solver is made. If you would like to see it, say so.
{*******************************************************************************
function InPrisonPete: Boolean;
by: ZephyrsFury, modded by TRiLeZ
Description: Checks if we're in the Prison Pete Random.
*******************************************************************************}
function InPrisonPete: Boolean;
var
Pts: TPointArray;
ATPA: T2DPointArray;
X, Y: Integer;
begin
if (FindColor(X, Y, 60909, MMX1, MMY1, MMX2, MMY2)) then
if (CountColor(60909, MMX1, MMY1, MMX2, MMY2) = 1) then
if (FindColorTolerance(X, Y, 1322555, MMX1, MMY1, MMX2, MMY2, 10)) then
if (CountColorTolerance(1322555, MMX1, MMY1, MMX2, MMY2, 10) > 80) then
if (CountColorTolerance(13884127, MMX1, MMY1, MMX2, MMY2, 13) > 1000) then
begin
FindColorsTolerance(Pts, 237, MMX1, MMY1, MMX2, MMY2, 17);
ATPA := SplitTPA(Pts, 5);
if (InRange(Length(ATPA), 1, 3)) then
Result := (CountColorTolerance(clWhite, MMX1, MMY1, MMX2, MMY2, 50) > 500);
end;
end;
:DI also made a function to leave the prison but I don't think it is needed until all of the the solver is made. If you would like to see it, say so.