Results 1 to 5 of 5

Thread: What Colorfinding to use?

  1. #1
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default What Colorfinding to use?

    How should i look for colors in my Magical Chicken Killer?
    I of course use the red, should i use FindColorSpiral on it like a 5x5 pixel area?


    EDIT: Can i use the spiral on the red 5x5 area and then ask it to look for the light brown OR brown, cuz the chickens are mainly that color.

    So it would find red and find brown in a 5x5 area of the red. If this is easily or not easily done post it here please

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Try making little bitmaps of chickens or color will work also,
    you can do something liek

    SCAR Code:
    Procedure KillChicken;
    Begin
      X:=MSCX; //X and Y set for middle points, so that the spiral searches from
      Y:=MSCY; //the middle of the screen outward
      I:=10    //number of pixels to add or subtract from search box
      Repeat
        If FindColorSpiral(x,y,123123,MSCX+I,MSCY-I,MSCX+I,MSCY-I) Then {Finds color inside of                         the the box, stats from a 10X10 square from the middle and gets larger each loop}
        GetMousePos(Chi,Ken)//Calls the coordinates chi,ken
        MMouse(Chi,Ken,4,4); //Moves to coordinates
        I:=I+10 //Adds 10 pixels to the search box, so search in a wider area if //chicken was not found
      Until(IsUpText('Ata') or I>150)// Repeats until find the text 'Att' at
                                     //top of screen or script has looped 15 times
    End;

  3. #3
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    SCAR Code:
    Procedure KillChicken;
    Begin
      X:=MSCX; //X and Y set for middle points, so that the spiral searches from
      Y:=MSCY; //the middle of the screen outward
      I:=10    //number of pixels to add or subtract from search box
      Repeat
        If FindColorSpiral(x,y,Color,MSCX+I,MSCY-I,MSCX+I,MSCY-I) Then {Finds color inside of                         the the box, stats from a 10X10 square from the middle and gets larger each loop}
        GetMousePos(Chi,Ken)//Calls the coordinates chi,ken
        MMouse(Chi,Ken,4,4); //Moves to coordinates
        I:=I+10 //Adds 10 pixels to the search box, so search in a wider area if //chicken was not found
      Until(IsUpText('Ata') or I>150)// Repeats until find the text 'Att' at
                                     //top of screen or script has looped 15 times
    End;
    Yeah! Can i use this system in my script ( it's my first script )? I'll later do my own system.

    But can i get it to click the chicken like this then?

    SCAR Code:
    Begin
      X:=MSCX; //X and Y set for middle points, so that the spiral searches from
      Y:=MSCY; //the middle of the screen outward
      I:=15    //number of pixels to add or subtract from search box
      Repeat
        If FindColorSpiral(x,y,123123,MSCX+I,MSCY-I,MSCX+I,MSCY-I) Then {Finds color inside of the the box, stats from a 10X10 square from the middle and gets larger each loop}
        GetMousePos(Chi,Ken)//Calls the coordinates chi,ken
        MMouse(Chi,Ken,4,4); //Moves to coordinates
        I:=I+5 //Adds 5 pixels to the search box, so search in a wider area if //chicken was not found
    if (I = 150 ) then
    X; //Exits the procedure, what's the command and is there one?
    else;
    Until(IsUpText('Ata') then
      Mouse(Chi,Ken,4,4,true); // And what's the 4,4?
    End;

  4. #4
    Join Date
    Jun 2006
    Location
    New Zealand
    Posts
    285
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes that should/will work.
    SCAR Code:
    Mouse(Chi,Ken,4,4,true); // And what's the 4,4?
    The 4, 4 is giving randomness to the click... I think its basically something like
    SCAR Code:
    x+random(4), y+random(4)
    Not sure though...
    Huehuehuehuehue

  5. #5
    Join Date
    Apr 2007
    Location
    Finland
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

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
  •