Jump to content
Eleflump

Need color help

Recommended Posts

Would this work

 

Program new;

 

If (FindColor(x, y,color, 0,100,100,100));

Then ClickMouse(x, y)

end;

 

I am trying to find a color and if it is there, click on another coordinate

 

If not how could I do this preferably in a simple way(I found out about this today)

 

 

 

And also if I do a new program and start with an if then can I do end; and continue with a begin or will that finish the whole program

Edited by Eleflump
Sudden realiztion of my stupidity
Link to comment
Share on other sites

Can you please be more specific? Do you know where the color you want to find it at and where you want to click if you've found it?

 

Also, your structure is a bit off... begin-end; are blocks of code. Your script's main method is signified by "begin end.", the dot is very important and this block of code is always at the end of your script. If you want to use an if statement, you have to put then at the end. if booleanstatement then.

Link to comment
Share on other sites

First lets fix up your code a bit so we can see what is going on.

program new;

var
 X, Y: Integer;
 Color: Integer;

begin
 Color := 0;  // Change this to the color you are looking for
              // (Use color picker to find)

 // This will search in area (0,100) to (100,100) for color
 // and must find the exact color.
 if FindColor(X, Y, Color, 0, 100, 100, 100) then
   ClickMouse(X, Y, TRUE);

 // This will search the same area with a little tolerance.
 // Good if colors change from session to session
 if FindColorTolerance(X, Y, Color, 0, 100, 100, 100, 10) then
   ClickMouse(X, Y, TRUE);

 // Also exact coord clicking is not recommended. It is very
 // bot like. May want to vary click by +/- a few pixels.
end;

Some context of what you are using this for goes a long ways towards helping. Could we have some more details?

Link to comment
Share on other sites

alright so i know the color i want and i know how to make the box to look for it in but i dont know what the 1st x, y means after FindColor(this one in these brackets)

any help greatly appreciated

 

---MERGED---

 

also how to variate which coord it clicks on (bixby's post)

 

---MERGED---

 

is this slightly closer

 

program test;

begin

if

FindColor(424, 5, 15063191, 404, 10, 434, 10);

then

ClickMouse(328, 858, true);

end.

Edited by Freddy
Link to comment
Share on other sites

The X and Y are populated by the find function. It tells you where it found the color by stuffing those values into X and Y so leave those as variables. Really need some real examples of what you are doing (with real numbers). The made up numbers you are using make it more confusing than it needs to be. This is actually quite simple.

 

for find color you pass in: two variables that it populates (initial values ignored), the color you are searching for, the x,y of upper left corner of search area, the x,y of lower right corner of search area. Pass the x,y that it populated for you to your clickmouse & magic happens!

Link to comment
Share on other sites

ty so much ily <33

 

--MERGED---

 

1 more thing if it doesnt't find it how can i tell it to look for it in a diff place and click on a diff place too

 

--MERGED---

 

my god its saying compiling error line 4

 

 

program new;

 

var

x, y: 739, 390;

Color: 2971289;

 

if FindColor(X, Y, Color, 371, 362, 772, 359) then

MoveMouseSmooth(732, 358);

ClickMouse(732, 358);

 

is it possible to then say

 

or

Movemousesmotth(537, 510);

ClickMouse(537, 510);

Edited by Freddy
Link to comment
Share on other sites

Why don't just just look at Bixby's example... Your color variable is defined wrong. It should be defined as "Color: Integer;". On the next line you should but "begin". On the line after that you can assign the color value to it with " Color := 2971289;". [wiki=ClickMouse]ClickMouse[/wiki] also requires a third argument. True for left button, False for right button.

Link to comment
Share on other sites

Sorry for the newbie questions

 

So to get this straight

 

Program new;

Var

x, y:[coord];

Color:;

begin

Color:=;

if

FindColor(x, y, Color, xs, ys, xe, ye);

Then

MoveMouseSmooth([coords]);

ClickMouse([same coords], [true/false]);

else

MoveMouseSmooth([alternate coords]);

ClickMouseSmooth([alternate coords]);

end.

 

Do not post if it's right

Edited by Eleflump
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...