Results 1 to 15 of 15

Thread: TPAInversusBMP by n3ss3s

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

    Default TPAInversusBMP & InversusTPA by n3ss3s

    Okay, what it does is that lets say that you have

    ***-**
    **--***
    ******

    and now the "-" are the points of your TPA, this function makes the "*"'s the TPA.

    Also works as gap finder

    Uses a bitmap, 0 - 15 ms.

    Bitmap and TPA ofc

    SCAR Code:
    Procedure TPAInversusBMP(Var TPA: TPointArray; x1, y1, x2, y2: Integer);

    Var
       Bmp, I, L, H: Integer;
       nTPA: TPointArray;
    Begin
      H := GetClientWindowHandle;
      Bmp := BitmapFromString(x2, y2, '');
      L := High(TPA);
      For I := 0 To L Do
        SetPixel(bmp, TPA[i].x, TPA[i].y, 255);
      SetTargetDC(GetBitmapDC(Bmp));
      FindColorsTolerance(nTPA, 0, x1, y1, x2, y2, 0);
      SetArrayLength(TPA, GetArrayLength(nTPA));
      TPA := nTPA;
      SetTargetDC(H);
    End;


    EDIT: NOW ALSO A NON BMP VERS

    SCAR Code:
    Function InversusTPA(TPA: TPointArray; x1, y1, x2, y2: Integer): TPointArray;

    Var
       B: Array of Array of Boolean;
       L, I, Z: Integer;
    Begin
      SetArrayLength(Result, Max(x1, x2) * Max(y1, y2));
      SetArrayLength(B, x2);
      For I := 0 To X2 - 1 Do
        SetArrayLength(B[i], y2);
      L := High(TPA);
      For I := 0 To L Do
        B[TPA[i].x][TPA[i].y] := True;
      L := High(B);
      For W := x1 to x2 Do
        For H := y1 To y2 Do
          If Not B[W][H] Then
          Begin
            Result[z] := Point(W, H);
            Z := Z + 1;
          End;
      SetArrayLength(Result, Z);
    End;

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

    Default

    I don't get it. What is this useful for
    [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]

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

    Default

    Also works as gap finder

    There are a lot more questionable things to be asking what they are useful for than this

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

    Default

    Oh, now I understand. Thanks for answering the question
    [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]

  5. #5
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    I think you should only post functions that actually make sense (or make some kind of n3ss3s include and post that..)
    Verrekte Koekwous

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

    Default

    (or make some kind of n3ss3s include and post that..)
    full of non-sensemaking functions?

    Though this one wasn't like... teh gunpowder..

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

    Default

    Nice one...Even I can understand it...but I don't get whats gasp?
    Well...one my idea is like that:
    If you havent built following in[I mean rock following, tree, fish spot etc]
    Then you use backcolor[like green grass, brown dirt], and then you have to search only from places where there are no grass and dirt...etc
    I'm not sure only if it's faster

    Nice job tough
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

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

    Default

    hehe, yeah, except for that usually the environment doesn't differ from the object enough to use tols high enough

  9. #9
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Your second function looks exactly like all mine functions
    Verrekte Koekwous

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

    Default

    Quote Originally Posted by mastaraymond View Post
    Your second function looks exactly like all mine functions
    Hes near reaching to 1337 with his IQ, so watch out...
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  11. #11
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Negaal View Post
    Hes near reaching to 1337 with his IQ, so watch out...
    How can that be possible!!! *Takes some IQ Boosters*
    Verrekte Koekwous

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

    Default

    Hehe, raymond is one of my code heroes, though maybe not a mod hero xD

  13. #13
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    Hehe, raymond is one of my code heroes, though maybe not a mod hero xD
    You sure about that.. It could work against you
    Verrekte Koekwous

  14. #14
    Join Date
    Jun 2007
    Location
    Belgium
    Posts
    333
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Also works as gap finder
    So it would find a door opening, as that's a gap in the wall?

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

    Default

    So it would find a door opening, as that's a gap in the wall?
    Hehe, I would just find the door by its colours, the gap would be the whole mainscreen except for a wall

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. n3ss3s
    By t3hl33tn00b in forum RuneScape News and General
    Replies: 8
    Last Post: 11-07-2007, 12:48 AM
  2. n3ss3s your tag
    By HyperSecret in forum Graphics and Multimedia
    Replies: 17
    Last Post: 09-25-2007, 03:38 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
  •