Results 1 to 8 of 8

Thread: FindTreeColor Fixed

  1. #1
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default FindTreeColor Fixed

    SCAR Code:
    function FindTreeColor: Integer;
    var
      TPA, TestTPA: TPointArray;
      ATPA: T2DPointArray;
      H, S, L: Extended;
      I, R, G, B, Hi, TestColor, blkListHi: Integer;
      TreeColorsBlackList: TIntegerArray;


    begin
      if FindMMColorsSpiralTolerance(TPA, 1730099, 70) then
      begin
        Hi := High(TPA);
        For I := 0 to Hi do
        begin
          TestColor := GetColor(TPA[i].x, TPA[i].y);
          if not InIntArray(TreeColorsBlackList, TestColor) then
          begin
            ColorToRGB(TestColor, R, G, B);
            ColorToHSL(TestColor, H, S, L);
            if InRange(R - B, -10, 50) then
              if InRange(R - G, -75, -30) then
                if InRange(G - B, 50, 88) then
                  if (L < 31.5) then
                    if (GetColor(TPA[i].x - 1, TPA[i].y) = TestColor) then
                      if (GetColor(TPA[i].x, TPA[i].y + 1) = TestColor) then
                        if (GetColor(TPA[i].x, TPA[i].y - 1) = TestColor) then
                          if FindMMColorsSpiralTolerance(testTPA, TestColor, 0) then
                          begin
                            ATPA := TPAtoATPAEx(TestTPA, 11, 10);
                            if (not InRange(Length(ATPA[0]), 21, 28)) then
                              if (Length(ATPA[0]) < 30) then
                                if (not InRange(Length(ATPA[0]), 8, 10)) then
                                begin
                                  srl_Warn('FindTreeColor', 'TreeColor = ' + IntToStr(TestColor), warn_Debug);
                                  Result := TestColor;
                                  Exit;
                                end else
                                  if (L > 24) then
                                  begin
                                    blkListHi := High(TreeColorsBlackList);
                                    SetLength(TreeColorsBlackList, blkListHi + 2);
                                    TreeColorsBlackList[blkListHi + 1] := TestColor;
                                  end;
                          end;
          end;
        end;
      end;
      srl_Warn('FindTreeColor', 'Could''t find TreeColor', warn_Debug);
      Result := -1;
    end;
    Last edited by Dynamite; 01-24-2010 at 01:18 PM.

  2. #2
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    FindColorsSpiralTolerance with only 3 params? Am I missing something?

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  3. #3
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Oh sorry, editing now.

    EDIT: Done, I was testing something and forgot to change back.,

  4. #4
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    What was wrong
    show the diff
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  5. #5
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    I just changed the color a bit, it is more accurate now AFAIK

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

    Default

    Quote Originally Posted by The Man View Post
    I just changed the color a bit, it is more accurate now AFAIK
    FindTreeColor worked epic before, I haven't had it fail for me, yet :-/.
    (Its the only autocolor I mainly use for walking :3).

  7. #7
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The Man, you've been fixing working autocolors?
    “Ignorance, the root and the stem of every evil.”

  8. #8
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Nope. the old one still works. Same for FindRockColor.
    Check your colour settings.

    Quote Originally Posted by Naum View Post
    FindTreeColor worked epic before, I haven't had it fail for me, yet :-/.
    (Its the only autocolor I mainly use for walking :3).
    <3

    edit: Err.. It still works fine. (btw, took this pic a few days ago, just forgot to up it)

    see how its ignoring the little pine tree thing ^_^ Still works as good as before.
    Last edited by noidea; 01-25-2010 at 10:30 PM.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

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
  •