Results 1 to 9 of 9

Thread: TPA Monster Finder - Just put the color and the tolerance

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

    Default TPA Monster Finder - Just put the color and the tolerance

    I have been inactive and busy for a while, so i haven't got time to spend on scar, but im back after all, bringing this TPA monster finder:

    SCAR Code:
    Function FightNPC(Color, Tol : Integer): Boolean;
    Var
      TPA,TPA2 : TPointArray;
      I,X,Y : Integer;
      W, H : TIntegerArray;
    Begin
      If Not LoggedIn Then
        Exit;
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tol);
      SetArrayLength(W, Length(TPA));
      SetArrayLength(H, Length(TPA));
      For I := 1 To High(TPA) Do
      Begin
        If (GetColor(TPA[I].X + 1, TPA[I].Y) = GetColor(TPA[I].X, TPA[I].Y)) Or (GetColor(TPA[I].X - 1, TPA[I].Y) = GetColor(TPA[I].X, TPA[I].Y)) Then
        Begin
          W[I] := 2;
          H[I] := 1;
        End;
        If (GetColor(TPA[I].X, TPA[I].Y + 1) = GetColor(TPA[I].X, TPA[I].Y)) Or (GetColor(TPA[I].X, TPA[I].Y - 1) = GetColor(TPA[I].X, TPA[I].Y)) Then
        Begin
          W[I] := 1;
          H[I] := 2;
        End;
        If (GetColor(TPA[I].X + 1, TPA[I].Y) = GetColor(TPA[I].X, TPA[I].Y)) And (GetColor(TPA[I].X, TPA[I].Y + 1) = GetColor(TPA[I].X, TPA[I].Y)) And (GetColor(TPA[I].X + 1, TPA[I].Y + 1) = GetColor(TPA[I].X, TPA[I].Y)) Or (GetColor(TPA[I].X + 1, TPA[I].Y) = GetColor(TPA[I].X, TPA[I].Y)) And (GetColor(TPA[I].X, TPA[I].Y - 1) = GetColor(TPA[I].X, TPA[I].Y)) And (GetColor(TPA[I].X + 1, TPA[I].Y - 1) = GetColor(TPA[I].X, TPA[I].Y)) Or (GetColor(TPA[I].X - 1, TPA[I].Y) = GetColor(TPA[I].X, TPA[I].Y)) And (GetColor(TPA[I].X, TPA[I].Y + 1) = GetColor(TPA[I].X, TPA[I].Y)) And (GetColor(TPA[I].X - 1, TPA[I].Y + 1) = GetColor(TPA[I].X, TPA[I].Y)) Or (GetColor(TPA[I].X - 1, TPA[I].Y) = GetColor(TPA[I].X, TPA[I].Y)) And (GetColor(TPA[I].X, TPA[I].Y - 1) = GetColor(TPA[I].X, TPA[I].Y)) And (GetColor(TPA[I].X - 1, TPA[I].Y - 1) = GetColor(TPA[I].X, TPA[I].Y)) Then
        Begin
          W[I] := 2;
          H[I] := 2;
        End;
        FindColorsTolerance(TPA2, GetColor(TPA[I].X, TPA[I].Y), TPA[I].X - 2, TPA[I].Y - 2, TPA[I].X + 2, TPA[I].Y + 2, 0);
        If Length(TPA2) = 25 Then
        Begin
          W[I] := 5;
          H[I] := 5;
        End;
        If (W[I] = 0) And (H[I] = 0) Then
        Begin
          W[I] := 1;
          H[I] := 1;
        End;
      End;
      For I := 1 To High(TPA) Do
      Begin
        If FindObjTPA(X, Y, GetColor(TPA[I].X, TPA[I].Y), Tol, 1, W[I], H[I], 1, ['ttack']) Then
        Begin
          Mouse(X, Y, 3, 3, True);
          FFlag(0);
          Wait(250 + Random(250));
          If IsChatBlackTextAnyLine('lready') Then
          Begin
            Writeln('Couldn''t attack monster');
            Exit;
          End;
          Result := True;
          Exit;
        End Else
        Begin
          Writeln('Couldn''t find monster');
          Exit;
        End;
      End;
    End;

    Just input the color and the tolerance and this will attack the monster. ONLY attacks, it just click over the monster. Creates boxes for you, design the CTS for you, and use a TPA function for you.


  2. #2
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Cool. A guy name 'bazzbarret or some thing Made some thing similar to this. It made a custom TPA fiunction and spit it out in the debug box. Goood work though.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  3. #3
    Join Date
    May 2008
    Location
    Here :p
    Posts
    194
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey i like it verymuch but it looks a tad 2 much like mine XD i think there sould be some sort of CreateTPAFromColors function with the options colors array/ color and the uptext u can make the script figure out the tolerance or u can imput it urself id sujest that if any devs it would b very helpful or i may make an improved version and post it myself, and it IS RS based cuz it gets the up text as a searcher i may post a new 1 here if i make a new 1..

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

    Default

    Pretty much all TPA finders look the same..

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

    Default

    In my new fighter I use a Color Array [TIntegerArray] and get a large TPA from that then split it to sub points. Instead of only having 1 color.

    Lets see someone else do that. :P (its not hard once u know how btw)

    Edit:
    Btw the color array can have a unlimited amount of colors.
    (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.

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

    Default

    Quote Originally Posted by Narcle View Post
    In my new fighter I use a Color Array [TIntegerArray] and get a large TPA from that then split it to sub points. Instead of only having 1 color.

    Lets see someone else do that. :P (its not hard once u know how btw)

    Edit:
    Btw the color array can have a unlimited amount of colors.
    SCAR Code:
    FindColorsSpiralTolerance(TPATemp);
    CombineTPA(TPA, TPATemp);
    T2DPA := SplitTPAEx(TPA, 15, 15);
    P := MiddleTPA(T2DPA);

    Burninating the country side... TROGDOR!
    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

  7. #7
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    @Narcle: That's been done since WizzyPlugin was invented by Wizzup...


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

    Default

    Quote Originally Posted by Bobarkinator View Post
    @Narcle: That's been done since WizzyPlugin was invented by Wizzup...
    Did I say it wasn't? I just said "lets see them do it" which was mainly focused on those talking in this thread.
    (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.

  9. #9
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    I took it as directed at everyone


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Finding Color with Tolerance
    By Gideon in forum OSR Help
    Replies: 6
    Last Post: 07-28-2008, 03:57 PM
  2. Color Tolerance Ranges
    By TOB in forum Research & Development Lounge
    Replies: 10
    Last Post: 08-18-2007, 10:21 AM
  3. Replies: 5
    Last Post: 07-31-2007, 07:23 PM
  4. color tolerance question
    By omgh4x0rz in forum OSR Help
    Replies: 4
    Last Post: 03-14-2007, 02:59 AM

Posting Permissions

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