SRL Archive - Help and Support

Ultimate Finder *kinda...*


Special Ed

2007-04-15 14:02:26

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- EDITED ENTIRE POST -=-=-=-=-=-=-=-=-=-=-=-=-=-
I made it a procedure and fixed a lot of bugs so I had to rewrite some stuff as not to confuse people that had already read my post.

Well I've been working on this idea that I got to use the Minimap to find things on the Mainscreen. After a few days of testing and working I've finally gotten it down to a pretty good formula, so I've decided to post it and get some feedback. What it does is finds a DTM in a certain area in the Minimap around your dot and then clicks on it in the Mainscreen.

I only have a few bugs to work out so I'm going to need some testers and maybe someone who is good at math. Also I don't know if I should use DTM's or Bitmap's, I was kinda leaning towards bitmaps because then you can use more tolerance and formability to find it but I think it would find too many other things. On the other hand DTM's are a lot more accurate please post your thoughts it would be much appreciated.

I need you test it and just tell me what It needs where it does / doesn't work any thoughts on it please post feedback I'm going to post this in New Functions as soon as I get all the bugs worked out of it.

Heres the New Coding:

{*******************************************************************************
function MMtoMS(var x, y :integer; DTM :integer):boolean;
By: Special Ed
Description: Finds a DTM in the Minimap and returns co-ordinates
of the Object in the Mainscreen if found. [DTM Version]
*******************************************************************************}

function MMtoMS(var x, y :integer; DTM :integer):boolean;
var
XX,YY,MSTX,MSTY,Ptx,Pty,MSMX1,MSMY1,MSMX2,MSMY2:integer;
begin
MSMX1:= 623;
MSMY1:= 61;
MSMX2:= 673;
MSMY2:= 111;
if(not(FindDTM(DTM, MSTX, MSTY, MSMX1, MSMY1, MSMX2, MSMY2)))then
begin
result:= false;
Writeln('Could Not Find Tree');
end;
if(FindDTM(DTM, MSTX, MSTY, MSMX1, MSMY1, MSMX2, MSMY2))then
begin
XX:= Trunc(MSTX - MMCX);
YY:= Trunc(MSTY - MMCY);
Ptx:= Trunc(XX * 7.5);
Pty:= Trunc(YY * 7.25);
x:= (MSCX + Ptx);
y:= (MSCY + Pty);
result:= true;
Writeln('Found Tree');
end;
end;

{*******************************************************************************
function MMtoMS(var x, y :integer; Bitmap, Tol :integer):boolean;
By: Special Ed
Description: Finds a Bitmap in the Minimap and returns co-ordinates
of the Object in the Mainscreen if found. [Bitmap Version]
*******************************************************************************}

function MMtoMS(var x, y :integer; Bitmap, Tol :integer):boolean;
var
XX,YY,MSTX,MSTY,Ptx,Pty,MSMX1,MSMY1,MSMX2,MSMY2:integer;
begin
MSMX1:= 623;
MSMY1:= 61;
MSMX2:= 673;
MSMY2:= 111;
if(not(FindBitmapToleranceIn(Bitmap,MSTX, MSTY, MSMX1, MSMY1, MSMX2, MSMY2, Tol)))then
begin
result:= false;
Writeln('Could Not Find Tree');
end;
if(FindBitmapToleranceIn(Bitmap,MSTX, MSTY, MSMX1, MSMY1, MSMX2, MSMY2, Tol))then
begin
XX:= Trunc(MSTX - MMCX);
YY:= Trunc(MSTY - MMCY);
Ptx:= Trunc(XX * 7.5);
Pty:= Trunc(YY * 7.25);
x:= (MSCX + Ptx);
y:= (MSCY + Pty);
result:= true;
Writeln('Found Tree');
end;
end;

Looks simple I wonder why no one has ever posted something like this before it's such a great idea, am I missing some huge drawback or has no one ever though of this before?

nielsie95

2007-04-15 15:37:24

Tested this at Draynor with normal Trees and Willows, and it both didn't find them. After I made my own DTM of a normal Tree it worked great! This could turn out great :)

EDIT: Also tested at Varrock West Tree's and Oaks and both didn't work with your DTM

Special Ed

2007-04-15 15:56:50

Thanks for testing, but what brightness did you have it on, and do you mind posting your DTM, because if it works for me too I'll be more than glad to credit you for it if I can use it. XD
It must just be a different server / computer thing because I was testing it at varrock and It worked fine for me. Also what do you think about the whole DTM vs Bitmap?

EDIT: Hey I made it into a procedure.

[This one Clicks]
//Click is if you want it to click the object or not. DTM is self explanitory...
procedure MMtoMS(DTM :integer; Click :boolean);
var
XX,YY,MX,MY,MSTX,MSTY,SearchMod,Ptx,Pty,MSMX1,MSMY1,MSMX2,MSMY2:integer;
begin
MSMX1:= 623;
MSMY1:= 61;
MSMX2:= 673;
MSMY2:= 111;
SearchMod:= 1;
if(not(FindDTM( DTM, x, y, MSMX1, MSMY1, MSMX2, MSMY2)))then
begin
if(not(FindDTM( DTM, x, y, MMCX - SearchMod, MMCY - SearchMod, MMCX + SearchMod, MMCY + SearchMod)))then
begin
repeat
SearchMod:= (SearchMod + 1);
if(SearchMod >= 72)then Writeln('Cannot Find Tree');
until(FindDTM( DTM, x, y, MMCX - SearchMod, MMCY - SearchMod, MMCX + SearchMod, MMCY + SearchMod) or (SearchMod >= 72));
end;
if(FindDTM( DTM, MX, MY, MMCX - SearchMod, MMCY - SearchMod, MMCX + SearchMod, MMCY + SearchMod))then
begin
Mouse( MX, MY, 2, 2, true);
Wait(500);
Writeln('Found Tree In Minimap');
Flag;
Wait(500);
end;
end;
if(FindDTM( DTM, MSTX, MSTY, MSMX1, MSMY1, MSMX2, MSMY2))then
begin
Writeln('Found Tree In MainScreen');
XX:= Trunc(MSTX - MMCX);
Writeln('MSTX (DTMTree in Minimap): ' + inttostr(MSTX));
YY:= Trunc(MSTY - MMCY);
Writeln('MSTY (DTMTree in Minimap): ' + inttostr(MSTY));
Ptx:= Trunc(XX * 7.5);
Writeln('Ptx (Distance from MainScreen Center): ' + inttostr(Ptx));
Pty:= Trunc(YY * 7.25);
Writeln('Pty (Distance from MainScreen Center): ' + inttostr(Pty));
if(Click = true)then Mouse( MSCX + Ptx, MSCY + Pty, 0, 0, true);
if(Click = false)then MMouse( MSCX + Ptx, MSCY + Pty, 0, 0);
end;
end;

[This One Returns (x,y) values of the Object on the Mainscreen]
Procedure MMtoMS(var x, y :integer; DTM :integer);
var
XX,YY,MX,MY,MSTX,MSTY,SearchMod,Ptx,Pty,MSMX1,MSMY1,MSMX2,MSMY2:integer;
begin
MSMX1:= 623;
MSMY1:= 61;
MSMX2:= 673;
MSMY2:= 111;
SearchMod:= 1;
if(not(FindDTM( DTM, x, y, MSMX1, MSMY1, MSMX2, MSMY2)))then
begin
if(not(FindDTM( DTM, x, y, MMCX - SearchMod, MMCY - SearchMod, MMCX + SearchMod, MMCY + SearchMod)))then
begin
repeat
SearchMod:= (SearchMod + 1);
if(SearchMod >= 72)then Writeln('Cannot Find Tree');
until(FindDTM( DTM, x, y, MMCX - SearchMod, MMCY - SearchMod, MMCX + SearchMod, MMCY + SearchMod) or (SearchMod >= 72));
end;
if(FindDTM( DTM, MX, MY, MMCX - SearchMod, MMCY - SearchMod, MMCX + SearchMod, MMCY + SearchMod))then
begin
Mouse( MX, MY, 2, 2, true);
Wait(500);
Writeln('Found Tree In Minimap');
Flag;
Wait(500);
end;
end;
if(FindDTM( DTM, MSTX, MSTY, MSMX1, MSMY1, MSMX2, MSMY2))then
begin
Writeln('Found Tree In MainScreen');
XX:= Trunc(MSTX - MMCX);
Writeln('MSTX (DTMTree in Minimap): ' + inttostr(MSTX));
YY:= Trunc(MSTY - MMCY);
Writeln('MSTY (DTMTree in Minimap): ' + inttostr(MSTY));
Ptx:= Trunc(XX * 7.5);
Writeln('Ptx (Distance from MainScreen Center): ' + inttostr(Ptx));
Pty:= Trunc(YY * 7.25);
Writeln('Pty (Distance from MainScreen Center): ' + inttostr(Pty));
x:= (MSCX + Ptx);
y:= (MSCY + Pty);
end;
end;