Element17
04-17-2012, 10:36 PM
What is the difference? Is one better than the other? These are not my functions and I am just asking the differences and which is better than the other.
Function FindChicken(Var X, Y : Integer): Boolean; //Finds Object
Var
TPA : TPointArray;
ATPA : T2DPointArray;
I, H : Integer;
Begin
FindColorsSpiralTolerance(MSCX, MSCY, TPA, ChickenColor, MSX1, MSY1, MSX2, MSY2, 15);
ATPA := TPAtoATPA(TPA, 25); //25 distance between pixels
If Length(ATPA) = 0 Then //If no points were found
Exit;
H := High(ATPA);
For I := 0 To H Do
Begin
MiddleTPAEx(ATPA[I], X, Y); //Used to get the middle of the current sorted tpa
MMouse(X, Y, 3, 3);
Wait(50 + Random(50));
If IsUpText('hicken') Then
Begin
Writeln('Found chicken!');
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
Result := True;
Exit;
End;
End;
End;
Procedure FindStaris; //finds and climbs stairs
Var
MyTPA : TPointArray;
MyPoint : TPoint;
X, Y, i : Integer;
Begin
X := MSCx;
Y := MSCy;
FindColorsSpiralTolerance(x, y, MyTPA, 2961456, MSx1, MSy1, MSx2, MSy2, 10);
If Length(MyTPA) = 0 Then FindColorsSpiralTolerance(X, Y, MyTPA, Color, MSX1, MSY1, MSX2, MSY2, 10);
For i := 0 To High(MyTPA)Do
Begin
MyPoint := MyTPA[i]
MMouse (MyPoint.X, MyPoint.Y, 3, 3);
If (IsUpTextMultiCustom(['tair', 'case'])) Then
Begin
GetMousePos(x, y);
Mouse(X, Y, 0, 0, False);
ChooseOption('limb');
Wait(500+random(250));
Exit;
End;
Wait(350+random(350));
End;
End.
Function FindChicken(Var X, Y : Integer): Boolean; //Finds Object
Var
TPA : TPointArray;
ATPA : T2DPointArray;
I, H : Integer;
Begin
FindColorsSpiralTolerance(MSCX, MSCY, TPA, ChickenColor, MSX1, MSY1, MSX2, MSY2, 15);
ATPA := TPAtoATPA(TPA, 25); //25 distance between pixels
If Length(ATPA) = 0 Then //If no points were found
Exit;
H := High(ATPA);
For I := 0 To H Do
Begin
MiddleTPAEx(ATPA[I], X, Y); //Used to get the middle of the current sorted tpa
MMouse(X, Y, 3, 3);
Wait(50 + Random(50));
If IsUpText('hicken') Then
Begin
Writeln('Found chicken!');
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
Result := True;
Exit;
End;
End;
End;
Procedure FindStaris; //finds and climbs stairs
Var
MyTPA : TPointArray;
MyPoint : TPoint;
X, Y, i : Integer;
Begin
X := MSCx;
Y := MSCy;
FindColorsSpiralTolerance(x, y, MyTPA, 2961456, MSx1, MSy1, MSx2, MSy2, 10);
If Length(MyTPA) = 0 Then FindColorsSpiralTolerance(X, Y, MyTPA, Color, MSX1, MSY1, MSX2, MSY2, 10);
For i := 0 To High(MyTPA)Do
Begin
MyPoint := MyTPA[i]
MMouse (MyPoint.X, MyPoint.Y, 3, 3);
If (IsUpTextMultiCustom(['tair', 'case'])) Then
Begin
GetMousePos(x, y);
Mouse(X, Y, 0, 0, False);
ChooseOption('limb');
Wait(500+random(250));
Exit;
End;
Wait(350+random(350));
End;
End.