SRL Archive - Help

Having problems with LoggedIn


Wanted

2009-08-20 19:54:38

I'm running SCAR 3.21 and the latest SRL Dev revision, LoggedIn is returning false some times when it shouldn't causing mass chaos in my scripts :S

is anyone else experiencing this or a have a good quick fix/alternative for this?

Gu3st...

2009-08-20 19:59:13

Working for me :)
function LoggedIn: Boolean;
var
cx, cy: Integer;
begin
Result := FindColor(cx, cy, 16777215, 439, 491, 440, 492);
end;
Just for comparing.

Wanted

2009-08-20 20:09:13

Seems to work but I'm still getting havoc in my script…. ughh this just doesn't seem possible how this is happening. Maybe it only fails rarely??

I think it's because when you get a SMART white screen thing it picks you up as being logged in.

Heysus

2009-08-20 20:22:49

It really should have a failsafe in my opinion. Maybe something like this:

function LoggedIn: Boolean;
var
cx, cy, i: Integer;
begin
for i:=0 to 2 do
begin
Result := FindColor(cx, cy, 16777215, 439, 491, 440, 492);
if Result then
exit;
Wait(250);
end;
end;

Wanted

2009-08-20 20:28:49

From: Heysus
It really should have a failsafe in my opinion. Maybe something like this:

function LoggedIn: Boolean;
var
cx, cy, i: Integer;
begin
for i:=0 to 2 do
begin
Result := FindColor(cx, cy, 16777215, 439, 491, 440, 492);
if Result then
exit;
Wait(250);
end;
end;


That and it's the same color as WHITE which is extremely common to be picked up falsely by lag or by SMART's annoying white screen… I think the color should be changed to the red part of the report button and have that wait in there…. this is causing mass havoc in certain scenarios.

I made this

{*******************************************************************************
function LoggedIn: Boolean;
By: IceFire908.
Description: Detects if you're logged in and compensates for white screen lag,
general lag, and false detections.
*******************************************************************************}

function LoggedIn: Boolean;
var
P: TPoint;
I: Byte;
begin
for I := 1 to 10 do
begin
Result := FindColor(P.X, P.Y, 2302834, 404, 481, 514, 502);
if (not (Result)) then
Result := FindColor(P.X, P.Y, 3816406, 404, 481, 514, 502);
if (Result) then
Exit;
Wait(200);
end;
end;

Lance

2009-08-21 02:31:48

function PlayerLoggedIn : Boolean;
var
i : Integer;
begin
i := GetMe.Combat
if i <> 0 then Result := True;
end;

I made this after LoggedIn kept on screwing up my scripts. havent had an issue since :P

senrath

2009-08-21 02:41:29

From: lancerawks aka Lance
function PlayerLoggedIn : Boolean;
var
i : Integer;
begin
i := GetMe.Combat
if i <> 0 then Result := True;
end;

I made this after LoggedIn kept on screwing up my scripts. havent had an issue since :P

That only works for reflection, and if you're using reflection, you might as well use R_LoggedIn.

Lance

2009-08-21 05:06:17

truee…. but i like the feeling of achevement you get when you make something that works :L

Wanted

2009-08-21 05:10:21

From: lancerawks aka Lance
truee…. but i like the feeling of achevement you get when you make something that works :L


ummm

function PlayerLoggedIn : Boolean;
begin
Result := (GetMe.Combat > 0);
end;

why did you put a variable in there? :confused:

Hybrid ftw

function PlayerLoggedIn : Boolean;
begin
Result := (GetMe.Combat > 0);
if (not (Result)) then
Result := LoggedIn;
end;

Method

2009-08-21 06:50:19

From: IceFire908
ummm

function PlayerLoggedIn : Boolean;
begin
Result := (GetMe.Combat > 0);
end;

why did you put a variable in there? :confused:

Hybrid ftw

function PlayerLoggedIn : Boolean;
begin
Result := (GetMe.Combat > 0);
if (not (Result)) then
Result := LoggedIn;
end;


From: senrath
That only works for reflection, and if you're using reflection, you might as well use R_LoggedIn.


Please, this.