Special Ed
2007-04-07 12:07:37
Ok what I am trying to accomplish is to be able to use the minimap to find things on the mainscreen, i.e. finds the little tree thing on the minimap and can find it on the mainscreen if you are close enough to it.
I've gotten it to work once really good but then after that It doesn't always work, sometimes on and off it does but not a lot.
What I need help with is for you guys to help me find the ratios from the minimap to the mainscreen so like the top left corner of the mainscreen is where compared to the…. wait I think I may have just figured it out.
EDIT: ZOMG I did it!! the measurements of the view of the mainscreen to the MM are off a little bit but i got the ratios right. Oh this is sweet…
Anyways, if someone wants to try and find a "flat" piece of ground in rs and try to find out where the top of the mainscreen is on the minimap and the bottom ect. that would be cool.
Oh and here's my coding if anyone wants to critique it or maybe give me some input, its not perfect but i still got it to work.
P.S. If somone could try and help me make a DTM or Bitmap that works for all trees on the minimap that would be awsome. *mine kinda work*
I've gotten it to work once really good but then after that It doesn't always work, sometimes on and off it does but not a lot.
What I need help with is for you guys to help me find the ratios from the minimap to the mainscreen so like the top left corner of the mainscreen is where compared to the…. wait I think I may have just figured it out.
EDIT: ZOMG I did it!! the measurements of the view of the mainscreen to the MM are off a little bit but i got the ratios right. Oh this is sweet…
Anyways, if someone wants to try and find a "flat" piece of ground in rs and try to find out where the top of the mainscreen is on the minimap and the bottom ect. that would be cool.
Oh and here's my coding if anyone wants to critique it or maybe give me some input, its not perfect but i still got it to work.
P.S. If somone could try and help me make a DTM or Bitmap that works for all trees on the minimap that would be awsome. *mine kinda work*
program New;
{.include SRL/SRL.scar}
var DTMPlayer,DTMItem,DTMCreature,SearchMod,Ptx,Pty:integer;
DTMTree,DTMTree2,XX,YY,MX,MY,MSTX,MSTY,MSMX1,MSMY1,MSMX2,MSMY2:integer;
begin
SetupSRL;
Wait(500);
MakeCompass('N');
DTMTree := DTMFromString('78DA637463606070614001E11A0C0C42409A1' +
'188FF0301A33BA61A3F135E066EA81A100000F79F0641');
DTMTree2 := DTMFromString('78DA638C63606030664001EAEE9C609A11CA6' +
'78C0512A6A86AFC051818B890D5C461AA7193E140510300BD1D03' +
'11');
MSMX1:= 614;
MSMY1:= 57;
MSMX2:= 682;
MSMY2:= 103;
begin
SearchMod:= 15;
if(not(FindDTM(DTMTree,x,y, MSMX1, MSMY1, MSMX2, MSMY2))and(not(FindDTM(DTMTree2,x,y, MSMX1, MSMY1, MSMX2, MSMY2))))then
begin
if(not(FindDTM(DTMTree,x,y, MMCX - SearchMod, MMCY - SearchMod, MMCX + SearchMod, MMCY + SearchMod))and(not(FindDTM(DTMTree2,x,y, MMCX - SearchMod, MMCY - SearchMod, MMCX + SearchMod, MMCY + SearchMod))))then
begin
repeat
Writeln('Tree Not Found');
SearchMod:= (SearchMod + 1);
until(FindDTM(DTMTree,x,y, MMCX - SearchMod, MMCY - SearchMod, MMCX + SearchMod, MMCY + SearchMod) or (FindDTM(DTMTree2,x,y, MMCX - SearchMod, MMCY - SearchMod, MMCX + SearchMod, MMCY + SearchMod)) or (SearchMod >= 72));
end;
if(FindDTM(DTMTree,MX,MY, MMCX - SearchMod, MMCY - SearchMod, MMCX + SearchMod, MMCY + SearchMod) or (FindDTM(DTMTree2,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(DTMTree,MSTX,MSTY, MSMX1, MSMY1, MSMX2, MSMY2) or (FindDTM(DTMTree2,MSTX,MSTY, MSMX1, MSMY1, MSMX2, MSMY2)))then
begin
Writeln('Found Tree In MainScreen');
XX:= Trunc(MSTX - MSMX1);
Writeln('MSTX: ' + inttostr(MSTX));
YY:= Trunc(MSTY - MSMY1);
Writeln('MSTY: ' + inttostr(MSTY));
Ptx:= Trunc(XX * 7.5);
Writeln('Ptx: ' + inttostr(Ptx));
Pty:= Trunc(YY * 7.25);
Writeln('Pty: ' + inttostr(Pty));
MMouse(MSX1 + Ptx,MSY1 + Pty,2,2);
Wait(1000);
end;
Wait(100);
end;
end.