Results 1 to 11 of 11

Thread: Detect where not to move mouse.

  1. #1
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default Detect where not to move mouse.

    Is there anyway to detect a color/bitmap/dtm/text, and saves the mouse's general location in an array after that detect. That saved data would be places to not look for the color/bitmap/dtm/text when initiating findcolor, etc.

    Is this possible?

  2. #2
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Huh? Explain more clearly please .

  3. #3
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Try the skipbox functions in srl.
    ~Hermen

  4. #4
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    erm, can't find it.

  5. #5
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    MrPickle, please explain more clearly :<. Then I can help you.

  6. #6
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, if I understand what you are asking correctly, you would have to save all the bad points to an array like this (Some of the actual stuff in this code may be wrong, but the concept should work.):

    SCAR Code:
    var
      B: TBoxArray;
      x,y: Integer;
    begin
      B[0].x1 := BadXPoint - 10;//these four lines create a 20 by 20 square
      B[0].y1 := BadYPoint - 10;//around the bad point you do not want to
      B[0].x2 := BadXPoint + 10;//search, the bad point being the center of
      B[0].y2 := BadYPoint + 10;//the square

      B[1].x1 := BadXPoint2 - 10; //same for another box.
      B[1].y1 := BadYPoint2 - 10;
      B[1].x2 := BadXPoint2 + 10;
      B[1].y2 := BadYPoint2 + 10;

      if(FindColorSkipBoxArray(x,y,color,MSX1,MSY1,MSX2,MSY2,B))then
        //...whatever
    end;


    Make sense? So you create boxes around the bad points you find, and then FindColorSkipBoxArray does not search the TBox's in the array.

    Hope this helps.
    Last edited by JAD; 06-04-2009 at 05:47 AM.

  7. #7
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    function FindColorSkipBox(var x, y: Integer; color, x1, y1, x2, y2: Integer; SkipBox: TBox): Boolean;
    Finds a color in an area specified by x1, y1, x2 and y2, while skipping the area specified by the TBox, SkipBox.

    If you'd be using a non-spiral findcolor function, the dot in the green area would be found first, but since it is in the green area which is the part where the skipbox overlaps the search area, it will ignore it, so the other dot will be found.

    SCAR Code:
    function FindColorSkipBoxTolerance(var x, y: Integer; color, x1, y1, x2, y2, Tolerance: Integer; SkipBox: TBox): Boolean;
    Works like the regular FindColorSkipBox function but with a tolerance parameter for finding any similar color. Tolerance is used to find a color in range of the color you are looking for. The greater color range you want, the higher the tolerance parameter should be.

    SCAR Code:
    function FindColorSkipBoxArray(var x, y: Integer; color, x1, y1, x2, y2: Integer; SkipBoxes: TBoxArray): Boolean;
    Finds a color in an area specified by x1, y1, x2 and y2, while skipping the areas specified by the TBoxArray, SkipBoxes.

    SCAR Code:
    function FindColorSkipBoxArrayTolerance(var x, y: Integer; color, x1, y1, x2, y2, Tolerance: Integer; SkipBoxes: TBoxArray): Boolean;
    Works like the regular FindColorSkipBoxArray function but with a tolerance parameter for finding any similar color. Tolerance is used to find a color in range of the color you are looking for. The greater color range you want, the higher the tolerance parameter should be.

    SCAR Code:
    function FindColorSkipCoords(var x, y: Integer; color, x1, y1, x2, y2: Integer; SkipCoords: TPointArray): Boolean;
    Finds a color in an area specified by x1, y1, x2 and y2, while skipping the coordinates specified by SkipCoords.

    SCAR Code:
    function FindColorSkipCoordsTolerance(var x, y: Integer; color, x1, y1, x2, y2, Tolerance: Integer; SkipCoords: TPointArray): Boolean;
    Works like the regular FindColorSkipCoords function but with a tolerance parameter for finding any similar color. Tolerance is used to find a color in range of the color you are looking for. The greater color range you want, the higher the tolerance parameter should be.

  8. #8
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    ah. this wasn't in the srl manual , but is what I am looking for =).

  9. #9
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  10. #10
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    oh lolz. I looked at other manual xD
    SRL Library Version 4
    Manual .

  11. #11
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 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
  •