Results 1 to 17 of 17

Thread: Finding Minimap mine rock color...

  1. #1
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Finding Minimap mine rock color...

    Hey guys, I'm trying to get an autocolor for a mineable rock on the minimap. The function that is supposed to do that is FindStoneColor; but it doesnt work. How do I autocolor it then? I don't want my users to have to go and pick colors every time. Thanks for your help =]

  2. #2
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The fix by king vash:
    SCAR Code:
    function FindRockColor: Integer;
    var
      GC, a, l, TestColor: integer;
    var
      P:array of Tpoint;
    begin
      GC := 6444639;
      Flag;
      FindColorsSpiralTolerance(MMCX,MMCY, P, GC, MMX1,MMY1,MMX2,MMY2, 75);
      l:=GetArrayLength(P);
      for a:= 0 to l-1 do
      begin
        TestColor := GetColor(P[a].x,P[a].y);
        if (GetColor(P[a].x-1,P[a].y)=TestColor-723980) then
        begin
          Result := TestColor;
          WriteLn('Rock Color = ' + IntToStr(TestColor));
          Exit;
        end;
      end;
      WriteLn('Could not find Rock Color!');
      Result := 0;
    end;


  3. #3
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Im not looking for rock color, I'm looking for stone color. :P Rock is the gray rock on the minimap and stone is the mineable rocks

  4. #4
    Join Date
    Aug 2007
    Location
    Georgia, U.S.
    Posts
    890
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    im pretty sure that there is a FindStoneColor in SRL.

  5. #5
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The[Cheese] View Post
    The function that is supposed to do that is FindStoneColor; but it doesnt work.


    I guess the better question would be how do I fix the FindStoneColor in srl? BTW I'm using the rocks in VEM for this.

  6. #6
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    TRy ACA 2 by nielsie and sumilion
    ~Hermen

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

    Default

    Each rock and stone has one large blob of uniform color on it. That's the color found by FindRockColor and FindStoneColor when they work.

    To fix FindStoneColor, all you need to do is pick the StoneColor (the blob of uniform color). Then pick the darker color immediately to the left of that StoneColor blob. Then plug them into your calculator and find out what the difference is between those two colors you picked. Plug that number into FindStoneColor where the other number is, (Testcolor-xxxxx) and it will work.

    If someone wants to post the correct comparison values for FRC and FSC, I'll make sure the current Dev version is updated.


  8. #8
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    K one sec, I'll try that right now. To clarify, you mean pick the lightest color on the rock then click the darker one on the same rock?

  9. #9
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well I tried to plug in those 2 numbers. IDK if i plugged them in the right place. Heres what I put:

    SCAR Code:
    function FindStoneColor: Integer;
    var
      GC, a, l, TestColor: integer;
    var
      P:array of Tpoint;
    begin
      GC := 789772;///////////////HERE
      Flag;
      FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1,MMY1,MMX2,MMY2, 60);
      l:=GetArrayLength(P);
      for a:= 0 to l-1 do
      begin
        TestColor := GetColor(P[a].x,P[a].y);
        if (GetColor(P[a].x-1,P[a].y)=TestColor-461068) then////HERE
        begin
          Result := TestColor;
          WriteLn('Stone Color = ' + IntToStr(TestColor));
          Exit;
        end;
      end;
      WriteLn('Could not find Stone Color!');
      Result := 0;
    end;

    Anyway when I tried these it still didnt find the color.

  10. #10
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This Work?

    SCAR Code:
    Function TFindMMStoneColor: Integer;

    Var
      R, G, B, I,
      TestColor: Integer;
      H, S, L, X,
      Y, Z: Extended;
      TPA: TPointArray;

    Begin
      FindColorsTolerance(TPA, 789772, MMX1, MMY1, MMX2, MMY2, 80);
      For I := 0 To High(TPA) Do
        If rs_OnMiniMap(TPA[I].X, TPA[I].Y) Then
        Begin
          TestColor := GetColor(TPA[I].X, TPA[I].Y);
          If SimilarColors(TestColor, 789772, 50) Then
          Begin
            ColortoHSL(TestColor, H, S, L);
            ColortoRGB(TestColor, R, G, B);
            ColortoXYZ(TestColor, X, Y, Z);
            If InRange(R - G, -21, 19) Then
              If InRange(R - B, -20, 20) Then
                If InRange(Round(X) - Round(Y), -15, 15) Then
                  If InRange(Round(X) - Round(Z), -15, 15) Then
                    If InRange(Round(H) - Round(S), 22, 36) Then
                      If InRange(Round(H) - Round(L), 21, 35) Then
                      Begin
                        WriteLn('MM Stone Color = ' + IntToStr(TestColor));
                        Result := TestColor;
                        Exit;
                      End;
          End;
        End;
      WriteLn('Couldn''t Find MM Stone Color!');
    End;

    If Gets The Color Too Soon, Try This One...

    SCAR Code:
    Function TFindMMStoneColor: Integer;

    Var
      R, G, B, I,
      TestColor: Integer;
      H, S, L, X,
      Y, Z: Extended;
      TPA: TPointArray;

    Begin
      FindColorsTolerance(TPA, 928089, MMX1, MMY1, MMX2, MMY2, 80);
      For I := 0 To High(TPA) Do
        If rs_OnMiniMap(TPA[I].X, TPA[I].Y) Then
        Begin
          TestColor := GetColor(TPA[I].X, TPA[I].Y);
          If SimilarColors(TestColor, 928089, 50) Then
          Begin
            If ((GetColor(TPA[I].X - 1, TPA[I].Y) - 923172) = TestColor) Then
            Begin
              ColortoHSL(TestColor, H, S, L);
              ColortoRGB(TestColor, R, G, B);
              ColortoXYZ(TestColor, X, Y, Z);
              If InRange(R - G, 28, 68) Then
                If InRange(R - B, 55, 95) Then
                  If InRange(Round(X) - Round(Y), -14, 16) Then
                    If InRange(Round(X) - Round(Z), -11, 19) Then
                      If InRange(Round(H) - Round(S), -74, -60) Then
                        If InRange(Round(H) - Round(L), -21, -7) Then
                        Begin
                          WriteLn('MM Stone Color = ' + IntToStr(TestColor));
                          Result := TestColor;
                          Exit;
                        End;
            End;
          End;
        End;
      WriteLn('Couldn''t Find MM Stone Color!');
    End;

  11. #11
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    BTW heres the rocks im looking for just to make sure we're on the same page:


  12. #12
    Join Date
    Oct 2006
    Location
    I'm also from Michigan!
    Posts
    563
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    findRockColor
    SCAR Code:
    testcolor - 723980

    findStoneColor
    SCAR Code:
    testcolor - 527120

  13. #13
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SRL Compiled in 10 msec
    Could not find Stone Color!
    Successfully executed

    Check to see if im placing those colors in the right spot a few posts up. Have you tried these too?


    EDIT: o wait one sec....

  14. #14
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SRL Compiled in 10 msec
    Stone Color = 1326186
    Successfully executed!!!!

    Nice work there =]

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

    Default

    Ok, Dev version is fixed, so it will work in the next revision.


  16. #16
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great thanks! So, um when is the next version? And should I make a public post about that and attach the fixes?

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

    Default

    Quote Originally Posted by The[Cheese] View Post
    Great thanks! So, um when is the next version? And should I make a public post about that and attach the fixes?
    Nah The Dev's will take it from here

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. I can only get my script to mine 1 rock....
    By heliumbox in forum OSR Help
    Replies: 1
    Last Post: 08-13-2008, 05:26 AM
  2. Finding things on the Minimap..
    By itSchRis917 in forum OSR Help
    Replies: 13
    Last Post: 07-27-2007, 03:44 AM
  3. minimap ladder finding help
    By scarscaper4life in forum OSR Help
    Replies: 5
    Last Post: 01-07-2007, 03:08 AM
  4. Can't mine a gas rock.
    By weibs in forum News and General
    Replies: 7
    Last Post: 10-25-2006, 09:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •