Jump to content
haidargubbe

Help with script.

Recommended Posts

Which SCAR version are you using?

Do you need to look at the color from same coordinates or does the color appear randomly in an area?

Also, to which parts do you need color detection? Moving/picking procedures?

 

Your current script can be shortened quite a bit:

 

program mining;

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

procedure Pick;
begin
 Wait(1000);
 MoveMouse(276, 770);
 Wait(1000);
 ClickMouse(276, 770, False);
 Wait(500);
 ClickMouse(276, 770, False);
end;

procedure Move(coordinates: TPoint);
begin
 MoveMouse(coordinates.X, coordinates.Y);
 Wait(1000);
 ClickMouse(coordinates.X, coordinates.Y, False);
 Wait(1000);
end;

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

begin
 Setup;
 Play;
end.

Edited by Janilabo
Link to comment
Share on other sites

Which SCAR version are you using?

Do you need to look at the color from same coordinates or does the color appear randomly in an area?

Also, to which parts do you need color detection? Moving/picking procedures?

 

Your current script can be shortened quite a bit:

 

program mining;

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

procedure Pick;
begin
 Wait(1000);
 MoveMouse(276, 770);
 Wait(1000);
 ClickMouse(276, 770, False);
 Wait(500);
 ClickMouse(276, 770, False);
end;

procedure Move(coordinates: TPoint);
begin
 MoveMouse(coordinates.X, coordinates.Y);
 Wait(1000);
 ClickMouse(coordinates.X, coordinates.Y, False);
 Wait(1000);
end;

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

begin
 Setup;
 Play;
end.

 

i need to click on a color that is on a same spot ..

 

scar version 3,40

Link to comment
Share on other sites

i need to click on a color that is on a same spot ..

 

scar version 3,40

Well, I would need great details to work it out.. What is the same spot?

 

Anyways, would either of these 2 codes work (probably wont, but give em a try and maybe modify yourself):

 

Code 1:

program mining;

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

procedure Pick;
begin
 Wait(1000);
 MoveMouse(276, 770);
 Wait(1000);
 ClickMouse(276, 770, mbLeft);
 Wait(500);
 ClickMouse(276, 770, mbLeft);
end;

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

procedure Detection;
var
 x, y: Integer;
begin
 if FindColor(x, y, 8163998, 132, 102, 152, 122) then
 begin 
   MoveMouse(x, y);
   Wait(250);
   ClickMouse(x, y, mbLeft);
   Wait(500);
 end;
end;

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

begin
 Setup;
 Play;
end.

 

Code 2:

program mining;

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

procedure Pick;
begin
 Wait(1000);
 MoveMouse(276, 770);
 Wait(1000);
 ClickMouse(276, 770, mbLeft);
 Wait(500);
 ClickMouse(276, 770, mbLeft);
end;

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

procedure Detection;
begin
 if (GetColor(142, 112) = 8163998) then
 begin 
   MoveMouse(142, 112);
   Wait(250);
   ClickMouse(142, 112, mbLeft);
   Wait(500);
 end;
end;

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

begin
 Setup;
 Play;
end.

Link to comment
Share on other sites

i dont understand ur type of script but do u have skype so i can show u ?

 

- - - Updated - - -

 

First code works but i need it to double-click,, what is mbleft?

 

and after the click i nee movemouse to another location and click once!

mbLeft means Mouse Button Left

You need em to be right? Then you can just change em to mbRight which is Mouse Button Right.

 

program mining;

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

procedure Pick;
begin
 Wait(1000);
 MoveMouse(276, 770);
 Wait(1000);
 ClickMouse(276, 770, mbLeft);
 Wait(50 + Random(35));
 ClickMouse(276, 770, mbLeft);
end;

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

procedure Detection;
var
 x, y: Integer;
begin
 if FindColor(x, y, 8163998, 132, 102, 152, 122) then
 begin 
   MoveMouse(x, y);
   Wait(250);
   ClickMouse(x, y, mbLeft);
   Wait(50 + Random(35));
   ClickMouse(x, y, mbLeft);
   Wait(500);
 end;
end;

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

begin
 Setup;
 Play;
end.

 

With double-clicking.. Add the mouse movement and click to that another place yourself.. Should not be hard? :)

Link to comment
Share on other sites

begin

if FindColor(x, y, 8163998, 132, 102, 152, 122) then

begin

MoveMouse(136, 111);

Wait(250);

ClickMouse(136, 111, mbLeft);

ClickMouse(136, 111, mbLeft);

Wait(500);

MoveMouse(736, 605);

Wait(500)

ClickMouse(736, 605, mbLeft); When i get here it dosnt click the mouse it just moves the mouse

ClickMouse(136, 111, mbLeft);

end;

Link to comment
Share on other sites

begin

if FindColor(x, y, 8163998, 132, 102, 152, 122) then

begin

MoveMouse(136, 111);

Wait(250);

ClickMouse(136, 111, mbLeft);

ClickMouse(136, 111, mbLeft);

Wait(500);

MoveMouse(736, 605);

Wait(500)

ClickMouse(736, 605, mbLeft); When i get here it dosnt click the mouse it just moves the mouse

ClickMouse(136, 111, mbLeft);

end;

Add small delay (Wait) between the 2 clicks. It sounds like it is right now working a bit too fast for your game (wont accept the input with so small delay).
Link to comment
Share on other sites

Add small delay (Wait) between the 2 clicks. It sounds like it is right now working a bit too fast for your game (wont accept the input with so small delay).

 

 

 

 

evrything works now but only thing is when it finds teh color in the beggining it dosnt click the color it clicks the cordinates , ps. the color can move ..

 

and how do i make the (accepting task) (clicking the color) only in the begging of the script so it dosnt click the color evry round..

 

 

do i need to remove detection from repeat?

 

begin

h := High(path);

repeat

for i := 0 to h do

begin

Detection; if i remove it from here. will the script stop clicking this evry round and just click once in the beggining? and when done with path?

Move(path);

Pick;

end;

until False;

end;

Edited by haidargubbe
Link to comment
Share on other sites

evrything works now but only thing is when it finds teh color in the beggining it dosnt click the color it clicks the cordinates , ps. the color can move ..

 

and how do i make the (accepting task) (clicking the color) only in the begging of the script so it dosnt click the color evry round..

 

 

do i need to remove detection from repeat?

 

begin

h := High(path);

repeat

for i := 0 to h do

begin

Detection; if i remove it from here. will the script stop clicking this evry round and just click once in the beggining? and when done with path?

Move(path);

Pick;

end;

until False;

end;

Show me your current script? I can change it to click the color instead.

..please use code-tags: [c0de]code goes here[/c0de] (replace 0's with o's)

 

Also please give me the area where the color for detection can possibly be/appear.

Edited by Janilabo
Link to comment
Share on other sites

program mining;

 

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 := [u, U, L, U, L, U, L, L, L, L, D, R, R, R, R, R, D, L, L, L,

L, L, L, L, D, R, R, R, R, R, D, L, L, L, L, L, D, R, R, R,

R, R, R, R, D, L, L, L, L, L, L, L, L, D, R, R, R, R, R, R,

D, L, L, L, L, L, D, R, R, R, U, R, R, U, R, U, R, U, R, U];

end;

 

procedure Pick;

begin

Wait(1000);

MoveMouse(276, 770);

Wait(1000);

ClickMouse(276, 770, mbLeft);

end;

 

procedure Move(coordinates: TPoint);

begin

MoveMouse(coordinates.X, coordinates.Y);

Wait(1000);

ClickMouse(coordinates.X, coordinates.Y, mbLeft);

Wait(1000);

end;

 

procedure Detection;

var

x, y: Integer;

begin

if FindColor(x, y, 8163998, 94, 43, 171, 779) then

begin

MoveMouse(136, 111);

Wait(250);

ClickMouse(136, 111, mbLeft);

ClickMouse(136, 111, mbLeft);

Wait(500);

MoveMouse(736, 605);

Wait(500)

ClickMouse(736, 605, mbLeft);

Wait(500)

end;

end;

 

procedure Play;

var

h, i: Integer;

begin

h := High(path);

repeat

for i := 0 to h do

begin

Detection;

Move(path);

Pick;

end;

until False;

end;

 

begin

Setup;

Play;

end.

Please, I told you to use code-tags... Without code-tags you will get rid of standards and also there's a lot more scrolling for forums involved.

 

Anyways, here is the code with some edits, is it doing finally what you need - or possibly even getting closer to it?

 

program mining;

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

procedure Pick;
begin
 Wait(1000);
 MoveMouse(276, 770);
 Wait(1000);
 ClickMouse(276, 770, mbLeft);
 Wait(50 + Random(35));
 ClickMouse(276, 770, mbLeft);
end;

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

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

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

begin
 Setup;
 Play;
end.

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...