Results 1 to 4 of 4

Thread: easier way to set x,y?

  1. #1
    Join Date
    Aug 2007
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default easier way to set x,y?

    is there an way to set scar to look for an irregular box?
    I have a picture as an attachment.

    The outline in red is where I want to search....
    The green is what I have it set up searching using this....

    SCAR Code:
    procedure Look;
     begin
      repeat
       KeyDown(VK_LEFT)
       Wait(800+random(150));
       KeyUp(VK_LEFT);
       wait(5000+random(1000))
       FindColorTolerance(x, y, color1, 141, 1, 606, 381,10)
       Mouse(x,y,4,4,false)
       FindColorTolerance(x, y, color2, 141, 1, 606, 381,10)
       Mouse(x,y,4,4,false)
       FindColorTolerance(x, y, color3, 141, 1, 606, 381,10)
       Mouse(x,y,4,4,false)
       FindColorTolerance(x, y, color4, 141, 1, 606, 381,10)
       Mouse(x,y,4,4,false)
       FindColorTolerance(x, y, color5, 141, 1, 606, 381,10)
       Mouse(x,y,4,4,false)
       FindColorTolerance(x, y, color1, 4, 100, 615, 361,10)
       Mouse(x,y,4,4,false)
       FindColorTolerance(x, y, color2, 4, 100, 615, 361,10)
       Mouse(x,y,4,4,false)
       FindColorTolerance(x, y, color3, 4, 100, 615, 361,10)
       Mouse(x,y,4,4,false)
       FindColorTolerance(x, y, color4, 4, 100, 615, 361,10)
       Mouse(x,y,4,4,false)
       FindColorTolerance(x, y, color5, 4, 100, 615, 361,10)
       Mouse(x,y,4,4,false)
       FindColorTolerance(x, y, color1, 335, 183, 796, 550,10)
       Mouse(x,y,4,4,false)
       FindColorTolerance(x, y, color2, 335, 183, 796, 550,10)
       Mouse(x,y,4,4,false)
       FindColorTolerance(x, y, color3, 335, 183, 796, 550,10)
       Mouse(x,y,4,4,false)
       FindColorTolerance(x, y, color4, 335, 183, 796, 550,10)
       Mouse(x,y,4,4,false)
       FindColorTolerance(x, y, color5, 335, 183, 796, 550,10)
       Mouse(x,y,4,4,false)
      until(FindColorTolerance(x, y, 4360959, 342, 28, 342, 28, 10))
     end;

    I hope theres another way

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

  3. #3
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    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.

    Put in x1, y1, x2, y2 to cover the entire screen then make as many TBox's as needed to remove areas you don't want. a TBox is a record that has 4 variables - x1,y1,x2,y2 which is just 2 points needed that it transforms into a box and will then skip with the function. Best of all, just make it a global TBox array and as long as you use FindColorSkipBoxArray (also one with tolerance - just add Tolerance onto the end) it will always skip those areas. Only 4 TBox's should be needed, so just make an array spanning from 0..3 and fill them in as needed.
    Edit: Shuttleu = fail
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  4. #4
    Join Date
    Aug 2007
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks a lot!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Making Science Easier
    By Distort in forum News and General
    Replies: 0
    Last Post: 08-29-2007, 10:44 PM
  2. easier way to do this?
    By dvdcrayola in forum OSR Help
    Replies: 4
    Last Post: 08-26-2007, 12:56 AM
  3. This post need help but is easier one!!!!i know
    By alfonso1024 in forum OSR Help
    Replies: 6
    Last Post: 08-04-2007, 07:39 PM

Posting Permissions

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