Results 1 to 10 of 10

Thread: FindRockColor

  1. #1
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default FindRockColor

    I'm using this autocolor function for DDTM walking in my latest script and it seems that it only works 50% of the time. During my walking procedure it will say "FindRockColor = 0" and then after doing the DDTM search again it will work fine and make the click. Other times it will fail completely...

    Anyone know what the problem with the function is? Autocoloring isn't my strong suit so I don't know if it would be easier to try to fix it or write a brand new autocolor function. Any ideas?
    METAL HEAD FOR LIFE!!!

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

    Default

    I have always had that trouble with findRockColor. I was told it was to do with SMART.
    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

  3. #3
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by noidea View Post
    I have always had that trouble with findRockColor. I was told it was to do with SMART.
    It does it without SMART as well :/

    It must be due to the updates because FindRoadColor doesnt work either.
    METAL HEAD FOR LIFE!!!

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

    Default

    Autocoloring is not what it used to be pre RuneTek5.
    All autocolorfunctions need fixing I think. Meanwhile you can just pick a color and use tolerance 10. If you have enough subpoints, it'll work just fine.

  5. #5
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by marpis View Post
    Autocoloring is not what it used to be pre RuneTek5.
    All autocolorfunctions need fixing I think. Meanwhile you can just pick a color and use tolerance 10. If you have enough subpoints, it'll work just fine.
    But how would that work when the Rock Color is dynamic? For example: if I log out for a break and log back in, the color usually is different and a tolerance of 10 won't be enough to find it.
    METAL HEAD FOR LIFE!!!

  6. #6
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Quote Originally Posted by gerauchert View Post
    But how would that work when the Rock Color is dynamic? For example: if I log out for a break and log back in, the color usually is different and a tolerance of 10 won't be enough to find it.
    Maybe try using AutoColorAid ( C:\Program Files\SCAR 3.21\Includes\SRL\Scripting Tools ) its in there.

  7. #7
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    That function is based on two adjacent pixels in the rock having a constant color relationship between them.
    Code:
    if FindMMColorsSpiralTolerance(P, 5591394, 80) then
    ...
    if (TestColor - GetColor(P[A].X + 1,P[A].Y) = 1250837) then
    So, there are two possibilities. Either the base color is more than 80 tolerance units away from the actual color half of the time, or the relationship between the two adjacent pixel colors is different half the time.

    The last time this function broke, it was the first problem. If you reload the client 5-10 times (to change the colors) and pick the colors of those two adjacent pixels, we could probably figure out what's wrong.


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

    Default

    Quote Originally Posted by marpis View Post
    Autocoloring is not what it used to be pre RuneTek5.
    All autocolorfunctions need fixing I think. Meanwhile you can just pick a color and use tolerance 10. If you have enough subpoints, it'll work just fine.
    I am proud to say my FindTreeColor still works It was made preRuneTek5
    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

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

    Default

    FindRockColor seems to work for me thats weird. Also, a simple TPA search does the same as an autocolor for the most part.

  10. #10
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    @Tara

    I looked into it and it was indeed the first problem. It searches with a tolerance of 80 but that isn't enough at times. The ratio between the adjacent pixels are still the same.

    Using color tolerance speed 2 I was able to make a stable function. If anyone wants to use it go ahead.

    SCAR Code:
    Function FindRockColor2: Integer;
    var
      TPA: TPointArray;
      i,CTS,c1,c2: Integer;
    begin
      if(not(LoggedIn))then Exit;
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(3.34,0.25);
      FindColorsSpiralTolerance(mmcx,mmcy,TPA,4605506,mmx1,mmy1,mmx2,mmy2,60);
      if(Length(TPA) = 0)then
      begin
        Writeln('Failed.');
        ColorToleranceSpeed(CTS);
        SetColorSpeed2Modifiers(0.20,0.20);
        Result := -1;
        Exit;
      end;
      for i := 0 to High(TPA) do
      begin
        c1 := GetColor(TPA[i].x,TPA[i].y);
        c2 := GetColor(TPA[i].x,TPA[i].y + 1);
       if((c1 - c2) = 1250837)then
       begin
         Result := c1;
         Exit;
       end;
      end;
      Writeln('RockColor finding failed.');
      Result := -1;
    end;

    @NoIdea

    The FindTreeColor is working awesome! I am also using it for my DDTMs in this script
    METAL HEAD FOR LIFE!!!

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
  •