Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
haidargubbe

My second script needs some help.

Recommended Posts

program Gopro;

var
 U, D, L, R: TPoint;
 path: TPointArray;

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

procedure gobank;
begin
 U := Point(639, 702);
 D := Point(639, 780);    
 L := Point(599, 739); 
 R := Point(676, 738);
 path := [D, D, D, L, L, D, D, D, D, D, D, D, D, D, L, L];
end; 

procedure GOBACK;
begin
 U := Point(639, 702);
 D := Point(639, 780);    
 L := Point(599, 739); 
 R := Point(676, 738);
 path := [R, R, U, U, U, U, U, U, U, U, U, R, R, U, U, U];
end; 

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

procedure Detection;
var
 x, y: Integer;
begin
 if FindColor(x, y, 3094824, 94, 43, 171, 779) then
 begin
   MoveMouse(x, y);
   Wait(350);
   ClickMouse(x, y, mbLeft);
   Wait(50 + Random(35));
   ClickMouse(x, y, mbLeft);
 end;
end;

procedure Put;
begin
MoveMouse(525, 769);
Wait(500)
ClickMouse(525, 769, mbLeft);
Wait(500)
MoveMouse(775, 654);
Wait(500)
ClickMouse(775, 654, mbLeft);
Wait(500)
MoveMouse(974, 128);
Wait(500)
ClickMouse(974, 128, mbLeft); 
end;


procedure Play;
var
 h, i: Integer;
begin
 h := High(path);
 repeat             
   for i := 0 to h do
   begin  
     Detection;        
     Move(path[i]); 
   end;
 until False;
end;

begin
 Setup;
 Play;

end.

 

What i want it to do is go the path procedure Setup; with Detection; so it detect and kill monsters 5 times around that path and then procedure gobank; ---->procedure Put; ---->procedure GOBACK;

 

so gobank put and goback just once evry 5 rounds around the map and then start over.

Share this post


Link to post
Share on other sites
program Gopro;

var
 U, D, L, R: TPoint;
 path: TPointArray;

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

procedure gobank;
begin
 U := Point(639, 702);
 D := Point(639, 780);    
 L := Point(599, 739); 
 R := Point(676, 738);
 path := [D, D, D, L, L, D, D, D, D, D, D, D, D, D, L, L];
end; 

procedure GOBACK;
begin
 U := Point(639, 702);
 D := Point(639, 780);    
 L := Point(599, 739); 
 R := Point(676, 738);
 path := [R, R, U, U, U, U, U, U, U, U, U, R, R, U, U, U];
end; 

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

procedure Detection;
var
 x, y: Integer;
begin
 if FindColor(x, y, 3094824, 94, 43, 171, 779) then
 begin
   MoveMouse(x, y);
   Wait(350);
   ClickMouse(x, y, mbLeft);
   Wait(50 + Random(35));
   ClickMouse(x, y, mbLeft);
 end;
end;

procedure Put;
begin
MoveMouse(525, 769);
Wait(500)
ClickMouse(525, 769, mbLeft);
Wait(500)
MoveMouse(775, 654);
Wait(500)
ClickMouse(775, 654, mbLeft);
Wait(500)
MoveMouse(974, 128);
Wait(500)
ClickMouse(974, 128, mbLeft); 
end;


procedure Play;
var
 h, i: Integer;
begin
 h := High(path);
 repeat             
   for i := 0 to h do
   begin  
     Detection;        
     Move(path[i]); 
   end;
 until False;
end;

begin
 Setup;
 Play;

end.

 

What i want it to do is go the path procedure Setup; with Detection; so it detect and kill monsters 5 times around that path and then procedure gobank; ---->procedure Put; ---->procedure GOBACK;

 

so gobank put and goback just once evry 5 rounds around the map and then start over.

Hmmmm...

 

Maybe something like this:

 

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 := [R, U, R, U, L, L, L, L, L, U, R, R, R, R, R, R, R, R, U,
                 L, L, L, L, L, L, L, L, U, R, R, R, R, R, R, U, L, L, L, L,
                 U, R, R, R, D, L, L, L, L, D, R, R, R, R, R, R,
                 D, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R, R, R, 
                 D, L, L, L, L, L, L, L, D, R, R, D, R, R];
 bank_path := [D, D, D, L, L, D, D, D, D, D, D, D, D, D, L, L];
 return_path := [R, R, U, U, U, U, U, U, U, U, U, R, R, U, U, U];
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
 if FindColor(x, y, 3094824, 94, 43, 171, 779) then
 begin
   MoveMouse(x, y);
   Wait(350);
   ClickMouse(x, y, mbLeft);
   Wait(50 + Random(35));
   ClickMouse(x, y, mbLeft);
 end;
end;

procedure Put;
begin
 MoveMouse(525, 769);
 Wait(500)
 ClickMouse(525, 769, mbLeft);
 Wait(500)
 MoveMouse(775, 654);
 Wait(500)
 ClickMouse(775, 654, mbLeft);
 Wait(500)
 MoveMouse(974, 128);
 Wait(500)
 ClickMouse(974, 128, 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.

 

P.S. Thank you for using code-tags! Much cleaner now. :)

Share this post


Link to post
Share on other sites

Thank you very much it works fine!

 

But one more thing: when it finds the monster in one path it attacks but directly moves to next path after can u make it so it attacks all detected of that color?

Share this post


Link to post
Share on other sites

This aint going to be easy for me, because I don't play the game... But, I expect you are after something like this (I hope so):

 

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 := [R, U, R, U, L, L, L, L, L, U, R, R, R, R, R, R, R, R, U,
                 L, L, L, L, L, L, L, L, U, R, R, R, R, R, R, U, L, L, L, L,
                 U, R, R, R, D, L, L, L, L, D, R, R, R, R, R, R,
                 D, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R, R, R, 
                 D, L, L, L, L, L, L, L, D, R, R, D, R, R];
 bank_path := [D, D, D, L, L, D, D, D, D, D, D, D, D, D, L, L];
 return_path := [R, R, U, U, U, U, U, U, U, U, U, R, R, U, U, U];
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, 3094824, 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(525, 769);
 Wait(500)
 ClickMouse(525, 769, mbLeft);
 Wait(500)
 MoveMouse(775, 654);
 Wait(500)
 ClickMouse(775, 654, mbLeft);
 Wait(500)
 MoveMouse(974, 128);
 Wait(500)
 ClickMouse(974, 128, 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.

Edited by Janilabo

Share this post


Link to post
Share on other sites
I have to say that i LOVE YOU!!!!
So, I guess it works now as you wanted? :o

 

Anyways, if you want a bit faster response for stopping the script with CTRL+ALT+S hotkey, then here you go:

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 := [R, U, R, U, L, L, L, L, L, U, R, R, R, R, R, R, R, R, U,
                 L, L, L, L, L, L, L, L, U, R, R, R, R, R, R, U, L, L, L, L,
                 U, R, R, R, D, L, L, L, L, D, R, R, R, R, R, R,
                 D, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R, R, R, 
                 D, L, L, L, L, L, L, L, D, R, R, D, R, R];
 bank_path := [D, D, D, L, L, D, D, D, D, D, D, D, D, D, L, L];
 return_path := [R, R, U, U, U, U, U, U, U, U, U, R, R, U, U, U];
end;  

procedure Wait2(MS: Integer);
var
 t: Integer;
 k: Byte;
begin
 t := GetTimeRunning;
 k := CharToVKey('s');
 repeat
   if GetCurrentKeyState(VK_CONTROL) then
     if GetCurrentKeyState(VK_MENU) then
       if GetCurrentKeyState(k) then
         TerminateScript;
 until ((GetTimeRunning- t) > MS);
end;

procedure Move(coordinates: TPoint);
begin
 MoveMouse(coordinates.X, coordinates.Y);
 Wait2(2000);
 ClickMouse(coordinates.X, coordinates.Y, mbLeft);
 Wait2(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);
   Wait2(2000);
   ClickMouse(path[i].X, path[i].Y, mbLeft);
   Wait2(3000);
 end;  
end;

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

procedure Put;
begin
 MoveMouse(525, 769);
 Wait2(500)
 ClickMouse(525, 769, mbLeft);
 Wait2(500)
 MoveMouse(775, 654);
 Wait2(500)
 ClickMouse(775, 654, mbLeft);
 Wait2(500)
 MoveMouse(974, 128);
 Wait2(500)
 ClickMouse(974, 128, 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.

 

Enjoy!

Share this post


Link to post
Share on other sites

procedure Detection;
var
 x, y: Integer;
begin
 while FindColor(x, y, 3094824, 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;

 

can this procedure be changed so it detects text?

Share this post


Link to post
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...