Jump to content
haidargubbe

Help to make bitmaps.

Recommended Posts

program Gopro;

const
 ROUNDS = 3; // Before banking?

var
 normal_path, bank_path, return_path: TPointArray;

procedure Setup;
var
 U, D, L, R: TPoint;
begin
 U := Point(639, 702);
 D := Point(639, 780);    
 L := Point(599, 739); 
 R := Point(676, 738);
 normal_path := [L, L, L, L, L, L, L, D, R, R, R, R, R, R, R, R, D, L, L, L, L,
  L, L, L, L, L, L, D, R, R, R, R, R, R, R, R, R, R, R, R, R, D, 
   L, L, L, L, L, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R, R, R, R, R, R, R,
   D, L, L, L, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R, R, R, U, U, U, U,
   U, U, U];
 bank_path := [u, U, R, U, U, R, U, U, U, U, L, U, U, R, R, R, U, U, U, L, L, U, U,
 R, U, U, U, L, L, U, L, L, L, U, U, U, U, U, U, U];
 return_path := [D, D, D, D, D, D, D, R, R, R, D, R, R, D, D, D, L, D, D, R, R, D, D,
  D, L, L, L, D, D, R, D, D, D, D, L, D, D];
end;  

procedure Move(coordinates: TPoint);
begin
 MoveMouse(coordinates.X, coordinates.Y);
 Wait(2000);
 ClickMouse(coordinates.X, coordinates.Y, mbLeft);
 Wait(3000);
end;

procedure RunPath(path: TPointArray);
var
 h, i: Integer;
begin
 h := High(path);
 for i := 0 to h do
 begin
   MoveMouse(path[i].X, path[i].Y);
   Wait(2000);
   ClickMouse(path[i].X, path[i].Y, mbLeft);
   Wait(3000);
 end;  
end;

procedure Detection1;
var
 x, y: Integer;
begin
 while FindColor(x, y, 790040, 94, 43, 171, 779) do   
 begin
   MoveMouse(x, y);
   Wait(350);
   ClickMouse(x, y, mbLeft);
   Wait(50 + Random(35));
   ClickMouse(x, y, mbLeft);
   Wait(2000);
 end;
end;

procedure Detectionnight;
var
 x, y: Integer;
begin
 while FindColor(x, y, 6348181, 206, 299, 597, 367) do   
 begin
   Wait(500)
   MoveMouse(275, 776);
   Wait(500);
   ClickMouse(275, 776, mbLeft);

 end;
end;

procedure Detectionnightthistle;
var
 x, y: Integer;
begin
 while FindColor(x, y, 16719838, 206, 299, 597, 367) do   
 begin
   Wait(500)
   MoveMouse(275, 776);
   Wait(500);
   ClickMouse(275, 776, mbLeft);

 end;
end;

procedure buff;
begin
Wait(1000)
VKeyDown(VK_F1);
Wait(500);
VKeyUp(VK_F1); 
end;

procedure Put;
begin
 MoveMouse(525, 769);
 Wait(500)
 ClickMouse(525, 769, mbLeft);
 Wait(500)
 MoveMouse(659, 563);
 Wait(500)
 ClickMouse(659, 563, mbLeft);
 Wait(500)
 MoveMouse(860, 42);
 Wait(500)
 ClickMouse(860, 42, mbLeft); 
end;

procedure Play;
var
 h, i, c: Integer;
begin
 h := High(normal_path);
 repeat  
   for c := 1 to ROUNDS do           
     for i := 0 to h do
     begin  
       Detection1;
       Detectionnight;
       Detectionnightthistle;       
       Move(normal_path[i]); 
     end; 
   RunPath(bank_path);
   Put;
   RunPath(return_path);
   buff; 
 until False;
end;

begin
 case (ROUNDS > 0) of
   True: 
   begin
    Setup;
    Play;
   end;
   False: WriteLn('TERMINATING: Invalid rounds! Must be over 0...');    
 end;
end.

 

i got some help from jani last time to make a script and this is my own modificated and the only thing i need help with is

 

instead of

procedure Detection1;
var
 x, y: Integer;
begin
 while FindColor(x, y, 790040, 94, 43, 171, 779) do   
 begin
   MoveMouse(x, y);
   Wait(350);
   ClickMouse(x, y, mbLeft);
   Wait(50 + Random(35));
   ClickMouse(x, y, mbLeft);
   Wait(2000);
 end;
end;

 

i want it to find bitmap and click the mouse like in Findcolor

 

 

Bmp := TSCARBitmap.Create('deNpjZGBkCPb2AAAB6gDp');

 

How do i do that?

Link to comment
Share on other sites

var
 bmp: TSCARBitmap;

//....

procedure Setup;
var
 U, D, L, R: TPoint;
begin
 U := Point(639, 702);
 D := Point(639, 780);    
 L := Point(599, 739); 
 R := Point(676, 738);
 normal_path := [L, L, L, L, L, L, L, D, R, R, R, R, R, R, R, R, D, L, L, L, L,
  L, L, L, L, L, L, D, R, R, R, R, R, R, R, R, R, R, R, R, R, D, 
   L, L, L, L, L, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R, R, R, R, R, R, R,
   D, L, L, L, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R, R, R, U, U, U, U,
   U, U, U];
 bank_path := [u, U, R, U, U, R, U, U, U, U, L, U, U, R, R, R, U, U, U, L, L, U, U,
 R, U, U, U, L, L, U, L, L, L, U, U, U, U, U, U, U];
 return_path := [D, D, D, D, D, D, D, R, R, R, D, R, R, D, D, D, L, D, D, R, R, D, D,
  D, L, L, L, D, D, R, D, D, D, D, L, D, D];

 Bmp := TSCARBitmap.Create('deNpjZGBkCPb2AAAB6gDp');
end;

//....

procedure Detection1;
var
 x, y: Integer;
begin
 while FindBitmapTol(X,Y,Bmp, 94, 43, 171, 779, 10) do   
 begin
   MoveMouse(x, y);
   Wait(350);
   ClickMouse(x, y, mbLeft);
   Wait(50 + Random(35));
   ClickMouse(x, y, mbLeft);
   Wait(2000);
 end;
end;

//....

 

 

The last parameter in FindBitmapTol is the tolerance (I set it to 10 to allow some very small change in color, feel free to lower or increse it).

Edited by slacky
Link to comment
Share on other sites

Add more bitmap variables. You can't search for multiple bitmaps at once, so you'd have to go through them in a loop. Like from your first bitmap to your last.

 

var
bmp1, bmp2, bmp3: TScarBitmap;

begin
 Bmp1 := TSCARBitmap.Create('deNpjZGBkCPb2AAAB6gDp');
 Bmp2 := TSCARBitmap.Create('deNpjZGBkCPb2AAAB6gDp');
 Bmp3 := TSCARBitmap.Create('deNpjZGBkCPb2AAAB6gDp');
if FindBitmapTol(X,Y,Bmp1, 94, 43, 171, 779, 10) then
WriteLn('Found bitmap 1');
if FindBitmapTol(X,Y,Bmp2, 94, 43, 171, 779, 10) then
WriteLn('Found bitmap 2');
if FindBitmapTol(X,Y,Bmp3, 94, 43, 171, 779, 10) then
WriteLn('Found bitmap 3');
end.

Edited by LordJashin
Link to comment
Share on other sites

So instead of

procedure Detection1;
var
 x, y: Integer;
begin
 while FindColor(x, y, 790040, 94, 43, 171, 779) do   
 begin
   MoveMouse(x, y);
   Wait(350);
   ClickMouse(x, y, mbLeft);
   Wait(50 + Random(35));
   ClickMouse(x, y, mbLeft);
   Wait(2000);
 end;
end;

 

 

i make this loop?

var

Procedure Detection;
var
bmp1, bmp2, bmp3: TScarBitmap;

begin
 Bmp1 := TSCARBitmap.Create('deNpjZGBkCPb2AAAB6gDp');
 Bmp2 := TSCARBitmap.Create('deNpjZGBkCPb2AAAB6gDp');
 Bmp3 := TSCARBitmap.Create('deNpjZGBkCPb2AAAB6gDp');
if FindBitmapTol(X,Y,Bmp1, 94, 43, 171, 779, 10) then
WriteLn('Found bitmap 1');
if FindBitmapTol(X,Y,Bmp2, 94, 43, 171, 779, 10) then
WriteLn('Found bitmap 2');
if FindBitmapTol(X,Y,Bmp3, 94, 43, 171, 779, 10) then
WriteLn('Found bitmap 3');
end.

 

??

Edited by haidargubbe
Link to comment
Share on other sites

program Gopro;

const
 ROUNDS = 5; // Before banking?

var
 normal_path, bank_path, return_path: TPointArray;

procedure Setup;
var
 U, D, L, R: TPoint;
begin
 U := Point(639, 702);
 D := Point(639, 780);    
 L := Point(599, 739); 
 R := Point(676, 738);
 normal_path := [D, D, L, D, D, R, R, U, U, L, U, U, R, U, U, U, U, L, L, U, U, U, D, D, D, L, L, L, U, U, U, U, D, D, D, D, R, R, R, R, D, D, D, D];
 bank_path := [L, L, L, L, L, L, L, L, L, D, L, L, U, U, U, U, U, U, R, U, U, U, U, U, U, L, L];
 return_path := [R, R, D, D, D, D, D, D, L, D, D, D, D, D, D, R, R, U, R, R, R, R, R, R, R, R, R];
end;  

procedure Move(coordinates: TPoint);
begin
 MoveMouse(coordinates.X, coordinates.Y);
 Wait(2000);
 ClickMouse(coordinates.X, coordinates.Y, mbLeft);
 Wait(3000);
end;

procedure RunPath(path: TPointArray);
var
 h, i: Integer;
begin
 h := High(path);
 for i := 0 to h do
 begin
   MoveMouse(path[i].X, path[i].Y);
   Wait(2000);
   ClickMouse(path[i].X, path[i].Y, mbLeft);
   Wait(3000);
 end;  
end;

procedure Detection;
var
 x, y: Integer;
begin
 while FindColor(x, y, 8694737, 94, 43, 171, 779) do
 begin
   MoveMouse(x, y);
   Wait(350);
   ClickMouse(x, y, mbLeft);
   Wait(50 + Random(35));
   ClickMouse(x, y, mbLeft);
   Wait(2000);
 end;
end;

procedure Put;
begin
 MoveMouse(522, 773);
 Wait(500)
 ClickMouse(522, 773, mbLeft);
 Wait(500)
 MoveMouse(658, 565);
 Wait(500)
 ClickMouse(658, 565, mbLeft);
 Wait(500)
 MoveMouse(861, 43);
 Wait(500)
 ClickMouse(861, 43, mbLeft); 
end;

procedure Play;
var
 h, i, c: Integer;
begin
 h := High(normal_path);
 repeat  
   for c := 1 to ROUNDS do           
     for i := 0 to h do
     begin  
       Detection;        
       Move(normal_path[i]); 
     end; 
   RunPath(bank_path);
   Put;
   RunPath(return_path); 
 until False;
end;

begin
 case (ROUNDS > 0) of
   True: 
   begin
    Setup;
    Play;
   end;
   False: WriteLn('TERMINATING: Invalid rounds! Must be over 0...');    
 end;
end.

 

can u put the bitmaps in right Place so i just change them? ive tried but dont know were to put them..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...