3Garrett3
2010-08-22 12:46:10
Hey guys,
I'm trying to make a l33t TPA walker for my Karamja script, and I'm just trying to improve the one from my Baby Melter. Here is what it looks like:
It has sooo many parameters, yeah. But I want it to be the ultimate generic TPA walker, so that I don't have to do anything custom other than call one line of code every time I want to TPA walk (there are 6 steps to Stiles, so 12 steps altogether).
With this I simply have to call:
Anything to add, remove, improve, etc would be greatly appreciated.
I'm trying to make a l33t TPA walker for my Karamja script, and I'm just trying to improve the one from my Baby Melter. Here is what it looks like:
Function WalkTPA(C1, XM, YM, XR, YR, Tol, SplitMethod, SortMethod, ColTolS : Integer;
SortPoint : TPoint; HueMod, SatMod : Extended; Dist : TIntegerArray) : Boolean;
Var
TPA: TPointArray;
TDPA: T2DPointArray;
I, CTS, H, X, Y: Integer;
Begin
If Not LoggedIn Then Exit;
cts := GetColorToleranceSpeed;
if ColTolS = 2 then
begin
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(HueMod, SatMod);
end else
ColorToleranceSpeed(ColTolS);
FindColorsSpiralTolerance(MMCX, MMCY, TPA, C1, MMX1, MMY1, MMX2, MMY2, Tol);
Debug('Found colour, length of array = ' + IntToStr(Length(TPA)));
If Length(TPA) = 0 Then
begin
Debug('Didn''t find the colour, quitting walktpa');
ColorToleranceSpeed(cts);
Exit;
end;
Case SplitMethod of
1:
TDPA := TPAToATPA(TPA, Dist[0]);
2:
TDPA := TPAToATPAEx(TPA, Dist[0], Dist[1]);
3:
TDPA := SplitTPA(TPA, Dist[0]);
4:
TDPA := SplitTPAEx(TPA, Dist[0], Dist[1]);
end;
Case SortMethod of
1:
SortATPAFrom(TDPA, SortPoint);
2:
SortATPASize(TDPA, True);
3:
SortATPASize(TDPA, False);
end;
//DebugTPA(TPA, '');
H := High(TDPA);
For i := 0 To H Do
Begin
MiddleTPAEx(TDPA[i], x, y);
If rs_OnMinimap(x,y) Then
Begin
MouseFlag(x + XM, y + YM, XR, YR, 0);
Result := True;
Wait(200 + Random(80));
ColorToleranceSpeed(cts);
Exit;
End;
End;
Result := False;
ColorToleranceSpeed(cts);
End;
It has sooo many parameters, yeah. But I want it to be the ultimate generic TPA walker, so that I don't have to do anything custom other than call one line of code every time I want to TPA walk (there are 6 steps to Stiles, so 12 steps altogether).
With this I simply have to call:
Result := WalkTPA(Color, 5, 5, 1, 1, 2, 4, 3, 1, Point(MMx1, MMCy), 0, 0, [20,30]);
Anything to add, remove, improve, etc would be greatly appreciated.