SRL Archive - SRL Archives

Function - AvaphiFindArea


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 :
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 !

Bam Bam

2007-01-17 16:14:36

It looks interesting but it would be easier to understand if the standards weren't messed up.

Lorax

2007-01-17 17:43:38

does it even compile? ;)
It's to macro like, you should check out my Karamja Fisher at rs-resources, in my application for fishing that's what you want to do :)

Avaphi

2007-01-17 19:12:47

Feel free to standardize and post, Ill edit mine :)

Lorax. It is a function, with no main loop so no, it doesnt compile, but if used like a function in a script, then it will work good :)

XcanadamanX

2007-01-20 16:50:20

can you pm me on how to use this or just explain here. thanks

Avaphi

2007-01-20 17:44:43

To find a fishing hole:
if(AvaphiFindArea('Fish', 'ing', 'pot', Color, Tolerance)Then 
Clickmouse;

PS: I updated my function…. so update yours !

Thanks starblaster for the fix.