Login

The Login include contains all the functions to succesfully log you in and out of the game and/or the lobby.

LobbyScreen

function LobbyScreen: Boolean;

Returns true if we are at the Lobby Screen

Note

by IceFire908 & Bionicle1800

Example:

// wait for the Lobby Screen to appear!
while (not LobbyScreen) do
  Wait(100 + Random(400));

TakeIPScreen

procedure TakeIPScreen();

Saves a screenshot of the last logged in IP address to the SRL logs folder.

Note

by Harry & Coh3n

Example:

TakeIPScreen();

RSReady

function RSReady: Boolean;

Returns true if we are ready to auto (on loginscreen or logged in). Useful for waiting until RS has fully loaded.

Note

by ZephyrsFury - Edited by [J]ustin

Example:

while (not RSReady) do
  SleepAndMoveMouse(100 + Random(500));

Login_SetAudio

procedure Login_SetAudio(Volume, SFX, Area: Integer; SMSetting: TSMSetting);

Sets audio options through the login screen. Use: Enter the desired Setting for the desired Option. Make option 0 for no change.

Note

by ZephyrsFury, fixed by Markus

Example:

Login_SetAudio(1, 5, 2, NoChange);

Login_SetGraphics

procedure Login_SetGraphics(Brightness: Integer);

Sets graphic options in the login screen.

Note

by ZephyrsFury, fixed by Markus

Example:

Login_SetGraphics(4);

SetAudioOff

procedure SetAudioOff;

Sets the Audio to off (1 for each bar). Works logged in and out.

Note

by ZephyrsFury

Example:

// sounds are annoying, let's turn them off
setAudioOff();

SetAutoingDefaults

procedure SetAutoingDefaults;

Sets the graphic options for best SRL compatibility. Works both logged in and out.

Note

by ZephyrsFury

Example:

procedure SetupScript();
begin
  SetAutoingDefaults(); // set the graphics options appropriately
end;

ValidEmail

function ValidEmail: Boolean;

Recognizes and handles the “Validate Email” screen in RS.

Note

by NCDS

Example:

if not ValidEmial then
  writeLn('Failed to get past verification screen');

ExitToLobby

function ExitToLobby: Boolean;

Exits to the Lobby (for breaks?)

Note

by Starblaster100, Raymond, IceFire908, & Tarajunky

Example:

// world switch!
if (ExitToLobby()) then
  SelectWorld(20); // parameters here may be inaccurate

LeaveLobby

function LeaveLobby: Boolean;

Logs you out from lobby screen.

Note

by IceFire908

Example:

if (LobbyScreen()) then
  if (not LeaveLobby()) then
    WriteLn('Oh no, we didn''t make it out of the Lobby Screen.');

Logout

function Logout: Boolean;

Logs you all the way out from ingame.

Note

by Starblaster100, Raymond, IceFire908, Tarajunky & NCDS

Example:

if (not FindTree()) then
  Logout();

LoginPlayerToLob

function LoginPlayerToLob: Boolean;

Like LoginPlayer but only to the lobbyscreen.

Note

by SRL Dev Team

Example:

LoginPlayerToLob();
if (not LobbyScreen()) then
  LoginPlayerToLob(); // try again!

LoginPlayer

function LoginPlayer: Boolean;

Logs in the Player[CurrentPlayer]. Detects most Client Login Errors

Note

by SRL Dev Team

Example:

if (not LoggedIn()) then
begin
  WriteLn('Error: Not Logged In! Fixing');
  LoginPlayer();
end;

NextPlayerIndex

function NextPlayerIndex: Integer;

Returns the player number of the next active player.

Note

by Dankness, Ron, Raymond & ZephyrsFury

Example:

if (NextPlayerIndex() != -1) then
  WriteLn('We still have active players!');

RandomPlayerIndex

function RandomPlayerIndex: Integer;

Returns the player number of a random active player.

Note

by Dankness, Ron, Raymond & ZephyrsFury

Example:

procedure NextPlayerRandom(Active: Boolean);
begin
  Players[CurrentPlayer].Active := Active;
  CurrentPlayer := RandomPlayerIndex();
  if (CurrentPlayer = -1) then
  begin
    WriteLn('All players inactive..');
    TerminateScript();
  end;
end;

SwitchToPlayer

function SwitchToPlayer(PlayerNo: Integer; Active: Boolean): Boolean;

Switches to a specific player, setting the current player’s activity to True or False.

Note

by Dankness, Ron, Raymond & ZephyrsFury

Example:

SwitchToPlayer(1, True);

NextPlayer

procedure NextPlayer(Active: Boolean);

Logs in the next player that isn’t inactive. Boolean: True - Current player is ok. False - Current player is false.

Note

by ZephyrsFury

Example:

NextPlayer(True);

RandomNextPlayer

procedure RandomNextPlayer(Active: Boolean);

Logs in a random player that isn’t inactive. Boolean: True - Current player is ok. False - Current player is false.

Note

by ZephyrsFury

Example:

RandomNextPlayer(True);

CheckUserNicks

procedure CheckUserNicks;

Checks if all nicks are set correct.

Note

by Sumilion, Raymond, and Nava2

Example:

// make sure the user setup their nicks right..
CheckUserNicks();