Results 1 to 5 of 5

Thread: function FindColor

  1. #1
    Join Date
    Jun 2007
    Posts
    44
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default function FindColor

    How do I use FindColor?

    if FindColor(var x,y,: Integer; color, xs, ys, xe, ye: Integer):

  2. #2
    Join Date
    Dec 2011
    Posts
    392
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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
    Simba Code:
    Findcolor(X,Y, 1234556, MSX1, MSY1, MSX2, MSY2)
    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,y

    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.

  3. #3
    Join Date
    Jun 2007
    Posts
    44
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    also, what is wrong with this?

    if GetColor(-412, -4,: True): 251;

  4. #4
    Join Date
    Dec 2011
    Posts
    392
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Jacob View Post
    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
    Simba Code:
    If (GetColor(50,150) = 123456) Then
      blah... blah;
    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.

  5. #5
    Join Date
    Jun 2007
    Posts
    44
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •