The problem is that it only sets the Result of FindDTM or FindColor at the beginning of the script. If you want it to be changed during the script, then you have to include it in your loop. A way to do this while still having the option of having FindDTM or FindColor would be:
SCAR Code:
function WaitUntil(WaitEach, AmountTries,Color,DTM: Integer; Use: Boolean): boolean;
var
waitedd : integer;
begin
Result := False;
waitedd := 0;
repeat
wait(WaitEach);
if(Use) then
Result:= FindColor(x,y,Color,MIX1, MIY1, MIX2, MIY2)
else
Result:= FindDTM(DTM,x,yMIX1, MIY1, MIX2, MIY2);
inc(waitedd);
until ((waitedd >= AmountTries) or (Result));
if (waitedd >= AmountTries) then EXIT;
Writeln('Found The W/E yu were waiting to find!');
Writeln('We Waited ' + IntToStr(waitedd * WaitEach) + ' MiliSeconds');
Result := True;
end;
And you'd then use it as
SCAR Code:
WaitUntil(250,120,0,DTMLogs,False)
or
SCAR Code:
WaitUntil(250,120,DotColor,0,True)
Hope this helps