How do I use FindColor?
if FindColor(var x,y,: Integer; color, xs, ys, xe, ye: Integer):
How do I use FindColor?
if FindColor(var x,y,: Integer; color, xs, ys, xe, ye: Integer):
So your variables x,y is the coordinates of the color you're trying to find. Color is the color it's looking for and xs, ys, xe, ye are the coordinates it's looking for the color within. Using the color dropped tool in simba you can click on it, then click on rs and it'll give you the color and coordinates of it. Here is an example
This looks for the color 1234556 in the main screen. The MSX1, MSY1 is the coordinate in the top left of the screen and MSX2, MSY2 is the coordinate in the bottom right of the main screen. This creates a box to look for the color in. It returns the spot the color was found as x,ySimba Code:Findcolor(X,Y, 1234556, MSX1, MSY1, MSX2, MSY2)
You will have to declare your variables at the beginning of the script though. For exmaple;
Simba Code:Procedure FindSomeColor;
Var
x, y: integer;
Begin
FindColor(x,y, 1234556, 1, 1, 100, 100)
Mouse(x, y, 5 , 5, True);
End;
Would left click the color. You might look at YoHoJo's video tutorials although I think some procedures might need slight altering.
Last edited by lilcmp1; 03-22-2012 at 03:37 AM.
also, what is wrong with this?
if GetColor(-412, -4,: True): 251;
Get color is a function that results in a color. So if you're using it say
Simba Code:Getcolor(50,150)
It would search the screen at the coordinate 50,150 and the result would be the color that is there.
So you could use it
So if the color at 50,150 equals your color (123456) then you could do something. Idk what else you'd want to do with it. Not sure where you're going with it. You also can't use negative numbers. If your getting negative numbers you need to press the target icon then drag it to the rs window to set the correct window.Simba Code:If (GetColor(50,150) = 123456) Then
blah... blah;
I like you, thanks, I'm making my first script, all it involves is clicking colors, but if that color is a certain color it refreshes the page. If the color is the correct color it waits 2 minutes then refreshes the page. I'm using SCAR.
There are currently 1 users browsing this thread. (0 members and 1 guests)