SRL Archive - RS3 Help

Thinks player is not logged in


Thisaintmeyo

2014-10-05 09:42:10


lobby.findPlayButton(p);
mouse(p.rand(randomRange(-50, 50), randomRange(-10, 10)), MOUSE_LEFT);

Directly after it finds then clicks play the script ends, after looking around I found it ends if players are not logged in so I put…


if not isLoggedIn() then
begin
players[currentPlayer].login();
end;

… in the main loop and it keeps saying it can not find the log in box, so now that I know that is the case I thought I would log the player out instead of clicking the play button (I have to have the player logintolobby to fix settings) then full login to continue.

Before I did that though I thought I would ask and see if there was a command for the script to register the player as logged in or would I be better off either logging them out then back in or put in a if not Isloggedin() in there? :duh:

Thisaintmeyo

2014-10-05 10:01:35

I guess I just don't understand why it thinks the player is logged out if I log them into the lobby in order to fix the settings.

Simbanoobie

2014-10-07 14:17:25

function isLoggedIn(): boolean;
const
LOGOUT_BUTTON_COLOUR = 3446209;
begin
result := (getColor(796, 3) = LOGOUT_BUTTON_COLOUR);

if (result) and (not __areDynamicInterfacesSet) then
__setDynamicInterfaces();
end;

When you are in the lobby, it considers you logged out because of how the logged in function works. It checks for the color of the logout button in the top left right corner of the screen. If it doesn't find it, it considers you logged out. Because this doesn't show in the lobby, it thinks you are logged out.

You could modify the logged in function to also return true when in the lobby (by using lobby.isOpen), but then you will have to click the play button manually whenever you want to go from the lobby to the actual game.

Turpinator

2014-10-07 14:25:35

lobby.isOpen()
as well as
players[currentPlayer].loginToLobby();
instead of
players[currentPlayer].login();

The Mayor

2014-10-07 16:41:33

This is simply a case of an outdated SRL

Lipcot

2014-10-07 17:17:41

From: The Mayor
This is simply a case of an outdated SRL


'TheDoctor'

ontopic: yeah, you should update SRL, plugins, extensions and simba to its newer version. I've erased all of mine and re-installed fresh and now eeverything works like a charm, i reccomend everyone does that

The Mayor

2014-10-07 17:20:14

From: undorak7
'TheDoctor'


That is officially reserved for BenLand100 :p


E: remembered this https://villavu.com/forum/member.php?u=6348