SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.05, 0.23);
if findcolorsspiraltolerance(x, y, DoorTPA, 2184045, MSX1, MSY1, MSX2, MSY2, 5) then
begin
DoorATPA := SplitTPAEx(DoorTPA, 8, 8);
SortATPASize(DoorATPA, true);
for i := 0 to high(DoorATPA) do
begin
DoorBox := GetTPABounds(DoorATPA[i]);
SMART_DebugATPA(true, DoorATPA);
SetColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.02, 0.02);
mousebox(DoorBox.x1 + 2, Doorbox.Y1 + 2, Doorbox.X2 - 2, Doorbox.Y2 - 2, mouse_move);
That's the code.. It started to work when i replaced last line with
mousebox(DoorBox.x1, Doorbox.Y1, Doorbox.X2, Doorbox.Y2, mouse_move);
Thing is I don't understand why I got that error beause door was big enough to use those +2's and -2's