SRL Archive - SRL Archives

TPA Monster Finder - Just put the color and the tolerance


Cazax

2008-09-24 20:41:40

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:

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.

noidea

2008-09-24 20:52:45

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.

BazzBarrett

2008-09-25 11:56:24

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..

TViYH

2008-09-25 18:06:10

Pretty much all TPA finders look the same..

Narcle

2008-09-26 21:05:47

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.

Nava2

2008-09-27 00:11:11

From: Narcle
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.


FindColorsSpiralTolerance(TPATemp);
CombineTPA(TPA, TPATemp);
T2DPA := SplitTPAEx(TPA, 15, 15);
P := MiddleTPA(T2DPA);

Burninating the country side… TROGDOR!

Bobarkinator

2008-09-27 00:31:53

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

Narcle

2008-09-27 01:00:34

From: Bobarkinator
@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.

Bobarkinator

2008-09-27 11:19:49

I took it as directed at everyone