Results 1 to 9 of 9

Thread: Running though colours? Please help

  1. #1
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Running though colours? Please help

    First off thanks for all the help you guys have been giving me.
    So if you would be so kind enouth to help me again heres may problem its about scirpting so im not sure if this is the right area to post?

    Any way ive got a list of colours and i want to be able to run though them until one is found, so is there a quicker way then doing this?
    Simba Code:
    If find FindColorSpiralTolerance( a colour) then
    Begin
      Result := that color
      Exit;
    End;

    So am i doing the right thing or should i do it a diffrent way?

    By the way im trying to find a cow

    Thanks again for all the help

  2. #2
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Simba Code:
    procedure doColourThing;
    var
      Col : TIntegerArray;
      I : Integer;

    begin
      Col:= [Col1, Col2, etc];
      for I:= 0 to High(Col) do
      begin
        if FindColor(Col[I]) then
        begin
          WhatToDoWhenColourIsFound;
        end else
        begin
          WhatToDoWhenNoColourIsFound;
        end;
      end;
    end;
    Of course you can change FindColor into any colour finding function you want. FindColors functions are for TPAs.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  3. #3
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Perfect thanks so much rich

  4. #4
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    No problem. If you need any help, let me know. Forgot to say that you'll need SRL included to use that, as I use TIntegerArray.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

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

    Default

    SCAR Code:
    {*******************************************************************************
    function FindObjTPAMulti(var X, Y: integer; Color: TIntegerArray; Tol, CTS, ObjWidth, ObjHeight, minCount :Integer; UpText: TStringArray): Boolean;
    By: Torrent of Flame based on FindObjTPA
    Description: This is a modification of FindObjTPA, which uses a TIntegerArray for the Colors.
    Date: 29th August 2009
    *******************************************************************************}

  6. #6
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Naum View Post
    SCAR Code:
    {*******************************************************************************
    function FindObjTPAMulti(var X, Y: integer; Color: TIntegerArray; Tol, CTS, ObjWidth, ObjHeight, minCount :Integer; UpText: TStringArray): Boolean;
    By: Torrent of Flame based on FindObjTPA
    Description: This is a modification of FindObjTPA, which uses a TIntegerArray for the Colors.
    Date: 29th August 2009
    *******************************************************************************}
    Umm thanks but what is the width height mincount? how do i find them out?

    Thanks

  7. #7
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    "Width" is the approximate width of the object your searching for, same as height.

    Mincount represents the minimum amount of occurrences of the color that your searching for.

  8. #8
    Join Date
    Oct 2010
    Location
    Under a bridge
    Posts
    648
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So would it work for cows as they are always moving and each have diffrent colours?

  9. #9
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Sure would. Just gather the most unique colors the you can find that the cows have, and use a bit of tolerance and you should be all set.

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
  •