Log in

View Full Version : FindDistance Function Suggestion



Dustin
09-09-2006, 09:21 AM
Hey Guys! I dunno if ithis is in SRL already...i dont have a copy currently

I just wanted to suggest a function like mine below for SRL users to
use for less flagging.


This function would determine if the distance from your white dot(648,83) to the flag(x,y) is less then or greater then your set distance (d)

if l:=0 then the function will look for a less then
if not then it will look for a greater then and return true or false


function finddistance(x , y , d , l : integer) : boolean ;
begin
findcolorspiraltolerance(x,y,001234,20,0,0,500,500 )//white char dot I dunno if theres a less //laggy find color then this
if l=0 then //if less then it true
begin
if (x-648)+(y-83) < d then result:=true //finds distance
else result:=false
if l=1 then
begin
if (x-648)+(y-83) > d then result:=true
else result:=false
end;
end;
end;

bobert5696
09-09-2006, 02:30 PM
it exists, not sure ifits exactly what you want, read the SRL manual, and go to the map walk section, its a few functions under "Flag;" i think

Cheesehunk
09-09-2006, 11:30 PM
There are already many procedures in SRL which do this, good effort though!:) Just look under MouseFlag.scar in the SRL core.

Yakman
09-10-2006, 09:55 AM
theres 2 procedures that do this

humanflag(
fflag(

//they all wait until you are the specified distance from the flag

Dustin
09-13-2006, 04:00 AM
Great minds think alike huh? Damn.