function FindDoor : Boolean;
var
q : Integer;
DoorLocs: TPointArray;
DoorLoc : TPoint;
begin
if not LoggedIn then Exit;
Write('OpenCookDoor...');
MakeCompass('E');
SetAngle(True);
AntiRandom;
x := MSCx;
y := MSCy - 40;
FindColorsSpiralTolerance(x, y, DoorLocs, 10407888, MSX1, MSY1, MSX2, MSY2, 10);
if Length(DoorLocs) = 0 then
begin
Write('Using Color 2...');
FindColorsSpiralTolerance(x, y, DoorLocs, 6986651, MSX1, MSY1, MSX2, MSY2, 10);
end;
if Length(DoorLocs) = 0 then
begin
Result := False;
Write('Could Not Find Any Door Colors');
Exit;
end;
for q:= 0 to High(DoorLocs)do
begin
DoorLoc := DoorLocs[q];
x := DoorLoc.x;
y := DoorLoc.y;
MMouse (x, y, 3, 3);
if (IsUpTextMultiCustom(['pen', 'oor'])) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
ChooseOption('pen');
Write('Door Was Closed');
Result := True;
Exit;
end;
if (IsUpTextMultiCustom(['lose', 'oor'])) then
begin
Wait(250+random(250));
Mouse(x - 12, y, 3, 3, True);
Write('Door Was Open');
Result := True;
Exit;
end;
Wait(350+random(350));
end;
Result := False;
Write('Could Not Find Door');
end;