Results 1 to 11 of 11

Thread: Autocolor

  1. #1
    Join Date
    Feb 2010
    Location
    England
    Posts
    56
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Autocolor

    Hello again,

    so today I've been experimenting with some more SCAR/SRL procedure/functions and have come to a little problem.

    I'm wanting to use RadialWalk to navigate throughout Lumby Castle; the first time I pick the color and execute the function it works great, but after that it doesn't (the colors must be dynamic and not static)

    So I've come looking in hope for some autocolor help (because I don't know where to begin)

    I've looked through AutoColor.scar and could find FindFallyRoadColor, FindLumbyRoadColor etc, but no mention of Lumbridge castle.

    help would be greatly appreciated!

    SCAR Code:
    program CookChickens;
    {.include SRL/SRL.scar}

    var
      i, x, y: Integer;
      colors: TPointArray;

    begin
      SetupSRL;
      MakeCompass('S');
     
      RadialWalk(8816269, 10, 0, 52, 2, 2);
      FFlag(0);
     
      FindColorsSpiralTolerance(x, y, colors, 3225920, MSX1, MSY1, MSX2, MSY2, 0);
     
      for i := 0 to High(colors) do
      begin
        MMouse(colors[i].x, colors[i].y, 3, 3);
       
        if IsUpText('air') then
        begin
          GetMousePos(x, y);
          Mouse(x, y, 0, 0, true);
          break;
        end;
      end;
     
      Wait(750 + Random(500));
      Mouse(x, y, 0, 0, false);
      ChooseOption('own');
    end.

    (does not have failsafe for RadialWalk etc atm, but will get around to that)

    void_hatred.

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    ACA Is the thing you want

    SRL/Scripting Tools/Auto Color Aid v2.exe

    I would explain more but i have to go now, maybe some1 else will take over.
    There used to be something meaningful here.

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

    Default

    I'm 100% sure the lumbridge castle uses findLumbyRoadColor or one of the colour finders in there
    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

  4. #4
    Join Date
    Feb 2010
    Location
    England
    Posts
    56
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    noidea, thanks for the post; however FindLumbyRoadColor doesn't appear to work for me (I've tried different tolerances, e.g. 1, 6, 10 but it still didn't work

    void_hatred

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

    Default

    Quote Originally Posted by void_hatred View Post
    noidea, thanks for the post; however FindLumbyRoadColor doesn't appear to work for me (I've tried different tolerances, e.g. 1, 6, 10 but it still didn't work

    void_hatred
    most autocolors in SRL are broken atm. I could toss a few different autocolor type functions i've made if you would like, just let me know
    “Ignorance, the root and the stem of every evil.”

  6. #6
    Join Date
    Feb 2010
    Location
    England
    Posts
    56
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    blumblebee that would be amazing! I could study the code to try and develop a deeper understanding

    I wish I could attempt to make my own, but I'm a noob at the moment

    void_hatred

  7. #7
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    The best method to understand how autocoloring works is to open ACA found in Scripting Tools/ and designing one yourself

  8. #8
    Join Date
    Feb 2010
    Location
    England
    Posts
    56
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Zyt3x thanks again, Frement also recommended ACA. I have searched but cannot find any tutorials on ACA, so I am not entirely sure how to use correctly.

    it appears that I am posting a lot, and so some may think that I am spamming (I hope not), so could someone possibly assist me on an instant messenger, e.g. MSN? thank you.

    void.hatred@hotmail.com

    thanks a bunch,
    void_hatred

  9. #9
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by void_hatred View Post
    Zyt3x thanks again, Frement also recommended ACA. I have searched but cannot find any tutorials on ACA, so I am not entirely sure how to use correctly.

    it appears that I am posting a lot, and so some may think that I am spamming (I hope not), so could someone possibly assist me on an instant messenger, e.g. MSN? thank you.

    void.hatred@hotmail.com

    thanks a bunch,
    void_hatred
    I have you added, but you're not online

  10. #10
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

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

    Default

    Quote Originally Posted by void_hatred View Post
    blumblebee that would be amazing! I could study the code to try and develop a deeper understanding

    I wish I could attempt to make my own, but I'm a noob at the moment

    void_hatred
    SCAR Code:
    Procedure SortColors(var Colors: tIntegerArray; col: Integer);
    var
      tempB: tIntegerArray;
      Tol: ShortInt;
      I: Integer;
      timer, L: LongInt;
    begin
      timer := getsystemtime;
      tempB := Colors;
      SetArrayLength(Colors, 0);
      Tol := 0;
      while Length(Colors) < (Length(tempB)/2 or 5) do
      begin
        if Getsystemtime-timer > 100 then Break;
        for i := 0 to High(tempB) do
        begin
          if SimilarColors(tempB[i], col, Tol) then
          begin
            L := GetArrayLength(Colors);
            SetArrayLength(Colors, L+1);
            Colors[L] := tempB[i];
          end;
          if Tol > 10 then Break;
          Inc(Tol);
        end;
      end;
      // WriteLn('Sort took : '+IntToStr(getsystemtime-timer)+' ms');
    end;

    Function AutoColorMM(const color: Integer): Integer;
    var
      TPA: tPointArray;
      List: tIntegerArray;
      I: Integer;
    begin
      for i := 0 to 15 do
      begin
        FindColorsTolerance(TPA, color, MMx1, MMy1, MMx2, MMy2, 10+i);
        if Length(TPA) > 0 then Break;
      end;
      if Length(TPA) <= 0 then Exit;
      List := getColors(TPA);
      sortColors(List, color);
      if Length(List) <= 0 then Exit;
      result := List[0];
    end;

    used like:

    SCAR Code:
    const
      MM_COLOR_white = 15267825;

    begin
      AutoColor := AutoColorMM(MM_COLOR_white);
      debug('AutoColor = '+IntToStr(AutoColor));
    end.

    you can mess with the syntax to allow custom tolerances and ranges, but I found that a basic range from 10-25 always works for me nicely.

    I autocolour funny compared to other people, but it works for me so I use it
    “Ignorance, the root and the stem of every evil.”

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
  •