Line 101: [Error] (22579:51): Type mismatch in script
SCAR Code:
program new;
{.include srl/srl.scar}
{.include srl/srl/misc/debug.scar}
var
tpa, x, y : TPointArray;
function AutoColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.10, 0.33);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 6656151, MMX1, MMY1, MMX2, MMY2, 3);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 21.91) and (X <= 27.84) and (Y >= 23.90) and (Y <= 30.48) and (Z >= 14.51) and (Z <= 18.34) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
function SetDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 904;
dtmMainPoint.y := 204;
dtmMainPoint.AreaSize := 10;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 8823238;
dtmMainPoint.Tolerance := 50;
dtmSubPoints[0].x := 904;
dtmSubPoints[0].y := 204;
dtmSubPoints[0].AreaSize := 10;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 8823238;
dtmSubPoints[0].Tolerance := 50;
dtmSubPoints[1].x := 928;
dtmSubPoints[1].y := 210;
dtmSubPoints[1].AreaSize := 7;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := autocolor;
dtmSubPoints[1].Tolerance := 5;
dtmSubPoints[2].x := 926;
dtmSubPoints[2].y := 232;
dtmSubPoints[2].AreaSize := 7;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := autocolor;
dtmSubPoints[2].Tolerance := 5;
dtmSubPoints[3].x := 932;
dtmSubPoints[3].y := 248;
dtmSubPoints[3].AreaSize := 7;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := autocolor;
dtmSubPoints[3].Tolerance := 5;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
begin
setupsrl;
if RadialRoadWalk(autocolor, 7, 77, 77, 2, 2) then
writeln('yay');
if FindDTM(setddtm, x, y, mmx1, mmy1, mmx2, mmy2) then //line 101
begin
mouse(x, y, 5, 5, true);
fflag(0 + random(1));
end;
freedtm(setddtm);
end.
yakman and i cant findout whats wrong,