SRL Archive - SRL Archives

RangerFlag; & RangerFFlag;


Ranger135xp

2007-01-01 20:36:38

well, I like these 2 procedures and they work VERY nicely for me and my scripts.

I think they should be included, but that's just my opinion (lol).

If you use them correctly, they oughta work rele nicely for ya

Here they are:
{*******************************************************************************
procedure RangerFlag:boolean;
by: Ranger135xp
Description: Waits while the flag exists. Great for actions where the flag
can hang on the screen, like mining or woodcutting.
*******************************************************************************}

Procedure RangerFlag;
Var WaitInt:Integer;
Begin

Repeat
If(FlagPresent) then
begin
Wait(1000+Random(500));
WaitInt:=WaitInt+1;
end;
Until(not(FlagPresent) or (WaitInt = 3))
end;

{*******************************************************************************
procedure RangerFFlag:boolean;
by: Ranger135xp
Description: Waits while the flag exists. Great for Walking.
Even waits half a second after flag goes away because char is still in transit.
*******************************************************************************}

Procedure RangerFFlag;
Begin
Wait(3000+Random(500)); //Waits because the flag may be hidden in the northern areas of the minimap
Repeat
If(FlagPresent) then
begin
Wait(500+Random(500));
end;
Until(not(FlagPresent))
Wait(500);
end;

Srl is needed for these to function.

Use RangerFlag; for "action" clicks(mining, woodcutting, etc.)
Use RangerFFlag; for walking. (since the flag doesn't normally hang when walking)

Yakman

2007-01-02 10:45:22

these functions already exists

Flag; waits while the flag exists
FFlag(distance:integer); waits until the flag is distance pixels away from your player, it also has features like sometimes moving the mouse around and clicking in case your player gets stuck

FFlag is the best i think, i even use it when i just want to get to the flag like FFlag(0);

tarajunky

2007-01-02 11:52:32

These procedures are slightly different than those in SRL, but the differences are pretty nuanced.

I'm all for customizing SRL procedures to behave exactly how you want them to, but unless a function does something significantly different than an existing function, or does something better in a way that is new or unusual it should not be added.

Anybody can type out Flag; Wait(500); In fact, it is probably easier than typing RangerFFlag. No offense.

Even as Devs we have ideas that we write up and use in our own scripts, but are not added to SRL, mainly because we want to keep SRL clean and keep it from growing exponentially and getting out of hand.

Definitely keep making custom procedures like this. And definitely make posts about them to help other people. In the future you may want to explain more about exactly what you use your functions for and in what situations they work better than core SRL functions.

For example, you say that you use RangerFFlag for walking. That's fine, but it might not do what some people want to do when they are walking. Some people prefer to have their characters walk without stopping after every click, so for those people your procedure would be worse than the SRL ones. But if you explained that you use it for making more accurate walking movements, since it allows your character to fully reach the destination after each click, then people would probably understand better why you made it and where they might want to use it in their own scripts.

Ranger135xp

2007-01-02 19:13:04

ok, maybe RangerFFlag is a similar, but u have to agree RangerFlag; works nicely when doing a skill action (mining, woodcutting, etc.). I know that with the mining guild, the flag can hang A LOT. but I checked on Flag and FFlag, 1 of them wants to wait like 15 seconds. wtf? no offense, but y do i want to have my script wait 15 seconds b4 it ignores the flag. I mean, in the guild, it does get stuck often sometimes. Some of your wait times are extreme. Like 20-30mins b4 loggin after findmod. holy heck, i turned mine down to like 10 or so, i still have all my guys intact.

Don't knock it b4 u try it, RangerFlag is beast for scripts like that, (mining and wc tested). i've had the flag hang a lot and it ignores it in 3-7 seconds.

Well, i know i'm having a thread that will allow download of my RangerFunction.scar include. which also includes a nice location-fitting version of fawki's simplebank. it has multiple locs like the popular seers, var west, fally east, draynor, al kharid, etc.. probably more to be added later. soon to have every bank.

WhiteShadow

2007-01-03 01:23:51

From: Ranger135xp
ok, maybe RangerFFlag is a similar, but u have to agree RangerFlag; works nicely when doing a skill action (mining, woodcutting, etc.). I know that with the mining guild, the flag can hang A LOT. but I checked on Flag and FFlag, 1 of them wants to wait like 15 seconds. wtf? no offense, but y do i want to have my script wait 15 seconds b4 it ignores the flag. I mean, in the guild, it does get stuck often sometimes. Some of your wait times are extreme. Like 20-30mins b4 loggin after findmod. holy heck, i turned mine down to like 10 or so, i still have all my guys intact.

Don't knock it b4 u try it, RangerFlag is beast for scripts like that, (mining and wc tested). i've had the flag hang a lot and it ignores it in 3-7 seconds.

Well, i know i'm having a thread that will allow download of my RangerFunction.scar include. which also includes a nice location-fitting version of fawki's simplebank. it has multiple locs like the popular seers, var west, fally east, draynor, al kharid, etc.. probably more to be added later. soon to have every bank.


procedure OManFlag(MaxMark : Integer);
begin
MarkTime(Mark);
while (FlagPresent) or (TimeFromMark(Mark) < MaxMark) do
Wait(100);
end;

Then users will have more control over there Flag waits, but anyways thanks for good contribution. :D

tarajunky

2007-01-03 12:08:15

This is the version I have used in my scripts for several weeks now…

procedure SafeFlag;
var i,xl,yl:integer;
begin
repeat
wait(50);
i:=i+1;
if not(FlagPresent) then exit;
until (i>=80);
if (FlagPresent) then
begin
if FindColor(XL, YL, 255, MMX1, MMY1, MMX2, MMY2) then
Mouse(XL, YL+14, 2, 2,true) else Mouse(MMCX,MMCY,5,5,true);
end;
SafeFlag;
end;

I feel the same way about waiting around for the flag to disappear, even for15 seconds, which is why I wrote this and use it. In SOME scripts that makes no sense. However, in a script that does a lot of walking, FFlag is probably better because you don't want your script assuming that the flag is stuck while you are still walking.

I think most Devs probably think that FFlag is fine 95% of the time. Waiting 15 seconds when the flag sticks is not a real problem, more of an annoyance. And for people that want to further customize it, like you and me, we can always do that.

In a script designed with RangerFlag in mind, it might be 100 times better than FFlag. But in a script written with FFlag in mind, RangerFlag might be 100 times worse and muck it all up. You're really getting down to fine tuning a script when you start making nuanced changes to the flag-sticking time. And I don't think that SRL is about fine tuning. That is up to the scripter.

Ranger135xp

2007-01-03 17:45:52

nice, I like all of these, i may use them. May I compile them into my RangerFunction include I use? even if not downloadable, full credit will be given to author of procedure.

Ranger135xp

2007-01-03 17:48:21

procedure OManFlag(MaxMark : Integer);
begin
MarkTime(Mark);
while (FlagPresent) or (TimeFromMark(Mark) < MaxMark+Random(500)) do
Wait(100);
end;

the random I threw in there, remember, u can't forget that lol. :)

WhiteShadow

2007-01-03 22:55:46

From: Ranger135xp
procedure OManFlag(MaxMark : Integer);
begin
MarkTime(Mark);
while (FlagPresent) or (TimeFromMark(Mark) < MaxMark+Random(500)) do
Wait(100);
end;

the random I threw in there, remember, u can't forget that lol. :)


Yea I guess so, but I wrote that in 5 seconds literally, so meh. I also noticed that it should be while and do not while or do. :D