Package net.storm.sdk.game
Class Game
java.lang.Object
net.storm.sdk.game.Game
Provides static utility methods for accessing general game state information.
This class serves as the primary entry point for querying the current state of the game,
including login status, wilderness information, membership details, and account management.
All methods in this class are static and delegate to the underlying IGame implementation.
Example usage:
// Check if the player is logged in before performing actions
if (Game.isLoggedIn()) {
// Check wilderness level for safety
if (Game.isInWilderness()) {
int wildyLevel = Game.getWildyLevel();
System.out.println("Currently in level " + wildyLevel + " wilderness");
}
// Check membership status
int memberDays = Game.getMembershipDays();
System.out.println("Membership days remaining: " + memberDays);
}
// Logout when done
Game.logout();
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intGets the current Deadman Mode level.static GameAccountGets the currently configured game account.static InstantGets the instant when the player last logged in.static intGets the number of membership days remaining on the account.static net.runelite.api.GameStategetState()Gets the current game state.static intGets the current Wilderness level.static booleanChecks whether the screen is currently black (e.g., during loading).static booleanChecks whether the player is currently in a cutscene.static booleanChecks whether the player is currently in the Wilderness.static booleanChecks whether the player is currently logged into the game.static booleanChecks whether the game is currently on the login screen.static voidlogout()Logs out the current player from the game.static voidsetGameAccount(GameAccount gameAccount) Sets the game account to be used for login operations.
-
Constructor Details
-
Game
public Game()
-
-
Method Details
-
getGameAccount
Gets the currently configured game account.- Returns:
- the current
GameAccount, ornullif no account is set
-
setGameAccount
Sets the game account to be used for login operations.- Parameters:
gameAccount- theGameAccountto set
-
isLoggedIn
public static boolean isLoggedIn()Checks whether the player is currently logged into the game. This method returnstrueonly when the game state indicates an active, logged-in session.- Returns:
trueif the player is logged in,falseotherwise
-
getState
public static net.runelite.api.GameState getState()Gets the current game state.- Returns:
- the current
GameState
-
isInWilderness
public static boolean isInWilderness()Checks whether the player is currently in the Wilderness.- Returns:
trueif the player is in the Wilderness,falseotherwise
-
getWildyLevel
public static int getWildyLevel()Gets the current Wilderness level. Returns 0 if the player is not in the Wilderness.- Returns:
- the Wilderness level, or 0 if not in Wilderness
-
isInCutscene
public static boolean isInCutscene()Checks whether the player is currently in a cutscene. During cutscenes, player input is typically restricted.- Returns:
trueif a cutscene is active,falseotherwise
-
isOnLoginScreen
public static boolean isOnLoginScreen()Checks whether the game is currently on the login screen. This includes the main login screen, authenticator screen, and logging in states.- Returns:
trueif on any login screen variant,falseotherwise
-
getDeadmanLevel
public static int getDeadmanLevel()Gets the current Deadman Mode level. Returns 0 if not in a Deadman Mode world.- Returns:
- the Deadman Mode level, or 0 if not applicable
-
getMembershipDays
public static int getMembershipDays()Gets the number of membership days remaining on the account.- Returns:
- the number of membership days remaining
-
isBlackScreen
public static boolean isBlackScreen()Checks whether the screen is currently black (e.g., during loading).- Returns:
trueif the screen is black,falseotherwise
-
logout
public static void logout()Logs out the current player from the game. This will return the player to the login screen. -
getLastLogin
Gets the instant when the player last logged in.- Returns:
- an
Instantrepresenting the last login time, ornullif not available
-