SRL Archive - SRL Archives

Lag Handler


Brown

2006-06-04 18:19:51

I had come to find that there isnt really any function to handle lag. A post in the applications reminded me to suggest the adding of a lag handling procedure. I created this quite a while ago when I ran into the problem on some scripts.

(I just pulled this out of my powerminer quick)
[php]Procedure HandleLag;
begin
//if blackscreen
if FindColorTolerance(x,y, 597099, 350, 300, 376, 320, 3) then
begin
wait(100+random(500));
mouse (390,340,5,5,true);
end;

//ifloggedout
if not loggedin then
begin
wait(100+random(500));
RandomNextPlayer(false);
end;
end;[/php]

Krazy_Meerkat

2006-06-04 20:38:49

How about something like this?
[php]Procedure HandleLag;
var
i : Integer;
begin //if blackscreen
if(FindColorTolerance(x,y, 597099, 350, 300, 376, 320, 3))then
begin
repeat
i:= i + 1;
wait(100+random(500)); //you could add some idleing stuff here if needed
until(not(FindColorTolerance(x,y, 597099, 350, 300, 376, 320, 3)))or(i > 15) //the logout stuff would be here..
end;
end;[/php]

Dark_Sniper

2006-06-05 00:23:39

{EDIT: aahahaha i got you before you edited your post even though it still might log you out mines better!}
From: Krazy_Meerkat
How about something like this?
[php]Procedure HandleLag;
begin //if blackscreen
if(FindColorTolerance(x,y, 597099, 350, 300, 376, 320, 3))then
begin
repeat
wait(100+random(500)); //you could add some idleing stuff here if needed
until(not(FindColorTolerance(x,y, 597099, 350, 300, 376, 320, 3))) //the logout stuff would be here..
end;
end;[/php]


somtims the lag causes you to logout. so…

[PHP]function HandleLag : Boolean;
begin //if blackscreen
if(FindColorTolerance(x,y, 597099, 350, 300, 376, 320, 3))then
begin
repeat
wait(100+random(500)); //you could add some idleing stuff here if needed
until(not(FindColorTolerance(x,y, 597099, 350, 300, 376, 320, 3))) or (not (loggedin)) //the logout stuff would be here..
if (not (loggedin)) then
Result:= False;
end
else
Result:= True;
end;[/PHP]

Krazy_Meerkat

2006-06-05 00:30:13

Lol I mustn't have seen you post.. I was just tidying mine up a little bit, it's a lil' example of what to do, not precise instructions to follow ;)

Dark_Sniper

2006-06-05 00:33:09

and i was just adding on to yours… also this may work… this makes it easier to tell what actully happened…

function HandleLag : String;
begin //if blackscreen
if(FindColorTolerance(x,y, 597099, 350, 300, 376, 320, 3))then
begin
repeat
Result:= 'Lag';
wait(100+random(500)); //you could add some idleing stuff here if needed
until(not(FindColorTolerance(x,y, 597099, 350, 300, 376, 320, 3))) or (not (loggedin)) //the logout stuff would be here..
if (not (loggedin)) then
Result:= 'Loggedout';
end
else
Result:= 'Fine';
end;

but stuff like thats much more difficult to use…