Code:
Function WalkFirstTPA(C1, C2, XM, YM, XR, YR : Integer; SortPoint : TPoint) : Boolean; //thanks to 3Garrett3
Var
TPA: TPointArray;
TDPA: T2DPointArray;
I, CTS, H, X, Y: Integer;
Begin
If Not LoggedIn Then Exit;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(2.69, 1.54);
FindColorsSpiralTolerance(MMCX, MMCY, TPA, C1, MMX1, MMY1, MMX2, MMY2, 4); // 1795381
If Length(TPA) = 0 Then
begin
SetColorspeed2Modifiers(2.54, 3.70);
FindColorsSpiralTolerance(MMCX, MMCY, TPA, C2, MMX1, MMY1, MMX2, MMY2, 4); // 1584709
end;
TDPA := TPAtoATPAEx(TPA, 20, 20);
SortATPAFromFirstPoint(TDPA, SortPoint);
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;
Function WalkSecondTPA(C1, C2, XM, YM, XR, YR : Integer; SortPoint : TPoint) : Boolean; //thanks to 3Garrett3
Var
TPA: TPointArray;
TDPA: T2DPointArray;
I, CTS, H, X, Y: Integer;
Begin
If Not LoggedIn Then Exit;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(1.52, 0.76);
FindColorsSpiralTolerance(MMCX, MMCY, TPA, C1, MMX1, MMY1, MMX2, MMY2, 7); //1584709
If Length(TPA) = 0 Then
FindColorsSpiralTolerance(MMCX, MMCY, TPA, C2, MMX1, MMY1, MMX2, MMY2, 7);
TDPA := TPAtoATPAEx(TPA, 20, 20);
SortATPAFromFirstPoint(TDPA, SortPoint);
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;
I call them like this in my script:
Code:
Procedure WalkLumbToGoblinhut;
begin
If Not LoggedIn Then Exit;
if WalkFirstTPA(1795381, 1584709,( 10),( 0), 2, 2, Point(680, 65)) then
Writeln('infront of the bridge');
else
writeln('tpa sucks')
Wait(150+random(150));
if WalkSecondTPA(1584709, 1584709,( 1),( 10), 2, 2, Point(635, 24)) then
Writeln('at the spider pit');
else
Writeln('alot!')
//Get some failsafes and checks
end;
Here's some pics of where i want to walk: