SRL Archive - OSR Help

Anti-Lag Pocedure?!


Harry

2007-10-27 00:11:54

When my dialup lags, this screen will pop up:

My script has:
if not(LoggedIn) then
begin
LoginPlayer;
Exit;
end;
so when this screen pops up, RS thinks it is logged out. SOOOO scar will write my username in the debug FOR EVER :| therefore making the script hang there till I execute it and restart it :( (which will get me a ban :| )

So, I was wondering if someone could make me a quick lil procedure to handle this screen so I wouldn't sit there for ever. Pwnaz0r made me one, but it was very laggy :redface:

Thanks in advance :)
~Harry

Santa_Clause

2007-10-27 02:17:57

function ClickedPlayRunescape : Boolean;
begin
if FindBitmap(x, y, BitmapOfRedThing) then
begin
Mouse(X, Y, 3, 3, True);
Wait(1000);
if LoggedIn then
Result := True;
end;
end;

begin
if ClickedPlayRunescape then
WriteLn('We Lagged : Logged Out And Then Back Into Same Player');
end;

The BitmapOfRedThing is the bitmap of the button that says 'Play Runescape'. Have fun.

Harry

2007-10-27 08:40:47

Thanks Santy :) Will credit you in script. Only thing I would change is the Wait of 1000. I would make it to 5000+Random(5000) ;)

ZephyrsFury

2007-10-27 10:26:53

Have you tried putting ActivateClient in every now and again. Or make a small function similar to the one below:


function LoggedIn2: Boolean;
begin
if (not(LoggedIn)) then
begin
ActivateClient;
Result := LoggedIn;
end;
end;

Harry

2007-10-27 10:34:56

This is what I used:

function ClickedPlayRunescape : Boolean; //Thanks to SantaClause! :)
var
ClickHereToPlay,x,y:integer;
begin
if not(LoggedIn) then
begin
LoginPlayer;
Exit;
Exit;
end;
ClickHereToPlay := BitmapFromString(33, 1, 'z78DA758E510E80300843' +
'AF54C0E2F6E94CB8FF9134123392693FFA41FA4A23A6F0888443D' +
'26DC000A7DCE7F458F23EE444E721444B6A0F53D58FE44F4365B7' +
'067D37AC3D95AADF2F50962C79');
if FindBitmap(x, y, ClickHereToPlay) then
begin
Mouse(X, Y, 3, 3, True);
Wait(5000+Random(5000));
FreeBitmap(ClickHereToPlay);
Exit;
Exit;
end;
end;

JuKKa

2007-10-27 10:59:28

to make it the fast way.. do something like this:


Function ConnectionLost: Boolean;
Var
Cx, Cy, ConnectionLostBmp: Integer;
Begin
If(FindColor(CX, CY, 0, 6, 3, 10, 10))Then
Begin
ConnectionLostBMP := BitMapFromString(10, 10, '');
If(FindBitmapIn(ConnectionLostBmp, CX, CY, 0, 0, 30, 30))Then
While(FindBitmapIn(ConnectionLostBmp, CX, CY, 0, 0, 30, 30))Do
Begin
Wait(5000+Random(2000));
If(Not Loggedin)Then
Result := LoginPlayer;
End;
FreeBitMap(ConnectionLostBMP);
End;
End;

Make a bitmap of the "connection lost" thingy =)

Harry

2007-10-27 11:04:30

Neh, when I lag it doesnt show that ;) it will just pop up the click here to play thing.