Package rsb.methods

Class Game


public class Game extends MethodProvider
Game state and GUI operations.
  • Method Details

    • setChatOption

      public boolean setChatOption(int chatOption, Game.ChatMode mode)
      Set the specified chat mode
      Parameters:
      chatOption - one of CHAT_OPTION_
      mode - one of ChatMode
      Returns:
      true if item was clicked correctly; otherwise false
    • getLastMessage

      public String getLastMessage()
      Access the last message spoken by a player.
      Returns:
      The last message spoken by a player or "" if none
    • openTab

      public boolean openTab(GameGUI.Tab tab)
      Opens the specified tab at the specified index.
      Parameters:
      tab - The tab to open.
      Returns:
      true if tab successfully selected; otherwise false.
      See Also:
    • openTab

      public boolean openTab(GameGUI.Tab tab, boolean functionKey)
      Opens the specified tab at the specified index.
      Parameters:
      tab - The tab to open
      functionKey - If wanting to use function keys to switch.
      Returns:
      true if tab successfully selected; otherwise false.
    • closeTab

      public void closeTab()
      Closes the currently open tab if in resizable mode.
    • mouseChatButton

      public boolean mouseChatButton(int button, boolean left)
      Click chat button.
      Parameters:
      button - Which button? One of CHAT_OPTION
      left - Left or right button? Left = true. Right = false.
      Returns:
      true if it was clicked.
    • getCurrentTab

      public GameGUI.Tab getCurrentTab()
      Gets the currently open tab.
      Returns:
      The currently open tab or the logout tab by default.
    • getEnergy

      @Deprecated public int getEnergy()
      Deprecated.
      Gets the current run energy. Deprecated : use walking.getEnergy()
      Returns:
      An int representation of the players current energy.
    • inRandom

      public Boolean inRandom()
      Excludes Loginbot, BankPin, TeleotherCloser, CloseAllInterface, ImprovedRewardsBox
      Returns:
      True if player is in a random
    • getTalkInterface

      public RSWidget getTalkInterface()
      Returns the valid chat component.
      Returns:
      RSWidgetChild of the current valid talk interface; otherwise null.
    • getCrosshairState

      public int getCrosshairState()
      TODO: This is non-functional
      Returns:
      -1 as the method is non-functional
    • isOnLogoutTab

      public boolean isOnLogoutTab()
      Checks whether the logout tab is selected.
      Returns:
      true if on the logout tab.
    • logout

      public boolean logout()
      Closes the bank if it is open and logs out.
      Returns:
      true if the player was logged out.
    • login

      public boolean login()
      Runs the LoginBot random.
      Returns:
      true if random was run; otherwise false.
    • isLoggedIn

      public boolean isLoggedIn()
      Determines whether the client is currently logged in to an account.
      Returns:
      true if logged in; otherwise false.
    • isLoginScreen

      public boolean isLoginScreen()
      Determines whether the client is showing the login screen.
      Returns:
      true if the client is showing the login screen; otherwise false.
    • isWelcomeScreen

      public boolean isWelcomeScreen()
      Determines whether the welcome screen is open.
      Returns:
      true if the client is showing the welcome screen; otherwise false.
    • getClientState

      public net.runelite.api.GameState getClientState()
      Gets the game state.
      Returns:
      The game state.
    • getPlane

      public int getPlane()
      Gets the plane we are currently on. Typically 0 (ground level), but will increase when going up ladders. You cannot be on a negative plane. Most dungeons/basements are on plane 0 elsewhere on the world map.
      Returns:
      The current plane.
    • getBaseX

      public int getBaseX()
      Gets the x coordinate of the loaded map area (far west).
      Returns:
      The region base x.
    • getBaseY

      public int getBaseY()
      Gets the y coordinate of the loaded map area (far south).
      Returns:
      The region base y.
    • getMapBase

      public RSTile getMapBase()
      Gets the (x, y) coordinate pair of the south-western tile at the base of the loaded map area.
      Returns:
      The region base tile.
    • getSceneFlags

      public byte[][][] getSceneFlags()
      Gets the flags relating to the tiles in the scene
      Returns:
      the flags for all the tiles in the current scene
    • getWidth

      public int getWidth()
      Gets the canvas height.
      Returns:
      The canvas' width.
    • getHeight

      public int getHeight()
      Gets the canvas height.
      Returns:
      The canvas' height.
    • getColorAtPoint

      public Color getColorAtPoint(int x, int y)
      Gets a color corresponding to x and y co ordinates from the current game screen.
      Parameters:
      x - : The x co ordinate at which to get the color.
      y - : The y co ordinate at which to get the color.
      Returns:
      Color
      See Also: