Results 1 to 10 of 10

Thread: Rock colors help for powerminer

  1. #1
    Join Date
    Dec 2012
    Posts
    115
    Mentioned
    0 Post(s)
    Quoted
    25 Post(s)

    Default Rock colors help for powerminer

    I am making a power miner script for Rs07, but my rock colors aren't working out very well. I've tried many variations on the rock colors for tin but my colorfinder function is still have a lot of problems finding the darn rock. Usually finds anything white, or tin ore thats been mined already and dropped on the floor


    Here is my code:

    Simba Code:
    program new;
    {$I SRL/SRL.Simba}
    {$I P07Include.Simba}
    var
    x,y,tin,drop:integer;
    const

      hue_ore = 0.70;
      sat_ore = 0.33;
    Procedure P07_DeclarePlayer;
    Begin
      P07_PlayerName:='';
      P07_PlayerPass:='';
    End;
    Function Moving: Boolean;
    var
      MovingBox: Tbox;
    begin
      MovingBox   := IntToBox(232, 146, 291, 191);
      Result := (AveragePixelShift(MovingBox, 200, 400) > 70);
       Writeln(IntToStr(AveragePixelShift(MovingBox, 250, 500)));
    end;
    //This is my rock color finder function:

    Function Clickrock:boolean;
             var


        TPA : TpointArray;
      ATPA : T2DPointArray;

      i, l, xas, yas,tmpCTS : integer;
      begin
      tmpCTS := GetToleranceSpeed;
      SetColorToleranceSpeed(2);

      SetToleranceSpeed2Modifiers(hue_ore, sat_ore);
      FindColorsTolerance(TPA, 8421514, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 5);
      SplitTPAWrap(TPA, 10, ATPA);

      SortATPAFromFirstPoint(ATPA, Point(MSCX,MSCY));
      SetColorToleranceSpeed(tmpCTS);
      SetToleranceSpeed2Modifiers(0.02, 0.02);
        if Length(TPA) > 0 then
          begin
            SortTPAFrom(TPA, Point(P07_MSCX, P07_MSCY));
          ATPA := TPAToATPAEx(TPA, 17, 10);
         L := High(ATPA)
        for i := 0 to L do
        if Length(ATPA[i]) > 0 then
     begin
       MiddleTPAEx(ATPA[i], xas, yas);
         MMouse(xas, yas, 3, 3);
          Wait(randomrange(50,500));
          if P07_IsUpTextMultiCustom(['ine']) then
          begin
              clickmouse2(mouse_left);
          end;
           result := true;
                exit;
          end;
       end;
    end;
    //end of color function.
    Procedure DropOres;
    Begin
      If (Not P07_LoggedIn) Then
      Begin
        P07_LogInPlayer;
      End;
        P07_DropAll;
    End;

    procedure lookandmine;
    begin
    If (Not P07_LoggedIn) Then
      Begin
        P07_LogInPlayer;
      End;
    if P07_InvFull then
    begin
     writeln('we are full bra');
     dropores;
    end;
    clickrock;

    end;
    begin
      P07_DeclarePlayer;
      SetupP07Include;
      MouseSpeed := 15;
      ActivateClient;
    repeat
    lookandmine;
    until (IsKeyDown(114));
    end.


    Is there anything im doing wrong in the function? or have i just not found a specific enough color?

    Any help will be greatly appreciated

    thanks,

    Mcbain.

  2. #2
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Use ACA.

  3. #3
    Join Date
    Dec 2012
    Posts
    115
    Mentioned
    0 Post(s)
    Quoted
    25 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    Use ACA.
    All the colors i use have been found from ACA, maybe ill actually use the ACA function maker and see if that makes a difference.

  4. #4
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by mcbain View Post
    All the colors i use have been found from ACA, maybe ill actually use the ACA function maker and see if that makes a difference.
    Did you use the tolerance that ACA gave you?

  5. #5
    Join Date
    Dec 2012
    Posts
    115
    Mentioned
    0 Post(s)
    Quoted
    25 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    Did you use the tolerance that ACA gave you?
    Ohhhh son of a gun..I did not haha! there lies the error i'm sure, i was fairly confident that my function wasn't the problem

  6. #6
    Join Date
    Feb 2013
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    10 Post(s)

    Default

    What is this ACA?

  7. #7
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Nations_collapse View Post
    What is this ACA?
    AutoColorAid

    Creds to DannyRS for this wonderful sig!

  8. #8
    Join Date
    Oct 2012
    Location
    Porto, Portugal
    Posts
    218
    Mentioned
    0 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Nations_collapse View Post
    What is this ACA?
    It is a tool that helps you find colors more accurately. You should always use it when the color you want to find looks like other things in the background.

    Link: http://villavu.com/forum/showthread....t=autocoloraid
    Last edited by Sax; 02-24-2013 at 11:46 AM. Reason: added link

  9. #9
    Join Date
    Oct 2012
    Posts
    758
    Mentioned
    6 Post(s)
    Quoted
    282 Post(s)

    Default

    SplitTPAWrap(TPA, 10, ATPA); << Why?

    By the way, your tolerance is very low and I don't recommend using the ACA tolerance value. Try using it as a guideline if anything and see how that works.

  10. #10
    Join Date
    Oct 2012
    Location
    Porto, Portugal
    Posts
    218
    Mentioned
    0 Post(s)
    Quoted
    42 Post(s)

    Default

    I have a private iron miner but it is for EOC RuneScape and it is working fine. If you want to take a look at my code, PM me.

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
  •