SRL Archive - OSR Help

I want to learn about Flag


rsbots2013

2013-05-28 23:47:19

I looked around the Scripting Help and tutorial page and didn't find a tutorial about flags. I am wanting to learn more about flags, especially since I want to put a flag command in my script.

If someone could link me to a good guide that would be appreciated.

What would I do to tell Simba to Look for flag on minimap and if the flag is more then 3 squares away to go to else?

x[Warrior]x3500

2013-05-29 00:21:20

just play around with the distances.

the method is called "fflag();"

fflag(0); = flag();

fflag(1); is a little further away from fflag(0);
fflag(4); is even further away from fflag(0);

euphemism

2013-05-29 01:11:29

4 pixels on the minimap is equal to one main screen tile, if that's of any help. So, a small code example:


program FlagFun;

{$i SRL\srl.simba}

var
x, y: integer;

begin

setupSRL;

if findFlag(x, y) then //If the flag is found, this stores the coordinates of the flag into the x and y variables.
if (distance(x, y, MMCX, MMCY) > 12) then //If the flag is found, we then compare the flag's position to the center of the minimap.
begin

writeln('More than three tiles away!');

//Code to excute because the condition was met.
end;
end.

Peanuts

2013-05-29 01:22:00

From: euphemism
4 pixels on the minimap is equal to one main screen tile, if that's of any help. So, a small code example:



Thanks so much!!
I never really knew the size of a pixel, that makes it easy to remember.