SRL Archive - Outdated / Broken

Flag Lag


Krazy_Meerkat

2006-05-14 18:18:48

I was improving a flax spinner for falador (a while ago) and I noticed that sometimes, when loading a map, the flag will hold it's position and your player will stop walking. This causes some scripts to time out and I was wondering if anyone else has experienced this problem or has a solution.
My solution would be to check the flag's position in FlagPresent; or whatever procedure it is now and re-click if the position remains the same after a few checks.
I don't know if it is that much of a problem for anyone else, but it could be a problem we just never knew about. Post your opinions please

weaselforce

2006-05-14 20:23:11

i know what you mean, this sounds like a great solution.

phantombmx

2006-05-14 21:25:50

yes i have had this trouble with some tests i have done..

it could be changed in Flag; fairly easily just using a time check.. like this (i know its sloppy but it gets the point across)

procedure Flag;
var flagmark, cx, cy : integer;
begin
if(FindBitmapIn(flag, cx, cy, MMX1, MMY1, MMX2, MMY2))then
begin
MarkTime(flagmark);
repeat
Wait(10);
until(not(FindBitmapIn(flag, cx, cy, MMX1, MMY1, MMX2, MMY2)))or(TimeFromMark(flagmark)>=10000)
if(FindBitmapIn(flag, cx, cy, MMX1, MMY1, MMX2, MMY2))then
begin
MarkTime(flagmark);
Mouse(cx+4, cy+6, 0, 0, true); //clicks flags bottom
repeat
Wait(10);
until(not(FindBitmapIn(flag, cx, cy, MMX1, MMY1, MMX2, MMY2)))or(TimeFromMark(flagmark)>=10000)
if(FindBitmapIn(flag, cx, cy, MMX1, MMY1, MMX2, MMY2))then
WriteLn('Flag is stuck');
end;
end;
end;

Krazy_Meerkat

2006-05-14 22:34:03

That's what I meant ^.^
The code looks fine to me, good stuff :)

WT-Fakawi

2006-05-14 23:58:57

duh. Use FFlag;!

phantombmx

2006-05-15 00:07:32

eh, FFlag works too.. i forgot about that one :p

The Un-Named

2006-05-15 00:31:15

From: WT-Fakawi
duh. Use FFlag;!


As I was searching through MapWalking.scar, I failed to find FFlag and didn't post. ;)

FFlag clicks until it finds the flag, very useful <3

Krazy_Meerkat

2006-05-15 00:46:04

Oh yeah woops.. There's too many procedures.

WT-Fakawi

2006-05-15 04:12:30

sorry for the edgyness, I had little time.

Yes FFlag is IMHO far more superior to Flag. It will break when it reaches a certain predefined pixeldistance from the flag (by drawing a little circle around minimap centre, looking for the color red (=Flag Color)), and it will wait 30 seconds for the flag to disappear. If the flag is still there, it assumes there is something wrong, (Flag-Hang) and it will replant the flag at the color red.

It was one of the first mindbreakers in trying to get SRL flawless/loopless.

The Un-Named

2006-05-15 05:13:41

I made somthing like FFlag, all it would do is wait until it's in a resonable distance from the center, that way you don't stop and it appears more human.

Krazy_Meerkat

2006-05-15 07:20:20

Not a problem fawk, next time I'll look around more.

WT-Fakawi

2006-05-15 07:31:29

From: The Un-Named
I made somthing like FFlag, all it would do is wait until it's in a resonable distance from the center, that way you don't stop and it appears more human.

FFlag does exactly the same thing, only it doesnt use complicated algos like distance etc, this one draws a cirlce around mm-centre at predefined Distance FFlag(Distance:integer): Boolean. [EDIT] It draws this circle only 4 times a second, so little lag[/EDIT]

Use Distance 10 for a nice smooth walk, without any stops!

The Prince of Randomness?

2006-05-15 16:02:32

From: The Un-Named
I made somthing like FFlag, all it would do is wait until it's in a resonable distance from the center, that way you don't stop and it appears more human.


Try HumanFlag ;)

phantombmx

2006-05-15 16:05:53

yeah i totally forgot it was there.. duh :p

well i got my point across with the post now didnt i? :)

The Un-Named

2006-05-15 16:10:14

From: The Prince of Randomness
Try HumanFlag ;)


I'm speechless. ;)

(Squig's didn't work well for me/usually nothing would lag but after about 4 seconds of it in the center it would click again)