rj
2013-03-28 15:53:20
So I am using this function to gather colors on the minimap and test their distance between each other, and if they are a certain distance between each other then it will click there but it does not seem to be working:
Anybody know what I'm doing wrong?
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.simba}
Procedure WalkPoint;
Var
Point_1, Point_2, Spot_Click: TPointArray;
Point_1_ATPA, Point_2_ATPA, Spot_ATPA: T2DPointArray;
I, J, K, Dist_Get_1, Dist_Get_2, Moves:Integer;
Begin
FindColorsTolerance(Point_1, 2442088, 547, 33, 710, 193, 25);
FindColorsTolerance(Point_2, 404792, 547, 33, 710, 193, 25);
FindColorsTolerance(Spot_Click, 5658204, 547, 33, 710, 193, 25);
SplitTPAWrap(Point_1, 7, Point_1_ATPA);
SplitTPAWrap(Point_2, 7, Point_2_ATPA);
SplitTPAWrap(Spot_Click, 7, Spot_ATPA);
DebugATPABounds(Point_1_ATPA);
DebugATPABounds(Point_2_ATPA);
DebugATPABounds(Spot_ATPA);
SetLength(Point_1, 15);
SetLength(Point_2, 15);
for I:= 0 To High(Point_1) Do
for J:= 0 To High(Point_2) Do
//for K:= 0 To High(Spot_Click) Do
begin
Moves := 0;
Repeat
if (Length(Spot_Click) = 0) or
(Length(Point_1) = 0) or
(Length(Point_2) = 0)then
Begin
Writeln('No colors were found');
Exit;
End;
If Moves >= 15 Then
Begin
Writeln('Moves > 15 stopping')
Exit;
End;
Moves := Moves +1
Dist_Get_1 := Distance(Spot_Click[0].x, Spot_Click[0].y,Point_1[0].x,Point_1[0].y);
Dist_Get_2 := Distance(Spot_Click[0].x, Spot_Click[0].y,Point_2[0].x,Point_2[0].y);
If (Dist_Get_1 <= 39) and (Dist_Get_2 <= 39) and
(Dist_Get_1 >= 2) and (Dist_Get_2 >= 2) Then
Begin
Writeln('colors were found');
mmouse(Spot_Click[0].x,Spot_Click[0].y,1,1)
ClickMouse2(Mouse_Left)
// While (SS_FFlag) Do
Wait(50)
Exit;
End;
Until Moves > 15
End;
End;
begin
MouseSpeed := 15;
WalkPoint;
end.Anybody know what I'm doing wrong?