Results 1 to 10 of 10

Thread: FindRock

  1. #1
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default FindRock

    Just wanted to try out again, tried a few times with Tin and seems to work fine, around 15-50ms... No guarantee of anything...

    SCAR Code:
    Function FindRocks(Color, Tol: Integer; tol_H, tol_S: Extended): TPointArray;


    Var
       TPA: TPointArray;
       L, C, I: Integer;
       B: TBox;
       TPAA: T2DPointArray;
    Begin
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(tol_H, tol_S);
      FindColorsTolerance(TPA, Color, MSX1, MSY1, MSX2, MSY2, tol);
      SetColorSpeed2Modifiers(0.2, 0.2);
      TPAA := TPAToATPAEx(TPA, 30, 30);
      L := High(TPAA);
      SetArrayLength(Result, L + 1);
      For I := 0 To L Do
        If Length(TPAA[i]) < 65 Then
          If Length(TPAA[i]) > 10 Then
          Begin
            B := GetTPABounds(TPAA[i]);
            Try
              If (Length(TPAA[i]) + 0.001) / ((B.x2 - B.x1) * (B.y2 - B.y1)) < 0.5 Then
              Begin
                Result[c] := Point((B.x2 + B.x1) shr 1, (B.y2 + B.y1) shr 1);
                C := C + 1;
              End;
            Except End;
          End;
      SetArrayLength(Result, C);
      ColorToleranceSpeed(1);
    End;

  2. #2
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  3. #3
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Wow u put the color modifiers in as a option (forgot technical name).
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  4. #4
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    How do I find the H_tol, etc...?

    I'm a noob when it comes to RGB/HSL/XYZ color searching.

  5. #5
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    I don't understand how this function even works. Sorry.

    Isn't it more of a pain to get the HSL Tols anyways? Why not use a color record..?
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  6. #6
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    The laziness factor, IS, NOT, AMUSED.

    SCAR Code:
    with arRockRecords[lumbridge_Coal] do
      begin
        Name := 'Coal';
        UpText := 'Mine';
        MaxDist := 13;
        MinCount := 5;
        Color := 2372661;
        HueMod := 0.15;
        SatMod := 0.09;
        LumTol := 7;
        MinR := 31; MaxR := 74;
        MinG := 31; MaxG := 74;
        MinB := 21; MaxB := 51;
        MinX := 1.24; MaxX := 5.73;
        MinY := 1.38; MaxY := 6.43;
        MinZ := 0.94; MaxZ := 3.97;
      end;

    From Mining.scar, your script is fucked if you did that much effort for it

    This I likes,

    SCAR Code:
    program New;

    Var
       H, S, L: Extended;
    begin
      ColorToHSL(0, H, S, L);
      Writeln(FloatToStr(H));
      Writeln(FloatToStr(S));
      Writeln(FloatToStr(L));
      ColorToHSL(255, H, S, L);
      Writeln(FloatToStr(H));
      Writeln(FloatToStr(S));
      Writeln(FloatToStr(L));
    end.


    I forgot I have the other thread, I'll move this there...

  7. #7
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    The laziness factor, IS, NOT, AMUSED.

    SCAR Code:
    with arRockRecords[lumbridge_Coal] do
      begin
        Name := 'Coal';
        UpText := 'Mine';
        MaxDist := 13;
        MinCount := 5;
        Color := 2372661;
        HueMod := 0.15;
        SatMod := 0.09;
        LumTol := 7;
        MinR := 31; MaxR := 74;
        MinG := 31; MaxG := 74;
        MinB := 21; MaxB := 51;
        MinX := 1.24; MaxX := 5.73;
        MinY := 1.38; MaxY := 6.43;
        MinZ := 0.94; MaxZ := 3.97;
      end;

    From Mining.scar, your script is fucked if you did that much effort for it

    This I likes,

    SCAR Code:
    program New;

    Var
       H, S, L: Extended;
    begin
      ColorToHSL(0, H, S, L);
      Writeln(FloatToStr(H));
      Writeln(FloatToStr(S));
      Writeln(FloatToStr(L));
      ColorToHSL(255, H, S, L);
      Writeln(FloatToStr(H));
      Writeln(FloatToStr(S));
      Writeln(FloatToStr(L));
    end.


    I forgot I have the other thread, I'll move this there...
    You might not like it but it works great for me
    Administrator's Warning:


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

    Default

    And me, except it stops after every 3 loads

  9. #9
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    I doubt it is the rock finder if it stops after 3 loads exactly everytime
    Administrator's Warning:


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

    Default

    . I dunno that try - except thingy does my head in trying to figure out why my script stops

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
  •