Results 1 to 22 of 22

Thread: Santy Functions!

  1. #1
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default Santy Functions!

    SCAR Code:
    function FindMouse : Boolean;
    var
      MousePoints : TPointArrayArray;
      MousePointArray : TPointArray;
      CheckPoint : TPoint;
      MouseColoursArray : TIntegerArray;
      MouseColour, StartTime, MouseTime, X, Y, I : Integer;
      CTS : Integer;
    begin
      CTS := GetColorToleranceSpeed;
      MarkTime(StartTime);
      ColorToleranceSpeed(2);
      FindColorsSpiralTolerance(MSCX, MSCY, MousePointArray, 16645629, MSX1, MSY1, MSX2, MSY2, 7);
      MousePoints := SplitTPA(MousePointArray, 5);
      for I := 0 to High(MousePoints) do
      begin
        CheckPoint := MiddleTPA(MousePoints[I]);
        MouseColour := GetColor(CheckPoint.X, CheckPoint.Y);
        MarkTime(MouseTime);
        Mouse(CheckPoint.X, CheckPoint.Y, 2, 2, False);
        Wait(50 + Random(50));
        if ClickOption('ouse', 1) then
        begin
          GetMousePos(X, Y);
          Mouse(X, Y, 0, 0, True);
          if not(InIntArray(MouseColoursArray, MouseColour)) then
          begin
            SetArrayLength(MouseColoursArray, Length(MouseColoursArray) + 1);
            MouseColoursArray[High(MouseColoursArray)] := MouseColour;
            WriteLn(IntToStr(MouseColour) + ' Added To MouseColour Array');
          end;
          Result := True;
          WriteLn(IntToStr(TimeFromMark(StartTime) - TimeFromMark(MouseTime)));
          ColorToleranceSpeed(CTS);
          Exit;
        end;
      end;
    end;

    SCAR Code:
    function FindTree : Boolean;
    var
      TreePointArray : TPointArrayArray;
      TreePoints : TPointArray;
      Centre : TPoint;
      TreeBox : TBox;
      X, Y, I, K, U : Integer;
      CTS : Integer;
    begin
      CTS := GetColorToleranceSpeed;
      MarkTime(U);
      ColorToleranceSpeed(2);
      Centre := IntToPoint(MSCX, MSCY);
      FindColorsTolerance(TreePoints, 2910042, MSX1, MSY1, MSX2, MSY2, 10);
      TreePointArray := SplitTPA(TreePoints, 20);
      SortATPAFrom(TreePointArray, Centre);
      K := TimeFromMark(U);
      for I := 0 to High(TreePointArray) do
      begin
        TreeBox := GetTPABounds(TreePointArray[I]);
        MMouse((TreeBox.X1 + TreeBox.X2)/2, (TreeBox.Y1 + TreeBox.Y2)/2, 3, 3);
        Wait(50 + Random(50));
        if IsUpText('hop') then
        begin
          GetMousePos(X, Y);
          Mouse(X, Y, 0, 0, True);
          Result := True;
          WriteLn(IntToStr(K));
          ColorToleranceSpeed(CTS);
          Exit;
        end;
      end;
    end;

    SCAR Code:
    function FindMeanColour(NumberArray : TIntegerArray) : TIntegerArray;
    var
      I : Integer;
      H, S, L : Extended;
      R, G, B : Integer;
      X, Y, Z : Extended;

      HTotal, STotal, LTotal : Extended;
      HMean, SMean, LMean : Extended;

      RTotal, GTotal, BTotal : Integer;
      RMean, GMean, BMean : Integer;
     
      XTotal, YTotal, ZTotal : Extended;
      XMean, YMean, ZMean : Extended;
    begin
      SetArrayLength(Result, 3);

      for I := 0 to High(NumberArray) do
      begin
        ColorToHSL(NumberArray[I], H, S, L);
        ColorToRGB(NumberArray[I], R, G, B);
        ColorToXYZ(NumberArray[I], X, Y, Z);

        HTotal := HTotal + H;
        STotal := STotal + S;
        LTotal := LTotal + L;

        RTotal := RTotal + R;
        GTotal := GTotal + G;
        BTotal := BTotal + B;

        XTotal := XTotal + X;
        YTotal := YTotal + Y;
        ZTotal := ZTotal + Z;
      end;

      HMean := HTotal/Length(NumberArray);
      SMean := STotal/Length(NumberArray);
      LMean := LTotal/Length(NumberArray);

      RMean := RTotal/Length(NumberArray);
      GMean := GTotal/Length(NumberArray);
      BMean := BTotal/Length(NumberArray);

      XMean := XTotal/Length(NumberArray);
      YMean := YTotal/Length(NumberArray);
      ZMean := ZTotal/Length(NumberArray);

      Result[0] := HSLToColor(HMean, SMean, LMean);
      Result[1] := RGBToColor(RMean, GMean, BMean);
      Result[2] := XYZToColor(XMean, YMean, ZMean);
    end;

    function FindGlobalTolerance(NumberArray : TIntegerArray) : Integer;
    var
      I : Integer;
    begin
      for I := 1 to High(NumberArray) do
      while not(SimilarColors(NumberArray[I], NumberArray[I - 1], Result)) do
        Inc(Result);
    end;

    procedure FindHSLInfo(NumberArray : TIntegerArray);
    var
      I : Integer;

      H, S, L : TExtendedArray;
      R, G, B : TIntegerArray;
      X, Y, Z : TExtendedArray;

      HSArray, HLArray, SLArray : TExtendedArray;
      RBArray, RGArray, GBArray : TIntegerArray;
      XYArray, XZArray, YZArray : TExtendedArray;

      GenericColourArray : TIntegerArray;
    begin
      SetArrayLength(H, Length(NumberArray));
      SetArrayLength(S, Length(NumberArray));
      SetArrayLength(L, Length(NumberArray));

      SetArrayLength(R, Length(NumberArray));
      SetArrayLength(G, Length(NumberArray));
      SetArrayLength(B, Length(NumberArray));
     
      SetArrayLength(X, Length(NumberArray));
      SetArrayLength(Y, Length(NumberArray));
      SetArrayLength(Z, Length(NumberArray));
     
      SetArrayLength(HSArray, Length(NumberArray));
      SetArrayLength(HLArray, Length(NumberArray));
      SetArrayLength(SLArray, Length(NumberArray));
     
      SetArrayLength(RGArray, Length(NumberArray));
      SetArrayLength(RBArray, Length(NumberArray));
      SetArrayLength(GBArray, Length(NumberArray));

      SetArrayLength(XYArray, Length(NumberArray));
      SetArrayLength(XZArray, Length(NumberArray));
      SetArrayLength(YZArray, Length(NumberArray));
     
      for I := 0 to High(NumberArray) do
      begin
        ColorToHSL(NumberArray[I], H[I], S[I], L[I]);
        ColorToRGB(NumberArray[I], R[I], G[I], B[I]);
        ColorToXYZ(NumberArray[I], X[I], Y[I], Z[I]);
      end;
       
      for I := 0 to High(NumberArray) do
      begin
        HSArray[I] := H[I] - S[I];
        HLArray[I] := H[I] - L[I];
        SLArray[I] := S[I] - L[I];
       
        RGArray[I] := R[I] - G[I];
        RBArray[I] := R[I] - B[I];
        GBArray[I] := G[I] - B[I];

        XYArray[I] := X[I] - Y[I];
        XZArray[I] := X[I] - Z[I];
        YZArray[I] := Y[I] - Z[I];
      end;
     
      GenericColourArray := FindMeanColour(NumberArray);
     
      WriteLn('Santy''s HSL Characteristic Finder!');
      WriteLn(' ');
      WriteLn('Generic HSL Colour : ' + IntToStr(GenericColourArray[0]));
      WriteLn('Generic RGB Colour : ' + IntToStr(GenericColourArray[1]));
      WriteLn('Generic XYZ Colour : ' + IntToStr(GenericColourArray[2]));
     
      WriteLn('Max Tolerance : ' + IntToStr(FindGlobalTolerance(NumberArray)));
      WriteLn(' ');
      WriteLn('Min H : ' + FloatToStr(AMinE(H)) + ', Max H : ' + FloatToStr(AMaxE(H)));
      WriteLn('Min S : ' + FloatToStr(AMinE(S)) + ', Max S : ' + FloatToStr(AMaxE(S)));
      WriteLn('Min L : ' + FloatToStr(AMinE(L)) + ', Max L : ' + FloatToStr(AMaxE(L)));
      WriteLn(' ');
      WriteLn('Min H - S : ' + FloatToStr(AMinE(HSArray)) + ', Max H - S : ' + FloatToStr(AMaxE(HSArray)));
      WriteLn('Min H - L : ' + FloatToStr(AMinE(HLArray)) + ', Max H - L : ' + FloatToStr(AMaxE(HLArray)));
      WriteLn('Min S - L : ' + FloatToStr(AMinE(SLArray)) + ', Max S - L : ' + FloatToStr(AMaxE(SLArray)));
      WriteLn(' ');
      WriteLn('Min R : ' + IntToStr(AMin(R)) + ', Max R : ' + IntToStr(AMax(R)));
      WriteLn('Min G : ' + IntToStr(AMin(G)) + ', Max G : ' + IntToStr(AMax(G)));
      WriteLn('Min B : ' + IntToStr(AMin(B)) + ', Max B : ' + IntToStr(AMax(B)));
      WriteLn(' ');
      WriteLn('Min R - G : ' + IntToStr(AMin(RGArray)) + ', Max R - G : ' + IntToStr(AMax(RGArray)));
      WriteLn('Min R - B : ' + IntToStr(AMin(RBArray)) + ', Max R - B : ' + IntToStr(AMax(RBArray)));
      WriteLn('Min G - B : ' + IntToStr(AMin(GBArray)) + ', Max G - B : ' + IntToStr(AMax(GBArray)));
      WriteLn(' ');
      WriteLn('Min X : ' + FloatToStr(AMinE(X)) + ', Max X : ' + FloatToStr(AMaxE(X)));
      WriteLn('Min Y : ' + FloatToStr(AMinE(Y)) + ', Max Y : ' + FloatToStr(AMaxE(Y)));
      WriteLn('Min Z : ' + FloatToStr(AMinE(Z)) + ', Max Z : ' + FloatToStr(AMaxE(Z)));
      WriteLn(' ');
      WriteLn('Min X - Y : ' + FloatToStr(AMinE(XYArray)) + ', Max X - Y : ' + FloatToStr(AMaxE(XYArray)));
      WriteLn('Min X - Z : ' + FloatToStr(AMinE(XZArray)) + ', Max X - Z : ' + FloatToStr(AMaxE(XZArray)));
      WriteLn('Min Y - Z : ' + FloatToStr(AMinE(YZArray)) + ', Max Y - Z : ' + FloatToStr(AMaxE(YZArray)));
    end;

    SCAR Code:
    function MakeDDTM(InventorySpot : Integer; ItemName : string) : Boolean;
    var
      I : Integer;
      DDTMBox : TBox;
      DDTMMainPoint : TPoint;
      DDTMPoints : TPointArray;
      DDTMSubPoints : TPointArrayArray;
    begin
      if not(InRange(InventorySpot, 1, 28)) then
      begin
        WriteLn('Inventory Spot Must Be Between 1 And 28, Inclusive');
        WriteLn('Exiting');
        Exit;
      end;
     
      DDTMBox := InvBox(InventorySpot);
      DDTMMainPoint := ItemCoords(InventorySpot);
      FindColorsTolerance(DDTMPoints, 65536, DDTMBox.X1, DDTMBox.Y1, DDTMBox.X2, DDTMBox.Y2, 0);

      DDTMSubPoints := TPAToATPA(DDTMPoints, 10);

      WriteLn(ItemName + 'Main.X := ' + IntToStr(DDTMMainPoint.X));
      WriteLn(ItemName + 'Main.Y := ' + IntToStr(DDTMMainPoint.Y));
      WriteLn(ItemName + 'Main.AreaSize := 0');
      WriteLn(ItemName + 'Main.AreaShape := 0');
      WriteLn(ItemName + 'Main.Color := ' + IntToStr(GetColor(DDTMMainPoint.X, DDTMMainPoint.Y)));
      WriteLn(ItemName + 'Main.Tolerance := 255');

      for I := 0 to High(DDTMSubPoints) do
      begin
        WriteLn(' ');
        WriteLn(ItemName + 'Sub[' + IntToStr(I) + '].X := ' + IntToStr(DDTMSubPoints[I][0].X));
        WriteLn(ItemName + 'Sub[' + IntToStr(I) + '].Y := ' + IntToStr(DDTMSubPoints[I][0].Y));
        WriteLn(ItemName + 'Sub[' + IntToStr(I) + '].AreaSize := 0');
        WriteLn(ItemName + 'Sub[' + IntToStr(I) + '].AreaShape := 0');
        WriteLn(ItemName + 'Sub[' + IntToStr(I) + '].Color := 65536');
        WriteLn(ItemName + 'Sub[' + IntToStr(I) + '].Tolerance := 0');
      end;
     
      Result := True;
    end;

    Descriptions :
    • FindMouse : Find a toy mouse on the ground. Results true if clicked. Adds mouse colour into TIntegerArray.
    • FindTree : Finds any tree on mainscreen...maybe except willows. Results true if clicked.
    • HSL Tool : Finds characteristics of a TIntegerArray. Lowest and highest H, S, L, R, G, B, X, Y, Z, while also finding the lowest and highest differences.
    • MakeDDTM : Makes a DDTM of an item in the inventory. You can choose the name and inventory spot by filling in the parameters.


    This is my first function thread, rate it or hate Constructive criticism is appreciated...and so is flaming, gives me a chance to take out all my anger on someone. Bye now
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  2. #2
    Join Date
    Jan 2007
    Posts
    448
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    the first one is brilliant thanks and good job
    Wizzup threatened to rape me unless I removed my signature.

  3. #3
    Join Date
    Jan 2007
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default



    Lol.

    I dont get FindMouse. Does it look for the position of the mouse on the screen? But then you mention finding it on the ground. Is there a toy mouse object? Im confused lol.

    Edit: Dam you t3hl33tn00b :P. Go and ruin my picture why dnt you.
    I like cats.
    Narcle's AK Smelter 1.1.6
    Run Time : 7 Hr 53 Min 5 Sec
    Total Bars : 3371
    Total XP : 58995

  4. #4
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Hehe, your HSL, RGB, XYZ thing is pretty much the same as mine now. . Good job.

    EDIT:
    Quote Originally Posted by Jahuro
    I dont get FindMouse. Does it look for the position of the mouse on the screen? But then you mention finding it on the ground. Is there a toy mouse object? Im confused lol.
    It looks for a mouse like the ones in the witches potion quest I think. (Am I right?)

  5. #5
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ZephyrsFury View Post
    Hehe, your HSL, RGB, XYZ thing is pretty much the same as mine now. . Good job.

    EDIT:


    It looks for a mouse like the ones in the witches potion quest I think. (Am I right?)
    I didn't make mine while looking at yours...and our tolerance finders are a bit different It looks for the agility mice...the ones that you wind, release and pick up.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  6. #6
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    The function you made for me. J00 P00N!

    Aww, this was spam. Well, your functions were really good. I'll add the mousecolorarray back in when I get my head out of my ass and start thinking like a normal person. Good functions, still.

  7. #7
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hehe, good job though, if you could make me willowfinder, what does not find any ground, and finds up 150 points, then you would be my best friend

    Edit: Hah, I'v tryed almost everything, filtering with HSL/XYZ, Finding only dark and very light colors, and combine them, finding few unique colors and make box around them and trying to use best color in that, tryed lots, lots of colours, lots of...5 days on one function for nothing ^^ beat that

    1 thing Markus reminded me today, how to speed up function a bit. Instead of for i := 0 to High(x) / GetArraylength(x) - 1 do

    High := High(x)
    For i := 0 to High do...

    So you dont have to get arrays length everytime
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  8. #8
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Lmao, was about to say, the computer mouse cursor won't show up on a FindColor search .
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  9. #9
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't understand what you said R0bot...

    And Negaal, High(Array) looks better and doesn't really take too much time...so I'll stick with it.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  10. #10
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Wow, those are the worst procedures ever. How can you stand to live being such a bad scripter like that?
    Just kidding <3, VERY GOOD JOB : )


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  11. #11
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Hy71194 View Post
    Wow, those are the worst procedures ever.
    Jk, VERY GOOD JOB : )
    You're a noob.
    Just kidding, thanks.

    Negaal:

    SCAR Code:
    function FindWillow : Boolean;
    var
      TreePoints : TPointArray;
      TreePointArray : TPointArrayArray;
      X, Y : Integer;
      I : Integer;
      K, U : Integer;
      TreeBox : TBox;
      Centre : TPoint;
    begin
      MarkTime(U);
      ColorToleranceSpeed(2);
      Centre.X := MSCX;
      Centre.Y := MSCY;
      FindColorsTolerance(TreePoints, 4754817, MSX1, MSY1, MSX2, MSY2, 10);
      TreePointArray := SplitTPA(TreePoints, 20);
      SortATPAFrom(TreePointArray, Centre);
      K := TimeFromMark(U);
      DebugATPA(TreePointArray, '');
      for I := 0 to High(TreePointArray) do
      begin
        TreeBox := GetTPABounds(TreePointArray[I]);
        MMouse((TreeBox.X1 + TreeBox.X2)/2, (TreeBox.Y1 + TreeBox.Y2)/2, 3, 3);
        Wait(50 + Random(50));
        if IsUpText('illow') then
        begin
          GetMousePos(X, Y);
          Mouse(X, Y, 0, 0, True);
          Result := True;
          WriteLn(IntToStr(K));
          Exit;
        end;
      end;
    end;

    47 Ms...3 trees...all the points were on the trees and not the ground.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  12. #12
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I lied about best friend thingy
    But I still try it today...not sure it's going to work good...

    Thank you.
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  13. #13
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    Lmao, was about to say, the computer mouse cursor won't show up on a FindColor search .
    It doesn't find the mouse cursor thing. It finds the agility mice in RS.

  14. #14
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    New function, MakeDDTM added.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  15. #15
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Nice functions/procedures. Make a santa clause photo generator in scar? like it makes a santa from stars like:

    PHP Code:
       ()
       ***
      ****
      ( -.- )
    *******
    *******
    *******
    ** 
    00**
    ** | **
    **     ** 

    Fingers slipped :l

  16. #16
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This isn't what I was looking for =/

    156
    203
    171
    156
    Mostly 140 -225 points...



    Well, if I'm lucky with colors I usually do find at least 500, problem is always I get tiny piece of grass with it:S
    I'v also found 2000 pts on one tree, but again litle piece of lag and grass are included =/
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  17. #17
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    There aren't any points on the ground...get on MSN and we'll discuss more.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

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

    Default

    Well, a suggestion for the tree finding to avoid finding the grass, take the color picker and look atthe willow, it isn't fully green is it? It has got green, gray and light brown.

    The outer part of the willow, like if it was a circle, the arc, mainly consists of green, so, what if you would first do a FindColors for the green, and then, make a function that sweeps the whole green area empty from the TPA with a user set or automated radius, from the midpoint of the TPA you got with MiddleTPA before sweepin it empty, and then, to get how many pixel area of the circle you deleted was, use A = pi * r^2, and then, do FindColorsPie for the brown and gray colors from the midpoint with the same radius you wiped out the green ones, and then use something like

    SCAR Code:
    Function GrabTPA(TPA: TPointArray; x1, y1, x2, y2: Integer): TPointArray;
    Var
      I, Z, L: Integer;
      B: TBox;
    Begin
      L := High(TPA);
      B := IntToBox(x1, y1, x2, y2);
      SetArrayLength(Result, GetArrayLength(TPA));
      For I := 0 To L Do
        If PointInBox(TPA[i], B) Then
        Begin
          Result[i] := TPA[i];
          Z := Z + 1;
        End;
      SetArrayLength(Result, Z);
    End;

    for the green area, yes, it is possible, because you have a backup TPA of it, so, with the function above you will get the points of the green tpa in the circle, and then compare the amounts of gray and brown to the green, because it is mainy green, then brown and then gray.



    Something like that, use your imagination.

  19. #19
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Nice Idea.


    I try to think... More simply, however.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  20. #20
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    Nice Idea.


    I try to think... More simply, however.
    i agree, n3ss3s you confuzerate me

  21. #21
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by footballjds View Post
    i agree, n3ss3s you confuzerate me
    I agree with Football, I wouldn't understand it even if you will draw me a picture.

    Anyways I understood that I have to do FindColorsTolerance more than 3 times, thing is that even 2 FindColorTolerance at same time makes me 0.1 sec lagg, yesh, my PC sucks...Still it needs to be non - laggy for me, i'm not going to try it, i'm going to get confused...


    SCAR Code:
    A = pi * r^2

    *Thats the things because why I say*

    Wdf?

    3,14 * Radius^2

    What I get from this?
    Dude you're 12
    *I'm embarrising*
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

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

    Default

    13 x)

    Pi * Radius^2 is the area of a circle

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Santy Functions!
    By Santa_Clause in forum Research & Development Lounge
    Replies: 6
    Last Post: 02-16-2008, 10:42 AM
  2. The reason why Santy is so smart!
    By BobboHobbo in forum Discussions & Debates
    Replies: 21
    Last Post: 02-08-2008, 10:30 PM
  3. Santy ElfTalker!
    By Santa_Clause in forum RS3 Outdated / Broken Scripts
    Replies: 24
    Last Post: 12-08-2007, 05:30 AM
  4. Santy Fighter!
    By Santa_Clause in forum RS3 Outdated / Broken Scripts
    Replies: 22
    Last Post: 08-06-2007, 03:30 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
  •