Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Diamond_Minder;
- procedure WaitRR(MinWait, MaxWait: Integer);
- begin
- Wait(MinWait + Random(MaxWait - MinWait));
- end;
- function CheckForGame: Boolean;
- var
- TPA: TPointArray;
- begin
- FindColors(TPA, 15329769, 0, 0, 437, 318)
- If length(TPA) <1000 then begin
- result := false
- end else begin
- result := true;
- end;
- end;
- procedure WaitForCleared;
- var
- TPA: TPointArray;
- BX, NX: Integer;
- begin
- Repeat
- FindColors(TPA, 15329769, 0, 0, 437, 318)
- BX := Length(TPA);
- WaitRR(150, 200);
- FindColors(TPA, 15329769, 0, 0, 437, 318)
- NX := Length(TPA);
- Until(BX = NX);
- end;
- procedure StartNewGame;
- var
- TPA, TPA2: TPointArray;
- x, y, LX, LY: Integer;
- begin
- FindColors(TPA, 10505544, 12, 139, 131, 142)
- MouseBox(15, 139, 131, 155)
- FindColors(TPA2, 10505544, 12, 139, 131, 142)
- 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);
- WaitRR(8500000, 95000000);
- ClickMouse(x, y, True);
- MoveWindMouse(140 + Random(300), 0 + random(320), 0, 0);
- While not InRange(LX, 10000, 17000) do begin
- FindColors(TPA, 15329769, 0, 0, 437, 318);
- LX := Length(TPA);
- end;
- Writeln(Lx);
- 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.
- PixelsPerBoxX, PixelsPerBoxY: Number of coordinates between the small boxes.
- BoxX, BoxY: The returned boxes. example: (1, 1)
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
- function GetBoxBounds (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 GetOptions (var TBFrom, TBTo: TBox): Boolean;
- var
- i, x, y: Integer;
- begin
- for i := 1 to 64 do begin
- end;
- end;
- procedure ClickBoxes;
- var
- i: Integer;
- TBFrom, TBTo: TBox;
- begin
- if GetOptions(TBFrom, TBTo) then begin
- MouseBox(TBFrom.x1, TBFrom.y1, TBFrom.x2, TBFrom.y2)
- MouseBox(TBTo.x1, TBTo.y1, TBTo.x2, TBTo.y2)
- end;
- end;
- begin
- 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.
Add Comment
Please, Sign In to add comment