function GetObject(HueMod, SatMod: Extended; Color, X1, Y1, X2, Y2, Tolerance, W, H: Integer; Close, Big: Boolean; Uptexts: TStringArray): Boolean;
var
TPA: TPointArray;
X, Y, I, A, CTS: Integer;
ATPA : T2DPointArray;
TB: TBox;
begin
if not LoggedIn then Exit;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(HueMod, SatMod);
FindColorsTolerance(TPA, Color, X1, Y1, X2, Y2, Tolerance);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(CTS);
if (Length(TPA) < 1) then
begin
Result := False;
Exit;
end;
ATPA := TPAToATPAEx(TPA, W, H);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
A := High(ATPA);
for I := 0 to A do
begin
MiddleTPAEx(ATPA
, X, Y);
TB := GetTPABounds(ATPA);
if (TB.X2 - TB.X1 >= W - 5) and (TB.Y2 - TB.Y1 >= H - 5) then
begin
MMouse(X, Y, 5, 5);
if WaitUpTextMulti(UpTexts, 125) then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, True);
FFlag(0);
Wait(500 + Random(500));
FFlag(0);
Wait(500 + Random(500));
Result := True;
Exit;
end;
end;
end;
end;
function FindObject(Obj: string): Boolean;
begin
case Obj of
'DOOR': Result := GetObject(0.00, 0.05, 4876399, MSX1, MSY1, MSX2, MSY2, 10, 3, 10, True, True, ['open', 'pen']);
end;
end;
Total click on furniture :duh: