SRL Archive - SRL Archives

Logout fixed


Coh3n

2010-03-04 19:05:42

This will fully log out the player. I just added a GetColor/Mouse for the big X in the lobby. I also edited the ClickText from 'here' to 'obby'. I'm assuming I don't have the explain why. ;)

It can be further edited with a Boolean parameter to determine whether to fully logout, or just go to the lobby (would be useful for breaking and such). I didn't do this because I didn't know how many times Logout is used throughout SRL. I didn't want to cause a bunch of compiling errors.


function Logout: Boolean;
var
c, i: Integer;
begin
Result := (not (LoggedIn));
if Result = True then
Exit;
if (SRL_Procs[srl_OnLogOut] <> nil) then
SRL_Procs[srl_OnLogOut]();
if GameTab(tab_LogOut) = False then
Exit;
Wait(200 + Random(100));
while (LoggedIn) and (c < 10) do
begin
Inc(c);
if(ClickText('obb', UpChars, MIX1, MIY1, MIX2, MIY2, True))then
for i := 0 to 10 do
begin
Wait(1000);
if not(LoggedIn)then
if (GetColor(688, 34) = 6388871) then // here :)
begin
Mouse(688, 34, 12, 12, True);
Result := True;
Exit;
end;
end;
end;
end;

Comments?

Blumblebee

2010-03-04 19:07:53

From: Coh3n
This will fully log out the player. I just added a GetColor/Mouse for the big X in the lobby. It can be further edited with a Boolean parameter to determine whether to fully logout, or just go to the lobby (would be useful for breaking and such). I didn't do this because I didn't know how many times Logout is used throughout SRL. I didn't want to cause a bunch of compiling errors.


function Logout: Boolean;
var
c, i: Integer;
begin
Result := (not (LoggedIn));
if Result = True then
Exit;
if (SRL_Procs[srl_OnLogOut] <> nil) then
SRL_Procs[srl_OnLogOut]();
if GameTab(tab_LogOut) = False then
Exit;
Wait(200 + Random(100));
while (LoggedIn) and (c < 10) do
begin
Inc(c);
if(ClickText('obb', UpChars, MIX1, MIY1, MIX2, MIY2, True))then
for i := 0 to 10 do
begin
Wait(1000);
if not(LoggedIn)then
if (GetColor(688, 34) = 6388871) then // here :)
begin
Mouse(688, 34, 12, 12, True);
Result := True;
Exit;
end;
end;
end;
end;

Comments?


looks good, and I was thinking the same thing for (my version of) LogInPlayer, I have it always log the player completely out before it logs in again, even if its the same player so compiling issue's don't arise.

Coh3n

2010-03-04 19:09:50

From: Blumblebee
looks good, and I was thinking the same thing for (my version of) LogInPlayer, I have it always log the player completely out before it logs in again, even if its the same player so compiling issue's don't arise.

Exactly, if need be, other lobby functions can be made. It would be better for single player breaking, but I'll leave that up to the Dev's to decide. I'm sure they just want the logging in working before worrying about new functions. :)

i luffs yeww

2010-03-04 19:17:10

http://villavu.com/forum/showthread.php?t=55375

:3

Coh3n

2010-03-04 19:19:25

From: i luffs yeww
http://villavu.com/forum/showthread.php?t=55375

:3

Lol, that was s useless post as you already had my attention from Blumblebee's thread. Again, I posted my thoughts.

Gu3st...

2010-03-05 07:26:06

I would like to have a ExitToLobby; procedure

Dgby714

2010-03-05 07:30:35

From: Zyt3x
I would like to have a ExitToLobby; procedure


Update your srl, There is one!

Gu3st...

2010-03-05 08:20:56

From: Dgby714
Update your srl, There is one!
OH! Thanks :p

Dgby714

2010-03-05 08:26:44

From: Zyt3x
OH! Thanks :p


Theres also a new function
// * function AtLobbyScreen: Boolean;                                       // * by Dgby714