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