Jump to content
opiumhautopium1

function IdentIsland and FindIsland

Recommended Posts

wrote a function to ident Map and where the armed Island is

it return the coordinate of the island and the quater at MinniMap

(blue water maps ready but with the output it is possible for all maps)

u can include it in wundertütes gold scripts or wherever u want to ^^

program FindIsland;
//  mmx1,mmx2,mmy1,mmy2 = position minimap
var
insel : TIntegerArray;
mmx1,mmx2,mmy1,mmy2,inx,iny,ins,insel_tolerance : Integer;
procedure Loadvar;
begin //// u can add this to procedure Loadvar////
 insel_tolerance:=5;
 insel:=[2840966, 2905728, 3696533, 5341095, 3367825];
end;

function IdentIsland: Integer;
begin
 writeln('Kontrollpunkt IdentIsland');
 writeln('if  (inx>'+inttostr(inx-mmx1-6)+')and(inx<'+inttostr(inx-mmx1+6)+')and(iny>'+inttostr(iny-mmy1-6)+')and(iny<'+inttostr(iny-mmy1+6)+')');
 inx:= inx-mmx1;
 iny:= iny-mmy1;
 if  (inx>7)and(inx<19)and(iny>10)and(iny<22)   then writeln('Insel gefunden Map 6/1');
 if  (inx>40)and(inx<52)and(iny>31)and(iny<43)  then writeln('Insel gefunden Map 6/2');
 if  (inx>18)and(inx<30)and(iny>41)and(iny<53)  then writeln('Insel gefunden Map 6/3');
 if  (inx>62)and(inx<73)and(iny>51)and(iny<63)  then writeln('Insel gefunden Map 7/1');
 if  (inx>27)and(inx<39)and(iny>10)and(iny<22)  then writeln('Insel gefunden Map 7/2');
 if  (inx>26)and(inx<38)and(iny>41)and(iny<53)  then writeln('Insel gefunden Map 7/3');
 if  (inx>26)and(inx<38)and(iny>66)and(iny<78)  then writeln('Insel gefunden Map 7/4');
 if  (inx>73)and(inx<83)and(iny>38)and(iny<48)  then writeln('Insel gefunden Map 8/1');
 if  (inx>22)and(inx<34)and(iny>20)and(iny<32)  then writeln('Insel gefunden Map 8/2');
 if  (inx>7)and(inx<19)and(iny>10)and(iny<22)   then writeln('Insel gefunden Map 8/3');
 if  (inx>43)and(inx<55)and(iny>44)and(iny<56)  then writeln('Insel gefunden Map 8/4');
 if  (inx>55)and(inx<67)and(iny>32)and(iny<44)  then writeln('Insel gefunden Map 9/1');
 if  (inx>7)and(inx<19)and(iny>72)and(iny<84)   then writeln('Insel gefunden Map 9/2');
 if  (inx>69)and(inx<81)and(iny>66)and(iny<78)  then writeln('Insel gefunden Map 9/3');
 if  (inx>63)and(inx<75)and(iny>18)and(iny<30)  then writeln('Insel gefunden Map 9/4');
 if  (inx>72)and(inx<84)and(iny>59)and(iny<71)  then writeln('Insel gefunden Map 10/1');
 if  (inx>56)and(inx<68)and(iny>51)and(iny<63)  then writeln('Insel gefunden Map 10/2');
 if  (inx>40)and(inx<52)and(iny>72)and(iny<84)  then writeln('Insel gefunden Map 10/3');
 inx:= inx+mmx1;
 iny:= iny+mmy1;
 //terminatescript;
end;

function Findisland :integer;
begin
writeln('KontrollpunktFindisland');
result:=0;
for ins:=0 to High(insel) do
begin
   if (FindColorTolerance(inx, iny, insel[ins], mmx1, mmy1, mmx2, mmy2, insel_tolerance)=true) then
     begin
     result:= 1;
     writeln(' Island coordinate saved: '+inttostr(inx)+' /'+inttostr(iny));
     break;
     end else
     writeln('IslandColor '+inttostr(ins)+' not found');
 end;
 if result > 0 then
   begin
     if(iny<=mmy1+44) then  begin  writeln('Island k1 is up');      result:= result+1;  end;
     if(iny>mmy1+44)  then  begin  writeln('Island k2 is down');    result:= result+2;  end;
     if(inx>=mmx1+44) then  begin  writeln('Island k3 is right');   result:=result+20;  end;
     if(inx<mmx1+44)  then  begin  writeln('Island k4 is left');    result:=result+10;  end;
   writeln('IslandCornerNR is  '+inttostr(result)) ;
   end;        //terminatescript;
 IdentIsland;
end;

begin
/// add to ###  starting Mainloop ###
Findisland;
end.

Edited by opiumhautopium1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...