Avaphi
2007-01-16 19:26:46
Hello there people ! I am here to give you a little function I made a while back. It works REALLY well when finding square objects such as rocks, fishing holes etc(I used it for fishing). Well, here it is :
If you want to know how to use it, Just ask !
Var
Dx1, Dy1, Dx2, Dy2 : Integer;
//Use this to find parameters of objects dynamically allowing to never click outside of area.
function AvaphiFindArea(S1, S2, S3: String; Color, Tolerance : Integer): Boolean;
begin
if(FindColorSpiralTolerance(x, y, Color, MSX1, MSY1, MSX2, MSY2, Tolerance))then
begin
Mmouse(x, y, 0, 0);
Result := True;
repeat
if(IsUpTextMulti(S1, S2, S3))then
begin
Mmouse(x-1, y, 0, 0);
end;
until(not(IsUpTextMulti(S1, S2, S3)))
Mmouse(x+1, y, 0, 0);
repeat
if(IsUpTextMulti(S1, S2, S3))then
begin
Mmouse(x, y+1, 0, 0);
end;
until(not(IsUpTextMulti(S1, S2, S3)))
Mmouse(x, y-1, 0, 0);
Getmousepos(Dx1, Dy1);
Writeln('XS Of Box :='+inttostr(Dx1));
Writeln('YS Of Box :='+inttostr(Dy1));
Writeln('/////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\');
repeat
if(IsUpTextMulti(S1, S2, S3))then
begin
Mmouse(x+1, y, 0, 0);
end;
until(not(IsUpTextMulti(S1, S2, S3)))
Mmouse(x-1, y, 0, 0);
repeat
if(IsUpTextMulti(S1, S2, S3))then
begin
Mmouse(x, y-1, 0, 0);
end;
until(not(IsUpTextMulti(S1, S2, S3)))
Mmouse(x, y+1, 0, 0);
Getmousepos(Dx2, Dy2);
Writeln('XE Of Box:='+inttostr(Dx2));
Writeln('YE Of Box:='+inttostr(Dy2));
end;
end;
If you want to know how to use it, Just ask !