SCAR Code:
function MFF(X, Y, Xmod, Ymod: Integer): Boolean;
By: EvilChicken!
Description: If the flag is not present it will click at (ax, ay) increasing by
(xmod, ymod) 5 times or until the flag appears.
Clicks until the flag is present. So XM YM still seems unnecessary to me.
SCAR Code:
Function WalkTPA(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; //saves current coltolspeed
ColorToleranceSpeed(2); //sets sped to 2
SetColorspeed2Modifiers(0.10, 25); //sets mods
FindColorsSpiralTolerance(MMCX, MMCY, TPA, C1, MMX1, MMY1, MMX2, MMY2, 7); //finds all pixels of C1 with tol 7, saves them in TPA called TPA
If Length(TPA) = 0 Then //if C1 not found then
FindColorsSpiralTolerance(MMCX, MMCY, TPA, C2, MMX1, MMY1, MMX2, MMY2, 7); //does the same with C2
TDPA := TPAtoATPAEx(TPA, 20, 20); //splits the TPA of all of the pixels found into 20X20 boxes.
SortATPAFromFirstPoint(TDPA, SortPoint); //sorts the 20X20 boxes based on their distance from SortPoint
H := High(TDPA); //Number of 20X20 boxes made
For i := 0 To H Do
Begin
MiddleTPAEx(TDPA[i], x, y); //Makes x,y the middle of a 20X20 box
If rs_OnMinimap(x,y) Then //if that point is on the minimap
Begin
MouseFlag(x + XM, y + YM, XR, YR, 0); //click it/flag
Result := True;
Wait(200 + Random(80));
ColorToleranceSpeed(cts);
Exit;
End;
End;
Result := False;
ColorToleranceSpeed(cts);
End;