Page 1 of 2 12 LastLast
Results 1 to 25 of 27

Thread: FindColor

  1. #1
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default FindColor

    I can't seem to find a function/procedure to check the presence of a certain color at a co-ordinate. If it color at 483, 261 = 8026754 then result := true.

    Is there a function/procedure to do this?

    If not has anybody made one?

    I really need one.

  2. #2
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Yep, GetColor.

  3. #3
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Oww, great. Ty. ^_^
    Can't seem to find it. What scar file is it located in?
    eidt2: my bad, seems to be simply GetColor(x, y). Easy.

  4. #4
    Join Date
    Jan 2007
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Description can be found in scar (not srl) help file:

    function GetColor(x, y: Integer): Integer;
    Return color number at x, y.
    so:
    SCAR Code:
    If (GetColor(483,261)=8026754) then result:=true;
    shud do the trick.

  5. #5
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    haha, Yeah I worked it out before that post, but thank you very much.

    It's so simple I feel like a nubby.

  6. #6
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Ya, you stupid nub . Kidding.

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  7. #7
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    lol, no you're not.

    /me cuts myself.

  8. #8
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Ya, to tell the truth, I really hate you and hope that you die, OK?

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  9. #9
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Roflcakes

    I Love You.

  10. #10
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Ok? I "Love" you too?

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  11. #11
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, now I've figured that im checking the colour at a certain pixel against another colour, but I want to check the colour against another colour with a certain tolerance (ie, of about 4).

    How would I do this?

    Help greatly appreciated.

  12. #12
    Join Date
    Jul 2007
    Location
    USA
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don'y get why you couldn't just use

    SCAR Code:
    if FindColorTolerance(483,261,8026754,msx1,msy1,msx2,msy2)then
    begin
      //the rest of your procedure
    end;

  13. #13
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I thought using getcolor would be easiest seeing as I thought the colour was static, but now I find out its not, therefore using findcolortol is probably the best idea. Thank you very much.

  14. #14
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Sp0rk-eh View Post
    Ok, now I've figured that im checking the colour at a certain pixel against another colour, but I want to check the colour against another colour with a certain tolerance (ie, of about 4).

    How would I do this?

    Help greatly appreciated.
    Do you mean SimilarColors....
    SCAR Code:
    if (SimilarColors(first, second, 4)) then  //4 is the tolerance.
    begin
      Result := True;
      writeln('yay');
    end;

    If the first colour and the second colour are within a tolerance of 4 then it will return true and write 'yay'.

  15. #15
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow, similar colours seems to work great =D ty.

  16. #16
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Your welcome.

  17. #17
    Join Date
    Jul 2007
    Location
    USA
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    FindColorTolerance will do the same thing except with less lines wont it?

  18. #18
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    FindColor finds the colour in a box whereas GetColor checks if the colour at that exact coordinate is equal to what you specify.

  19. #19
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    We should make a GetColorTolerance
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  20. #20
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by SantaClause View Post
    We should make a GetColorTolerance
    I was just thinking that.

  21. #21
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    lol, yeah that was the procedure I was looking for =P

    Similar colors does the same thing though.

  22. #22
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    What I meant was a GetColor but with a tolerance so that if the GetColor returned a colour that was not exactly the colour you wanted but within a certain tolerance it would still return true. But then again I think this works:

    SCAR Code:
    if (SimilarColors(GetColor(x, y), second colour, 10)) then
      Writeln('yay');

  23. #23
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    lol, that does work and thats what im using, I was saying getcolortol would be a very good idea.

  24. #24
    Join Date
    Jul 2007
    Location
    USA
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That is why FindColorTol would work better; because it only takes one line, yet does the same thing, and it has tolerance.

  25. #25
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    What? No it wouldnt, not if you are looking for it in a certain place, exact coords stuff.

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. No FindColor Response
    By demkidude in forum OSR Help
    Replies: 3
    Last Post: 01-22-2009, 03:25 AM
  2. [vb.net]my findcolor Function
    By SlashShot in forum C#/Visual Basic Help and Tutorials
    Replies: 3
    Last Post: 12-25-2007, 02:12 AM
  3. Need help with If not FindColor
    By philowns in forum OSR Help
    Replies: 3
    Last Post: 08-01-2007, 03:36 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
  •