Results 1 to 6 of 6

Thread: ACA help

  1. #1
    Join Date
    Dec 2013
    Location
    In a house
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default ACA help

    I'm trying to use the AutoColor function made by ACA, but it seems that many of the functions and variables used in it are outdated. I already changed a few things, and I still can't get it to work.

    So my question is, is there a newer version of ACA or an easy way to update the function from it? If not, what should I use instead?

    Don't really care about the FindObject function it makes, and have no idea what FindColorRecord or FindObjRecord are , I just want the AutoColor one.

    Thanks


    Edit: forgot to mention this is for a RS3 script, so it's using srl-6
    Last edited by RSrevenge; 12-07-2013 at 02:35 PM.

  2. #2
    Join Date
    Jul 2012
    Posts
    437
    Mentioned
    10 Post(s)
    Quoted
    165 Post(s)

    Default

    Quote Originally Posted by RSrevenge View Post
    I'm trying to use the AutoColor function made by ACA, but it seems that many of the functions and variables used in it are outdated. I already changed a few things, and I still can't get it to work.

    So my question is, is there a newer version of ACA or an easy way to update the function from it? If not, what should I use instead?

    Don't really care about the FindObject function it makes, and have no idea what FindColorRecord or FindObjRecord are , I just want the AutoColor one.

    Thanks


    Edit: forgot to mention this is for a RS3 script, so it's using srl-6
    newest aca remake by cynic http://villavu.com/forum/showthread.php?t=98368

    the old versions should still work, if you still need help try posting the function/script and I can help you modify it

  3. #3
    Join Date
    Dec 2013
    Location
    In a house
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Thank you, that's exactly what I was looking for. Still had to modify a few things to get it to compile, but I got it to.

    My problem now is that it doesn't find the color. I noticed that if I click "mark color" it doesn't find anything in ACA, but if I click "mark best color" it highlights a bunch of stuff, so how do I make the script find the best color?

    I'm just using the basic .findObject() function for now. Mostly trying to get the feel for everything, I'm still a mega noob at this.

    Here's the code, all I want it to do is find the tree and click it. I also commented what I changed in the function that ACA created, so if I did anything wrong please let me know

    Simba Code:
    {$i srl-6/srl.simba}

    var
      x, y: integer;

    function  tree : Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      H, S, L: Extended;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetToleranceSpeed();  //changed from GetColorToleranceSpeed
      SetColorToleranceSpeed(3);      //changed from ColorToleranceSpeed(3)
      SetToleranceSpeed3Modifier(1);  //changed from SetColorSpeed3Modifier(1)

      //changed the x/y coords to mainscreen.x1/2 and mainscreen.y1/2
      FindColorsSpiralTolerance(720, 450, arP, 2636876, mainscreen.x1, mainscreen.y1, mainscreen.x2, mainscreen.y2, 10);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result.');
        SetColorToleranceSpeed(tmpCTS);  //changed from ColorToleranceSpeed(tmpCTS)
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        ColorToHSL(arC[i], H, S, L);

        if (H >= 8.80) and (H <= 9.64) and (S >= 30.75) and (S <= 31.77) and (L >= 16.06) and (L <= 29.82) then
        begin
          ColorToXYZ(arC[i], X, Y, Z);

          if (X >= 2.57) and (X <= 8.62) and (Y >= 2.58) and (Y <= 8.43) and (Z >= 1.44) and (Z <= 4.44) then
          begin
            Result := arC[i];
            Writeln('AutoColor = ' + IntToStr(arC[i]));
            Break;
          end;
        end;
      end;

      SetColorToleranceSpeed(tmpCTS);  //changed from ColorToleranceSpeed(tmpCTS)

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;

    begin
      if (mainscreen.findObject(x, y, tree, 10, ['Tree'])) then
        writeln('Clicked object!');
    end.

    Here's the debug info after running the script
    Simba Code:
    Compiled successfully in 3000 ms.
    Failed to find the color, no result.
    -- TRSMainscreen.findObject()
    ---- No colors found
    -- TRSMainscreen.findObject(): False
    -- Freeing the minimap mask
    Successfully executed.

  4. #4
    Join Date
    Oct 2013
    Location
    East Coast USA
    Posts
    770
    Mentioned
    61 Post(s)
    Quoted
    364 Post(s)

    Default

    I can't make any sense of what those autogenerated functions are supposed to be doing. Someone else will have to tell us what the intention is. It seems like it's trying to turn the results of a CTS1/2/3 search into a simpler color.

    There's no need to use them though. You can take the best color info from ACA and use that as the parameters to findObject.

    For example, a CTS 2 best color can be used something like this:

    mainscreen.findObject(x, y, BESTCOLOR, TOLERANCE, colorSetting(2, HUE, SAT), mainscreen.getCenterPoint(), WIDTH, HIEGHT, COUNT, [UPTEXT], MOUSE_RIGHT)

  5. #5
    Join Date
    Jun 2013
    Posts
    147
    Mentioned
    2 Post(s)
    Quoted
    41 Post(s)

    Default

    Quote Originally Posted by bonsai View Post
    I can't make any sense of what those autogenerated functions are supposed to be doing. Someone else will have to tell us what the intention is. It seems like it's trying to turn the results of a CTS1/2/3 search into a simpler color.

    There's no need to use them though. You can take the best color info from ACA and use that as the parameters to findObject.


    For example, a CTS 2 best color can be used something like this:

    mainscreen.findObject(x, y, BESTCOLOR, TOLERANCE, colorSetting(2, HUE, SAT), mainscreen.getCenterPoint(), WIDTH, HIEGHT, COUNT, [UPTEXT], MOUSE_RIGHT)
    I've used it a couple of times as just one big if FindColor then function. You can just edit the line where it says Writeln('clicked object!') to whatever you want to do with what it gives you, so you could(at least with the ACA version before this) find the variable where it stores the coordinates of the found color and change the Writeln to a click.

  6. #6
    Join Date
    Dec 2013
    Location
    In a house
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by bonsai View Post
    I can't make any sense of what those autogenerated functions are supposed to be doing. Someone else will have to tell us what the intention is. It seems like it's trying to turn the results of a CTS1/2/3 search into a simpler color.

    There's no need to use them though. You can take the best color info from ACA and use that as the parameters to findObject.

    For example, a CTS 2 best color can be used something like this:

    mainscreen.findObject(x, y, BESTCOLOR, TOLERANCE, colorSetting(2, HUE, SAT), mainscreen.getCenterPoint(), WIDTH, HIEGHT, COUNT, [UPTEXT], MOUSE_RIGHT)
    Lol no worries. I'll just have to play around with it until I figure it out. I've been reading tuts like crazy and starting to get a basic understanding of it. I'll definitely try just using findObject with the best color for now.

    Quote Originally Posted by koryperson View Post
    I've used it a couple of times as just one big if FindColor then function. You can just edit the line where it says Writeln('clicked object!') to whatever you want to do with what it gives you, so you could(at least with the ACA version before this) find the variable where it stores the coordinates of the found color and change the Writeln to a click.
    That's a good idea too. I'll play around with those functions a bit more after I figure out what they're doing

    I think I really just need to read up on how the color finding stuff works, I found a tut on CTS so that will hopefully help too.

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
  •