Something like this you mean?:
SCAR Code:
function TakeOff(I: Integer): Boolean;
var
TP: TPoint; x, y, ii: Integer;
begin
if not WearingItem(i) then Exit;
TP := EquipmentCoords(I);
for ii := 0 to 4 do
begin
Mouse(TP.x, TP.y, 5, 5, True);
Wait(75 + Random(50));
Result := (not (FindColor(X, Y, srl_outline_black, TP.x - 8, TP.y - 8, TP.x + 8, TP.y + 8)));
if Result then Exit;
end;
end;
or this?
SCAR Code:
function TakeOff(I: Integer): Boolean;
var
TP: TPoint; x, y: Integer;
begin
if not WearingItem(i) then Exit;
TP := EquipmentCoords(I);
Mouse(TP.x, TP.y, 5, 5, True);
Result := (not (FindColor(X, Y, srl_outline_black, TP.x - 8, TP.y - 8, TP.x + 8, TP.y + 8)));
t := GetSystemTime + 5000;
repeat
if Result then Exit;
Wait(50 + Random(50));
until(GetSystemTime > t);
srl_Warn('TakeOff', 'Failed to remove item'+IntToStr(i)+'.', warn_Warning);
end;
Is that what you meant or did I misunderstand you?
Edit: and thank you RM