Results 1 to 7 of 7

Thread: Advanced question, requires some skills :)

  1. #1
    Join Date
    Sep 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Advanced question, requires some skills :)

    Hello,

    Is there a way to to solve this in scar? I need to detect each object as shown on image and click on it. Every time the objects are with different shape and color so picking color over 100 times wouldn't be smart here. Something that could make the thing easier is that the background color is always white(16777215) and when i hover my mouse over any of the objects the cursor will change.

    a) Is it possible to detect mouse cursor change in scar?
    b) Is it possible to look for any color but white and store it's location to x,y coordinates, something like reverse function of regular Findcolor?



    Any help is appreciated, thanks!

  2. #2
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    1. I'm not sure about that:/.
    2. Use GetColorsBox.

  3. #3
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    1) yes search it

    2) yes getcolor(coord, coord) = what ever the color is


    if thats not what u wanted just send me a pm of msn me

  4. #4
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Some sort of flash game? If so tell us what you want to try and auto and we will be able to see the best ways of doing

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  5. #5
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by J_Pizzle View Post
    1) yes search it

    2) yes getcolor(coord, coord) = what ever the color is


    if thats not what u wanted just send me a pm of msn me
    it won't always be the same color, but the background is always white, so instead you could do getColor(xcoord, ycoord) <> white

  6. #6
    Join Date
    Sep 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Re:

    Thanks for help guys!
    Especially baked0420 who mentioned about getcolor!=16777215 because I just tried it out and it worked as I wanted

    I've been programming in scar occasionally for 2 years and howcome I didn't think of something THAT simple.

    Thanks again.

    Code:
    program New;
    var
    x,y:integer;
    begin
    repeat
    movemousesmooth(181+random(200),300+random(80));
    wait(300+random(300));
    getmousepos(x,y);
    until(not(getcolor(x,y)=(16777215)))
    writeln('found');
    end.
    Last edited by HannesR; 09-20-2009 at 05:37 PM. Reason: typo

  7. #7
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    FindColors(TPA, clWhite, 0, 0, 1000, 1000);
    ObjTPA := ReturnPointsNotInTPA(TPA, 0, 0, 1000, 1000);

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
  •