Package net.storm.api.game
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 TypeMethodDescriptionintGets the current Deadman Mode level.Gets the currently logged in game account.Gets the timestamp of the last successful login.intGets the number of membership days remaining.net.runelite.api.GameStategetState()Gets the current game state.intGets the current wilderness level (combat level range for PvP).booleanChecks if the screen is currently black (loading or transitioning).booleanChecks if the player is currently in a cutscene.booleanChecks if the player is currently in the wilderness.booleanChecks if the player is logged into the game.default booleanChecks if the player is on the login screen.voidlogout()Initiates logout from the game.voidsetGameAccount(GameAccount account) 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
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
-