Guest User

Untitled

a guest
Jun 23rd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 2.85 KB | None | 0 0
  1. program Diamond_Minder;
  2.  
  3. procedure WaitRR(MinWait, MaxWait: Integer);
  4. begin
  5.   Wait(MinWait + Random(MaxWait - MinWait));
  6. end;
  7.  
  8. function CheckForGame: Boolean;
  9. var
  10.   TPA: TPointArray;
  11. begin
  12.   FindColors(TPA, 15329769, 0, 0, 437, 318)
  13.   If length(TPA) <1000 then begin
  14.     result := false
  15.   end else begin
  16.     result := true;
  17.   end;
  18. end;
  19.  
  20. procedure WaitForCleared;
  21. var
  22.   TPA: TPointArray;
  23.   BX, NX: Integer;
  24. begin
  25.   Repeat
  26.     FindColors(TPA, 15329769, 0, 0, 437, 318)
  27.     BX := Length(TPA);
  28.     WaitRR(150, 200);
  29.     FindColors(TPA, 15329769, 0, 0, 437, 318)
  30.     NX := Length(TPA);
  31.   Until(BX = NX);
  32. end;
  33.  
  34. procedure StartNewGame;
  35. var
  36.   TPA, TPA2: TPointArray;
  37.   x, y, LX, LY: Integer;
  38. begin
  39.   FindColors(TPA, 10505544, 12, 139, 131, 142)
  40.   MouseBox(15, 139, 131, 155)
  41.   FindColors(TPA2, 10505544, 12, 139, 131, 142)
  42.   WaitRR(10, 20);
  43.   LX := Length(TPA);
  44.   LY := Length(TPA2);
  45.   if LX > LY then begin
  46.     Writeln('Started a new game');
  47.   end else begin
  48.     writeln('Could not find the start button stopping the script');
  49.     TerminateScript;
  50.   end;
  51.   GetMousePos(x, y);
  52.   WaitRR(8500000, 95000000);
  53.   ClickMouse(x, y, True);
  54.   MoveWindMouse(140 + Random(300), 0 + random(320), 0, 0);
  55.   While not InRange(LX, 10000, 17000) do begin
  56.     FindColors(TPA, 15329769, 0, 0, 437, 318);
  57.     LX := Length(TPA);
  58.   end;
  59.   Writeln(Lx);
  60.   WaitRR(850, 950);
  61. end;
  62.  
  63. //Default: GetBoxBounds(154, 18, 185, 49, 34, 34, 1, 1)
  64.  
  65. {=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  66. Description: Turn a big box in to small boxes and return the given box as a TBox
  67.  
  68. xs, ys, xe, ye: The cordinates of the big box.
  69. PixelsPerBoxX, PixelsPerBoxY: Number of coordinates between the small boxes.
  70. BoxX, BoxY: The returned boxes. example: (1, 1)
  71. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
  72.  
  73. function GetBoxBounds (xs, ys, xe, ye, CordsPerBoxX, CordsPerBoxY, BoxX, BoxY: Integer): TBox;
  74. begin
  75.   result := IntToBox(xs + (CordsPerBoxX * (BoxX - 1)), ys + (CordsPerBoxY * (BoxY - 1)), xe + (CordsPerBoxX * (BoxX - 1)), ye + (CordsPerBoxY * (BoxY - 1)));
  76. end;
  77.  
  78. function GetOptions (var TBFrom, TBTo: TBox): Boolean;
  79. var
  80.   i, x, y: Integer;
  81. begin
  82.   for i := 1 to 64 do begin
  83.  
  84.   end;
  85. end;
  86.  
  87. procedure ClickBoxes;
  88. var
  89.   i: Integer;
  90.   TBFrom, TBTo: TBox;
  91. begin
  92.   if GetOptions(TBFrom, TBTo) then begin
  93.     MouseBox(TBFrom.x1, TBFrom.y1, TBFrom.x2, TBFrom.y2)
  94.     MouseBox(TBTo.x1, TBTo.y1, TBTo.x2, TBTo.y2)
  95.   end;
  96. end;
  97.  
  98. begin
  99.   Writeln('Welcome to sjespers Diamond Minder');
  100.   if CheckForGame = false then begin
  101.     writeln('Did not detect the game. Remember to drag the target to the game. If its not working then try to refresh the game');
  102.     TerminateScript;
  103.   end else begin
  104.     writeln('Found the game. Starting to make you some tokens');
  105.   end;
  106. repeat
  107.   ClickBoxes;
  108. until(false)
  109. end.
Add Comment
Please, Sign In to add comment