Worlds

The worlds file holds functions and procedures that are used in the worlds tab, inside the runescape lobby interface.

The source for this file can be found here.

Consts, Types, Vars

The following constants, types and variables are used throughout the chatBox methods.

const Order

Constants which represent the different world sorting buttons

  • WORLD_ORDER_WORLDS
  • WORLD_ORDER_PLAYERS
  • WORLD_ORDER_ACTIVITY
  • WORLD_ORDER_LOCATION
  • WORLD_ORDER_LOOT
  • WORLD_ORDER_TYPE
  • WORLD_ORDER_PING

type TRSLobbyWorlds

type
  TRSLobbyWorlds = type TRSInterface;

A type that stores the worlds interface properties.

var lobbyWorlds

var
  lobbyWorlds: TRSLobbyWorlds;

A variable through which scripters can access the TRSLobbyWorlds type methods.

TRSLobbyWorlds methods

The following methods should be called through the lobbyWorlds variable.

Example:

if lobbyWorlds.isOpen() then
  writeln('It''s open');

isOpen

function TRSLobbyWorlds.isOpen(): boolean;

Returns true if the worlds interface is open.

Note

  • by Icefire908 & Coh3n
  • Last Updated: 23 July 2013 by Coh3n

Example:

if lobbyWorlds.isOpen() then
  lobbyWorlds.selectWorld(115);

open

function TRSLobbyWorlds.open(): boolean;

Returns true if the worlds interface is sucessfully opened. Waits a maximum of 10 seconds after the tab is clicked for the world list to load.

Note

  • by Bionicle1800 & Coh3n
  • Last Updated: 8 February 2015 by The Mayor

Example:

if lobbyWorlds.open() then
  writeLn('We opened the worlds tab in the lobby!);

getCurrentWorld

function TRSLobbyWorlds.getCurrentWorld(): integer;

Returns the currently selected world.

Note

  • by Home & Coh3n
  • Last Updated: 8 August 2014 by The Mayor

Example:

writeLn(lobbyWorlds.getCurrentWorld()));

sort

function TRSLobbyWorlds.sort(orderBy: integer; descending: boolean): boolean;

Sorts the worlds list by the specified order type. The orderBy should be one of the constants at the top of this page. Setting descending to true will order the worlds with the largest at the top.

Note

  • by Naum & Coh3n
  • Last Updated: 8 August 2014 by The Mayor

Example:

lobbyWorlds.sort(WORLD_ORDER_PLAYERS, true); // sorts the worlds starting with lowest at the top

selectWorld

function TRSLobbyWorlds.selectWorld(wo: integer): boolean;

Returns true if it selects the world wo . It will open the worlds interface and scroll to the world if needed.

Note

  • by Narcle, ZephyrsFury, Ashaman88, and Coh3n
  • Last Updated: 9th October 2014 by Clarity

Example:

if players[currentPlayer].loginToLobby() then
  lobbyWorlds.selectWorld(115);

selectRandomWorld

function TRSLobbyWorlds.selectRandomWorld(members: boolean; standardAvoid: boolean = true; personalAvoid: TIntegerArray = []): boolean;

Returns true if it successfully selects a random world.

  • members : Select a members world?
  • statdardAvoid : Avoid the worlds listed below (default = true)
  • personalAvoid : A custom array of worlds to avoid. Can be used separately or in addition to the standard avoid worlds.

The default avoid worlds are:

  • World 18 - Legacy Only
  • World 30 - Skill Total (2000)
  • World 33 - Legacy Only
  • World 48 - Skill Total (2400)
  • World 52 - VIP Server
  • World 57 - Legacy Only
  • World 86 - Skill Total (1500)
  • World 96 - Quick Chat
  • World 97 - Legacy Only
  • World 114 - Skill Total (1500)
  • World 115 - Legacy Only
  • World 120 - Legacy Only
  • World 136 - Legacy Only
  • World 137 - Legacy Only

Note

  • by Narcle, Mixter, and Coh3n
  • Last Updated: 9 October 2014 by Clarity

Example:

//To select a random P2P world
lobbyWorlds.selectRandomWorld(players[currentPlayer].isMember);

//To select a random P2P world, also selecting from "avoid" worlds
lobbyWorlds.selectRandomWorld(players[currentPlayer].isMember, false);

//To select a random P2P world, avoiding worlds 99 and 100 in addition to the standard avoid worlds
lobbyWorlds.selectRandomWorld(players[currentPlayer].isMember, true, [99, 100]);

addFavoriteWorlds

function TRSLobbyWorlds.addFavoriteWorlds(wArray: TIntegerArray): boolean;

Returns true if it siccessfully adds worlds wArray to your list of favorites. This does not clear existing favourite worlds first.

Note

  • by Clarity
  • Last Updated: 9 October 2014 by Clarity

Example:

lobbyWorlds.addFavoriteWorlds([3, 4]);

removeFavoriteWorlds

function TRSLobbyWorlds.removeFavoriteWorlds(wArray: TIntegerArray): boolean;

Returns true if it siccessfully removes the wArray worlds wfrom your list of favorites.

Note

  • by Clarity
  • Last Updated: 9 October 2014 by Clarity

Example:

lobbyWorlds.removeFavoriteWorlds([3, 4]);