Interface IGame


public interface IGame
Provides access to core game state information.

This interface offers methods to query the current state of the game client, including login status, wilderness level, cutscenes, and account information.

  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the current Deadman Mode level.
    Gets the currently logged in game account.
    Gets the timestamp of the last successful login.
    int
    Gets the number of membership days remaining.
    net.runelite.api.GameState
    Gets the current game state.
    int
    Gets the current wilderness level (combat level range for PvP).
    boolean
    Checks if the screen is currently black (loading or transitioning).
    boolean
    Checks if the player is currently in a cutscene.
    boolean
    Checks if the player is currently in the wilderness.
    boolean
    Checks if the player is logged into the game.
    default boolean
    Checks if the player is on the login screen.
    void
    Initiates logout from the game.
    void
    Sets the game account for login purposes.
  • Method Details

    • getGameAccount

      GameAccount getGameAccount()
      Gets the currently logged in game account.
      Returns:
      the game account, or null if not logged in
    • setGameAccount

      void setGameAccount(GameAccount account)
      Sets the game account for login purposes.
      Parameters:
      account - the game account to use for login
    • isLoggedIn

      boolean isLoggedIn()
      Checks if the player is logged into the game.
      Returns:
      true if logged in, false otherwise
    • getState

      net.runelite.api.GameState getState()
      Gets the current game state.
      Returns:
      the current GameState
    • isInCutscene

      boolean isInCutscene()
      Checks if the player is currently in a cutscene.
      Returns:
      true if in a cutscene, false otherwise
    • getWildyLevel

      int getWildyLevel()
      Gets the current wilderness level (combat level range for PvP).
      Returns:
      the wilderness level, or 0 if not in wilderness
    • isInWilderness

      boolean isInWilderness()
      Checks if the player is currently in the wilderness.
      Returns:
      true if in wilderness, false otherwise
    • isOnLoginScreen

      default boolean isOnLoginScreen()
      Checks if the player is on the login screen.

      This includes the main login screen, authenticator screen, and logging in state.

      Returns:
      true if on any login screen, false otherwise
    • getDeadmanLevel

      int getDeadmanLevel()
      Gets the current Deadman Mode level.
      Returns:
      the Deadman level, or 0 if not in Deadman Mode
    • getMembershipDays

      int getMembershipDays()
      Gets the number of membership days remaining.
      Returns:
      the number of membership days
    • isBlackScreen

      boolean isBlackScreen()
      Checks if the screen is currently black (loading or transitioning).
      Returns:
      true if the screen is black, false otherwise
    • logout

      void logout()
      Initiates logout from the game.

      This will attempt to log the player out of the game.

    • getLastLogin

      Instant getLastLogin()
      Gets the timestamp of the last successful login.
      Returns:
      the last login time, or null if never logged in