Page 2 of 2 FirstFirst 12
Results 26 to 36 of 36

Thread: SRL To Do Thread

  1. #26
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    I dont know if it exists, but a function to find overlapping ATPA Boxes in two ATPA's, of some kind, and return the box of the intersecting parts as ATPA, i cant think of a "fast" enough way to do it

    Maybe one of you more experienced guys can get the logic for it

    For each TPA in the First ATPA, gettpabounds. For each TPA in the Second ATPA, gettpabounds. For each box, check if they intersect.

    If they do, use a forloop to get each point within the intersection.
    I am Ggzz..
    Hackintosher

  2. #27
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    For each TPA in the First ATPA, gettpabounds. For each TPA in the Second ATPA, gettpabounds. For each box, check if they intersect.

    If they do, use a forloop to get each point within the intersection.
    Something like this is what I've been trying but it takes way to long to be practical in most uses, if there are alot of TPA results

    Was considering some kind of tradeoff and finding the middle of the two ATPA boxes and checking if they are within X distance from each other and then doing the calculation for those boxes? Might still take a long time if both ATPA's have alot of boxes
    Last edited by DannyRS; 01-03-2013 at 06:02 PM.


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  3. #28
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    Something like this is what I've been trying but it takes way to long to be practical in most uses, if there are alot of TPA results

    Was considering some kind of tradeoff and finding the middle of the two ATPA boxes and checking if they are within X distance from each other and then doing the calculation for those boxes? Might still take a long time if both ATPA's have alot of boxes

    Simba Code:
    Function ATPAIntersections(ATPAOne, ATPATwo: T2DPointArray): TPointArray;
    var
      I, J, K, L, Index: Integer;
    Begin
      For I := 0 To High(ATPAOne) Do
        For K := 0 To High(ATPAOne[I]) Do
          For J := 0 To High(ATPATwo) Do
            For L := 0 To High(ATPATwo[J]) Do
              If (ATPAOne[I][K] = ATPATwo[J][L]) Then
              Begin
                SetLength(Result, Index + 1);
                Result[Index] := ATPAOne[I][K];
                Inc(Index);
              End;
    End;

    var
      ATPAOne, ATPATwo: T2DPointArray;

    begin
      ATPAOne := [TPointArray([Point(0, 0), Point(1, 1)]), TPointArray([Point(10, 10), Point(11, 11), Point(14, 0), Point(20, 20), Point(12, 12)])];
      ATPATwo := [TPointArray([Point(0, 0), Point(1, 1)]), TPointArray([Point(10, 10), Point(11, 11), Point(12, 12), Point(13, 13)])];

      writeln(ATPAIntersections(ATPAOne, ATPATwo));
    end.

    You can easily change the result to a TBoxArray and it'll hold a list of all boxes that intersect.. I chose to leave it as a TPA.. You get a list of all points that are in both ATPA's. I see it as more useful than the boxes.

    The two ATPA's can also be of different sizes/lengths.

    Seems pretty fast to me :S
    Last edited by Brandon; 01-03-2013 at 06:13 PM.
    I am Ggzz..
    Hackintosher

  4. #29
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Seems pretty fast to me :S
    Does seem much faster than my method, but i cant get it to actually find any values no matter what i seem to pass in :S tried everything i can think of, the two ATPA's are all over each other but the result TPA is always null

    Any help in a "real world" RS use?


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  5. #30
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    Does seem much faster than my method, but i cant get it to actually find any values no matter what i seem to pass in :S tried everything i can think of, the two ATPA's are all over each other but the result TPA is always null

    Any help in a "real world" RS use?

    It works in RS and normally as well.. It's just with a ton of points, there's a ton of iterations and thus it gets extremely slow..

    The below will print one point because the two boxes only intersect at one point. So yeah the algorithm and stuff works. It could of course be optimized a bit but for a lot of points it's slow :c

    Simba Code:
    {$I SRL/SRL.Simba}
    {$I SRL/SRL/Misc/Debug.Simba}

    Function ATPAIntersections(ATPAOne, ATPATwo: T2DPointArray): TPointArray;
    var
      I, J, K, L, Index: Integer;
    Begin
      For I := 0 To High(ATPAOne) Do
        For K := 0 To High(ATPAOne[I]) Do
          For J := 0 To High(ATPATwo) Do
            For L := 0 To High(ATPATwo[J]) Do
              If (ATPAOne[I][K] = ATPATwo[J][L]) Then
              Begin
                SetLength(Result, Index + 1);
                Result[Index] := ATPAOne[I][K];
                Inc(Index);
              End;
    End;


    var
      A, A2: T2DPointArray;
      T, T2: TPointArray;

    begin
      SetupSRL;

      T := TPAFromBox(IntToBox(0, 0, 25, 25));
      T2 := TPAFromBox(IntToBox(25, 25, 50, 50));

      A := TPAToATPAEx(T, 30, 35);
      A2 := TPAToATPAEx(T2, 40, 10);

      writeln(ATPAIntersections(A, A2));
    end.
    I am Ggzz..
    Hackintosher

  6. #31
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    It works in RS and normally as well.. It's just with a ton of points, there's a ton of iterations and thus it gets extremely slow..

    The below will print one point because the two boxes only intersect at one point. So yeah the algorithm and stuff works. It could of course be optimized a bit but for a lot of points it's slow :c
    Alright, When i get back to my PC, I'll give it another go Thanks so much for the reply Brandon,

    If Dynamite and etc want a suggestion for OP, Optimized brandon function include would be a good idea


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  7. #32
    Join Date
    Oct 2011
    Posts
    422
    Mentioned
    15 Post(s)
    Quoted
    116 Post(s)

  8. #33
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    a sound plugin!!!

  9. #34
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    I've worked on a much more secure way to log the player into RS that will render any and all keyloggers powerless. It's still not fully operational and still being discussed in the higher up boards, but should I (we) get it working correctly it would be an ideal option way to login for the high security-wise user.
    I fail to see how, unless you are thinking of utilising this or this, which I doubt given that it is detectable and bannable by the Runescape client, and aside from the fact being Windows-only.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  10. #35
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,193
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    I dont know if it exists, but a function to find overlapping ATPA Boxes in two ATPA's, of some kind, and return the box of the intersecting parts as ATPA, i cant think of a "fast" enough way to do it

    Maybe one of you more experienced guys can get the logic for it
    Simba Code:
    function ATPAOverlapping(Limit : Integer; ATPA, ATPA2 : T2DPointArray; Var ATPAResult: T2DPointarray) : Boolean;
    Var
      I, II, III, IIII : Integer;
      TempTPA : TpointArray;
    begin
    For I := 0 to High(ATPA) do
    begin
      TBOX := GetTPABounds(ATPA[I]);
      For II := 0 to high ATPA2 do
      begin
        for III:= 0 to High(ATPA2[i]) do
        begin
          if PointInBox(ATPA2[ii][iii], Tbox) then
          begin
            inc(Count);
            IIII := GetArrayLength(TempTPA);
            SetArrayLength(TempTPA, IIII + 1);
            TempTPA[IIII] := ATPA[ii][iii];
        end;
      If Count > Limit then
      begin
         IIII := GetArrayLength(ATPAResult);
         SetArrayLength(ATPAResult, IIII + 1);
         ATPAResult[IIII] := TempTPA;
      end;
      SetArraylength(ATPAresult, 0);
      SetArrayLength(TempTPA, 0);
    end;

    Something like that anyway. Just a method off the top of my head. This was not done in simba so likely all the code is worng but this is just to illustrate the method.

    Edit Ninja'd by brandon.
    Last edited by BraK; 01-04-2013 at 04:30 PM.

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

  11. #36
    Join Date
    Nov 2012
    Location
    USA
    Posts
    153
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    I've worked on a much more secure way to log the player into RS that will render any and all keyloggers powerless. It's still not fully operational and still being discussed in the higher up boards, but should I (we) get it working correctly it would be an ideal option way to login for the high security-wise user.
    This definitely sounds interesting, can't wait to see it

    Moar support for Linux

    (Though I guess this is just SRL6)

Page 2 of 2 FirstFirst 12

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
  •