Results 1 to 7 of 7

Thread: odd type mismatch

  1. #1
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default odd type mismatch

    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,
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  2. #2
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    what is line 101? to lazy to count :P
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  3. #3
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    Quote Originally Posted by bionicle1800 View Post
    what is line 101? to lazy to count :P
    very bottom, silly
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  4. #4
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    X, Y are global TPAs and local Integers.
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  5. #5
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    SCAR Code:
    program new;
    {.include srl/srl.scar}
    {.include srl/srl/misc/debug.scar}
    var
      x, y : Integer;

    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.

    x, y : TPointArray; // there was your problem.
    There used to be something meaningful here.

  6. #6
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    can i haz ?
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  7. #7
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    SCAR Code:
    program new;
    {.include srl/srl.scar}
    {.include srl/srl/misc/debug.scar}
    var
      x, y : Integer;

    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.

    x, y : TPointArray; // there was your problem.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •