Results 1 to 11 of 11

Thread: Type mismatch compiling error.

  1. #1
    Join Date
    Apr 2015
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Type mismatch compiling error.

    Hello I need some help to fix this.

    This single line is where the Error starts.
    Code:
     If length(TPA) < 500 then begin
    This is the function its used in.
    Code:
    function CheckForGame: Boolean;
    var
      TPA: TPointArray;
    begin
      FindColors(TPA, 16777215, 0, 0, 437, 318) 
      If length(TPA) < 500 then begin
        result := false; //<-- ; added. Still wont compile
      end else begin
        result := true;
      end;
    end;
    The whole script is attached here: Diamond Mind.scar
    Last edited by jonas9513; 11-30-2015 at 09:59 AM.

  2. #2
    Join Date
    Dec 2013
    Location
    Pitcairn Island
    Posts
    288
    Mentioned
    20 Post(s)
    Quoted
    166 Post(s)

    Default

    You are missing 2 semicolons

  3. #3
    Join Date
    Apr 2015
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Where if I may ask?

    FindColors(TPA, 16777215, 0, 0, 437, 318);

    Wont compile either.

    Also
    result := false; I have, but thats not the error.

  4. #4
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    If you are using SCAR, then the prototype of FindColors can be found here. It appears you were using Simba's FindColors function (also present in old SCAR) which is different to that of the current SCAR.

    Whereas Simba will return an array of points for each time the colour is found, it appears that SCAR's FindColors function is just like FindColor (no s at the end), with the exception that it will find the first point matching a set of multiple colours, rather than just one colour.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  5. #5
    Join Date
    Apr 2015
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks for the help Daniel.
    However, it seems I still have compiling error no matter how I try to set it up.

    I've tried the different FindColor & FindColors functions but I cant compile it anyways.

    I put a Semicolon after "FindColors(TPA, 16777215, 0, 0, 437, 318)"
    This gives me error at FindColors. So now I know that this is the line that is giving me error.

  6. #6
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    As mentioned, the prototype for FindColors is different than the one you are using. It is expecting the following:
    FindColors(out X, Y: Integer; const Colors: TIntegerArray; const XS, YS, XE, YE: Integer)

    You are giving it the following:
    FindColors(out TPA: TPointArray; const Color: Integer; const XS, YS, XE, YE: Integer)
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  7. #7
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Expanding on what Daniel said:

    There are very notable changes from ~3.3 to 3.4.x (current), in that little snippet there it's enough to replace FindColors with FindColorEx.
    But I'd assume your run into more issues, perhaps simplest to just search for the SCAR version that script was made for.
    Last edited by slacky; 11-30-2015 at 11:53 AM.
    !No priv. messages please

  8. #8
    Join Date
    Apr 2015
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Daniel View Post
    As mentioned, the prototype for FindColors is different than the one you are using. It is expecting the following:
    FindColors(out X, Y: Integer; const Colors: TIntegerArray; const XS, YS, XE, YE: Integer)

    You are giving it the following:
    FindColors(out TPA: TPointArray; const Color: Integer; const XS, YS, XE, YE: Integer)
    I did this, It does compile now, but it wont find the window of the game.

    Code:
    program Diamond_Minder;
    
    //var
    //  T: Boolean;
    
    const
      Mode = 1; //Can be set to 1 or 2. Im not sure what is fastes :P
    
    procedure WaitRR(MinWait, MaxWait: Integer);
    begin
      Wait(MinWait + Random(MaxWait - MinWait));
    end;
    
    function CheckForGame: Boolean;
    var
      TPA: TIntArray;
      x, y : Longint;
    begin
      FindColors(x, y, TPA, 0, 0, 437, 318);    
      //FindColors(TPA, 16777215, 0, 0, 437, 318);    
      If length(TPA) < 500 then begin
        result := false;
      end else begin
        result := true;
      end;
    end;
    
    procedure WaitForCleared;
    var
      TPA: TIntArray;
      BX, NX: Integer;
      x, y : Longint;
    begin
      Wait(100);
      Repeat       
        FindColors(x,y, TPA, 0, 0, 437, 318);
        //FindColors(TPA, 16777215, 0, 0, 437, 318)
        BX := Length(TPA);
        WaitRR(50, 75);                          
        FindColors(x,y,TPA, 0, 0, 437, 318);
        //FindColors(TPA, 16777215, 0, 0, 437, 318)
        NX := Length(TPA);
      Until(BX = NX);
    end;
    
    procedure StartNewGame;
    var
      TPA, TPA2: TIntArray;
      x, y, LX, LY: Integer;
    
    begin
      WaitRR(2000, 2100);
      WaitForCleared;
      FindColors(x,y,TPA, 181, 349, 266, 364);
      //FindColors(TPA, 2986564, 181, 349, 266, 364)
      MouseInBox(Box(181, 349, 266, 364));
      //MouseBox(181, 349, 266, 364);      
      FindColors(x,y,TPA2, 181, 349, 266, 364);
      //FindColors(TPA2, 2986564, 181, 349, 266, 364)
      WaitRR(10, 20);
      LX := Length(TPA);
      LY := Length(TPA2);
      if LX > LY then begin
        Writeln('Started a new game');
      end else begin
        writeln('Could not find the start button stopping the script');
        TerminateScript;
      end;
      GetMousePos(x, y);
      ClickMouse(x, y, True);                                 
      MoveMouseBox(Box(140 + Random(300), 0 + random(320), 0, 0));
      //MoveWindMouse(140 + Random(300), 0 + random(320), 0, 0);
      While InRange(LX, 100, 500) do begin
        //FindColors(TPA, 16777215, 214, 57, 485, 328);
        FindColors(x, y, TPA, 214, 57, 485, 328);
        LX := Length(TPA);
        Writeln(Lx)
      end;
      Writeln(1);
      WaitRR(850, 950);
    end;
    
    //Default: GetBoxBounds(154, 18, 185, 49, 34, 34, 1, 1)
    
    {=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Description: Turn a big box in to small boxes and return the given box as a TBox
    
    xs, ys, xe, ye: The cordinates of the big box.
    CordsPerBoxX, PixelsPerBoxY: Number of coordinates between the small boxes.
    BoxX, BoxY: The returned boxes. example: (1, 1)
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
    
    function GetBoxBoundsEx (xs, ys, xe, ye, CordsPerBoxX, CordsPerBoxY, BoxX, BoxY: Integer): TBox;
    begin
      result := IntToBox(xs + (CordsPerBoxX * (BoxX - 1)), ys + (CordsPerBoxY * (BoxY - 1)), xe + (CordsPerBoxX * (BoxX - 1)), ye + (CordsPerBoxY * (BoxY - 1)));
    end;
    
    function GetBoxBounds (BoxX, BoxY: Integer): TBox;
    begin
      result := IntToBox(214 + (34 * (BoxX - 1)), 57 + (34 * (BoxY - 1)), 247 + (34 * (BoxX - 1)), 90 + (34 * (BoxY - 1)));
    end;
    
    procedure GetCoords (var xs, ys, xe, ye: Integer; BoxX, BoxY: Integer);
    begin
      xs := GetBoxBounds(BoxX, BoxY).x1;
      ys := GetBoxBounds(BoxX, BoxY).y1;
      xe := GetBoxBounds(BoxX, BoxY).x2;
      ye := GetBoxBounds(BoxX, BoxY).y2;
    end;
    
    function CompareColors(i, e, i2, e2, i3, e3, i4, e4, ColorA: Integer; Var Colors: TIntegerArray; var TBFrom: TPoint; var TBTo: TBox): Boolean;
    var
      xs, ys, xe, ye, x, y: Integer;
    begin
      //1st (i)
      GetCoords(xs, ys, xe, ye, i, e);
      if FindColorTol(x, y, Colors[ColorA], xs, ys, xe, ye, 2) then begin
      //if FindColorTolerance(x, y, Colors[ColorA], xs, ys, xe, ye, 2) then begin
        //2nd (i2)
        GetCoords(xs, ys, xe, ye, i + i2, e + e2);
        if FindColorTol(x, y, Colors[ColorA], xs, ys, xe, ye, 2) then begin
        //if FindColorTolerance(x, y, Colors[ColorA], xs, ys, xe, ye, 2) then begin
          //4rd (i3)
          GetCoords(xs, ys, xe, ye, i + i3, e + e3);
          if FindColorTol(x, y, Colors[ColorA], xs, ys, xe, ye, 2) then begin
          //if FindColorTolerance(x, y, Colors[ColorA], xs, ys, xe, ye, 2) then begin
            TBFrom := Point(x, y);
            //3rd (i4)
            GetCoords(xs, ys, xe, ye, i + i4, e + e4);
            TBTo := Box(xs, ys, xe, ye);
            Result := True;
            exit;
          end;
        end;
      end;
    end;
    
    function GetOptions (Colors: TIntegerArray; var TBFrom: TPoint; var TBTo: TBox): Boolean;
    var
      i, e, c, H: Integer;
    begin
      H := High(Colors);
      for c := 0 to H do begin //Colors
        for e := 1 to 8 do begin //Y row
          for i := 1 to 8 do begin //X row
            //Pattern 1
            if CompareColors(i, e, 1, 0, 3, 0, 2, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 1');
              exit;
            //Pattern 2
            end else if CompareColors(i, e, -1, 0, -3, 0, -2, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 2');
              exit;
            //Pattern 3
            end else if CompareColors(i, e, 0, -1, -1, -2, 0, -2, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 3');
              exit;
            //Pattern 4
            end else if CompareColors(i, e, 0, -1, 1, -2, 0, -2, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 4');
              exit;
            //Pattern 5
            end else if CompareColors(i, e, 0, -2, 1, -1, 0, -1, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 5');
              exit;
            //Pattern 6
            end else if CompareColors(i, e, 0, 1, 1, 2, 0, 2, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 6');
              exit;
            //Pattern 7
            end else if CompareColors(i, e, 0, 1, -1, 2, 0, 2, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 7');
              exit;
            //Pattern 8
            end else if CompareColors(i, e, 1, 0, 2, -1, 2, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 8');
              exit;
            //Pattern 9
            end else if CompareColors(i, e, 1, 0, 2, 1, 2, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 9');
              exit;
            //Pattern 10
            end else if CompareColors(i, e, 2, 0, 1, 1, 1, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 10');
              exit;
            //Pattern 11
            end else if CompareColors(i, e, 2, 0, 1, -1, 1, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 11');
              exit;
            //Pattern 12
            end else if CompareColors(i, e, 0, 1, 0, 3, 0, 2, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 12');
              exit;
            //Pattern 13
            end else if CompareColors(i, e, -1, 0, -2, -1, -2, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 13');
              exit;
            //Pattern 14
            end else if CompareColors(i, e, 0, -1, 0, -3, 0, -2, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 14');
              exit;
            //Pattern 15
            end else if CompareColors(i, e, 0, 2, -1, 1, 0, 1, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 15');
              exit;
            end else if CompareColors(i, e, -1, 0, -2, 1, -2, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 16');
              exit;
            end;
          end;
        end;
      end;
      writeln('No more options. Starting a new game');
      WaitForCleared;
      StartNewGame;
    end;
    
    procedure ClickBoxes;
    var
      x, y: Integer;
      TBFrom: TPoint;
      TBTo: TBox;
    begin
      if Mode = 1 then WaitForCleared;
      //            | Grey |  | Red |  |Purple| |Green|  | Blue | | Teal|  |Yellow|
      if GetOptions([5918276, 6119398, 5450823, 4806974, 6703944, 8485181, 5171947, 8089653, 4538462], TBFrom, TBTo) then begin
        MoveMouse(TBFrom.X, TBFrom.Y);
        if Mode = 2 then WaitForCleared;
        ClickMouse(TBFrom.X, TBFrom.Y, True);
        MouseInBox(Box(TBTo.x1, TBTo.y1, TBTo.x2, TBTo.y2));
        //MouseBox(TBTo.x1, TBTo.y1, TBTo.x2, TBTo.y2);
        GetMousePos(x, y);                       
        ClickMouse(x, y, True);
      end;
    end;
    
    begin
      ClearDebug;
      Writeln('Welcome to sjespers Diamond Minder');
      if CheckForGame = false then begin
        writeln('Did not detect the game. Remember to drag the target to the game. If its not working then try to refresh the game');
        TerminateScript;
      end else begin
        writeln('Found the game. Starting to make you some tokens');
      end;
      repeat
        ClickBoxes;
      until(false)
    end.

  9. #9
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    Quote Originally Posted by jonas9513 View Post
    I did this, It does compile now, but it wont find the window of the game.

    Simba Code:
    writeln('Did not detect the game. Remember to drag the target to the game. If its not working then try to refresh the game');
    Have you selected the game as Simba/Scar's target?

  10. #10
    Join Date
    Dec 2013
    Location
    Pitcairn Island
    Posts
    288
    Mentioned
    20 Post(s)
    Quoted
    166 Post(s)

    Default

    You never told it what color to look for. Mr Slacky told you how to fix it

    SCAR Code:
    function CheckForGame: Boolean;
    var
      TPA: TPointArray;
    begin
      FindColorEx(TPA, 16777215, 0, 0, 437, 318);
      Result := (Length(TPA) < 500);
    end;

  11. #11
    Join Date
    Apr 2015
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thank you very much for helping me!

    Now I've came a long way!
    Now it is detecting the game, also its finding the patterns in the game.
    But it does not move them...
    I guess it has something with ClickMouse(x, y, true)? But I'm not sure.

    Code:
    program Diamond_Minder;
    
    //var
    //  T: Boolean;
    
    const
      Mode = 1; //Can be set to 1 or 2. Im not sure what is fastes :P
    
    procedure WaitRR(MinWait, MaxWait: Integer);
    begin
      Wait(MinWait + Random(MaxWait - MinWait));
    end;
    
    function CheckForGame: Boolean;
    var
      TPA: TPointArray;
    begin
      FindColorEx(TPA, 16777215, 0, 0, 437, 318);
      if (Length(TPA) < 500) then begin
        result := false;
      end else begin
        result := true;
      end;
    end;
    
    procedure WaitForCleared;
    var
      TPA: TPointArray;
      BX, NX: Integer;
    //  x, y : Longint;
    begin
      Wait(100);
      Repeat       
        FindColorEx(TPA, 16777215, 0, 0, 437, 318);
        //FindColors(TPA, 16777215, 0, 0, 437, 318)
        BX := Length(TPA);
        WaitRR(50, 75);                          
        FindColorEx(TPA, 16777215, 0, 0, 437, 318);
        //FindColors(TPA, 16777215, 0, 0, 437, 318)
        NX := Length(TPA);
      Until(BX = NX);
    end;
    
    procedure StartNewGame;
    var
      TPA, TPA2: TPointArray;
      x, y, LX, LY: Integer;
    
    begin
      WaitRR(2000, 2100);
      WaitForCleared;
      FindColorEx(TPA, 2986564, 181, 349, 266, 364);
      MouseInBox(Box(181, 349, 266, 364));
      //MouseBox(181, 349, 266, 364);      
      FindColorEx(TPA2, 2986564, 181, 349, 266, 364);
      WaitRR(10, 20);
      LX := Length(TPA);
      LY := Length(TPA2);
      if LX > LY then begin
        Writeln('Started a new game');
      end else begin
        writeln('Could not find the start button stopping the script');
        TerminateScript;
      end;
      GetMousePos(x, y);
      ClickMouse(x, y, True);                                 
      MoveMouseBox(Box(140 + Random(300), 0 + random(320), 0, 0));
      //MoveWindMouse(140 + Random(300), 0 + random(320), 0, 0);
      While InRange(LX, 100, 500) do begin
        FindColorEx(TPA, 16777215, 214, 57, 485, 328);
        LX := Length(TPA);
        Writeln(Lx)
      end;
      Writeln(1);
      WaitRR(850, 950);
    end;
    
    //Default: GetBoxBounds(154, 18, 185, 49, 34, 34, 1, 1)
    
    {=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Description: Turn a big box in to small boxes and return the given box as a TBox
    
    xs, ys, xe, ye: The cordinates of the big box.
    CordsPerBoxX, PixelsPerBoxY: Number of coordinates between the small boxes.
    BoxX, BoxY: The returned boxes. example: (1, 1)
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
    
    function GetBoxBoundsEx (xs, ys, xe, ye, CordsPerBoxX, CordsPerBoxY, BoxX, BoxY: Integer): TBox;
    begin
      result := IntToBox(xs + (CordsPerBoxX * (BoxX - 1)), ys + (CordsPerBoxY * (BoxY - 1)), xe + (CordsPerBoxX * (BoxX - 1)), ye + (CordsPerBoxY * (BoxY - 1)));
    end;
    
    function GetBoxBounds (BoxX, BoxY: Integer): TBox;
    begin
      result := IntToBox(214 + (34 * (BoxX - 1)), 57 + (34 * (BoxY - 1)), 247 + (34 * (BoxX - 1)), 90 + (34 * (BoxY - 1)));
    end;
    
    procedure GetCoords (var xs, ys, xe, ye: Integer; BoxX, BoxY: Integer);
    begin
      xs := GetBoxBounds(BoxX, BoxY).x1;
      ys := GetBoxBounds(BoxX, BoxY).y1;
      xe := GetBoxBounds(BoxX, BoxY).x2;
      ye := GetBoxBounds(BoxX, BoxY).y2;
    end;
    
    function CompareColors(i, e, i2, e2, i3, e3, i4, e4, ColorA: Integer; Var Colors: TIntegerArray; var TBFrom: TPoint; var TBTo: TBox): Boolean;
    var
      xs, ys, xe, ye, x, y: Integer;
    begin
      //1st (i)
      GetCoords(xs, ys, xe, ye, i, e);
      if FindColorTol(x, y, Colors[ColorA], xs, ys, xe, ye, 2) then begin
      //if FindColorTolerance(x, y, Colors[ColorA], xs, ys, xe, ye, 2) then begin
        //2nd (i2)
        GetCoords(xs, ys, xe, ye, i + i2, e + e2);
        if FindColorTol(x, y, Colors[ColorA], xs, ys, xe, ye, 2) then begin
        //if FindColorTolerance(x, y, Colors[ColorA], xs, ys, xe, ye, 2) then begin
          //4rd (i3)
          GetCoords(xs, ys, xe, ye, i + i3, e + e3);
          if FindColorTol(x, y, Colors[ColorA], xs, ys, xe, ye, 2) then begin
          //if FindColorTolerance(x, y, Colors[ColorA], xs, ys, xe, ye, 2) then begin
            TBFrom := Point(x, y);
            //3rd (i4)
            GetCoords(xs, ys, xe, ye, i + i4, e + e4);
            TBTo := Box(xs, ys, xe, ye);
            Result := True;
            exit;
          end;
        end;
      end;
    end;
    
    function GetOptions (Colors: TIntegerArray; var TBFrom: TPoint; var TBTo: TBox): Boolean;
    var
      i, e, c, H: Integer;
    begin
      H := High(Colors);
      for c := 0 to H do begin //Colors
        for e := 1 to 8 do begin //Y row
          for i := 1 to 8 do begin //X row
            //Pattern 1
            if CompareColors(i, e, 1, 0, 3, 0, 2, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 1');
              exit;
            //Pattern 2
            end else if CompareColors(i, e, -1, 0, -3, 0, -2, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 2');
              exit;
            //Pattern 3
            end else if CompareColors(i, e, 0, -1, -1, -2, 0, -2, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 3');
              exit;
            //Pattern 4
            end else if CompareColors(i, e, 0, -1, 1, -2, 0, -2, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 4');
              exit;
            //Pattern 5
            end else if CompareColors(i, e, 0, -2, 1, -1, 0, -1, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 5');
              exit;
            //Pattern 6
            end else if CompareColors(i, e, 0, 1, 1, 2, 0, 2, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 6');
              exit;
            //Pattern 7
            end else if CompareColors(i, e, 0, 1, -1, 2, 0, 2, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 7');
              exit;
            //Pattern 8
            end else if CompareColors(i, e, 1, 0, 2, -1, 2, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 8');
              exit;
            //Pattern 9
            end else if CompareColors(i, e, 1, 0, 2, 1, 2, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 9');
              exit;
            //Pattern 10
            end else if CompareColors(i, e, 2, 0, 1, 1, 1, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 10');
              exit;
            //Pattern 11
            end else if CompareColors(i, e, 2, 0, 1, -1, 1, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 11');
              exit;
            //Pattern 12
            end else if CompareColors(i, e, 0, 1, 0, 3, 0, 2, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 12');
              exit;
            //Pattern 13
            end else if CompareColors(i, e, -1, 0, -2, -1, -2, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 13');
              exit;
            //Pattern 14
            end else if CompareColors(i, e, 0, -1, 0, -3, 0, -2, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 14');
              exit;
            //Pattern 15
            end else if CompareColors(i, e, 0, 2, -1, 1, 0, 1, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 15');
              exit;
            end else if CompareColors(i, e, -1, 0, -2, 1, -2, 0, C, Colors, TBFrom, TBTo) then begin
              Result := True;
              Writeln('Clicked Pattern 16');
              exit;
            end;
          end;
        end;
      end;
      writeln('No more options. Starting a new game');
      WaitForCleared;
      StartNewGame;
    end;
    
    procedure ClickBoxes;
    var
      x, y: Integer;
      TBFrom: TPoint;
      TBTo: TBox;
    begin
      if Mode = 1 then WaitForCleared;
      //            | Grey |  | Red |  |Purple| |Green|  | Blue | | Teal|  |Yellow|
      if GetOptions([5918276, 6119398, 5450823, 4806974, 6703944, 8485181, 5171947, 8089653, 4538462], TBFrom, TBTo) then begin
        MoveMouse(TBFrom.X, TBFrom.Y);
        if Mode = 2 then WaitForCleared;
        ClickMouse(TBFrom.X, TBFrom.Y, True);
        MouseInBox(Box(TBTo.x1, TBTo.y1, TBTo.x2, TBTo.y2));
        //MouseBox(TBTo.x1, TBTo.y1, TBTo.x2, TBTo.y2);
        GetMousePos(x, y);                       
        ClickMouse(x, y, True);
      end;
    end;
    
    begin
      ClearDebug;
      Writeln('Welcome to sjespers Diamond Minder');
      if CheckForGame = false then begin
        writeln('Did not detect the game. Remember to drag the target to the game. If its not working then try to refresh the game');
        TerminateScript;
      end else begin
        writeln('Found the game. Starting to make you some tokens');
      end;
      repeat
        ClickBoxes;
      until(false)
    end.

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
  •