Package rsb.methods
Class Game
java.lang.Object
rsb.methods.MethodProvider
rsb.methods.Game
Game state and GUI operations.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class rsb.methods.MethodProvider
methods -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseTab()Closes the currently open tab if in resizable mode.intgetBaseX()Gets the x coordinate of the loaded map area (far west).intgetBaseY()Gets the y coordinate of the loaded map area (far south).net.runelite.api.GameStateGets the game state.getColorAtPoint(int x, int y) Gets a color corresponding to x and y co ordinates from the current game screen.intTODO: This is non-functionalGets the currently open tab.intDeprecated.intGets the canvas height.Access the last message spoken by a player.Gets the (x, y) coordinate pair of the south-western tile at the base of the loaded map area.intgetPlane()Gets the plane we are currently on.byte[][][]Gets the flags relating to the tiles in the sceneReturns the valid chat component.intgetWidth()Gets the canvas height.inRandom()Excludes Loginbot, BankPin, TeleotherCloser, CloseAllInterface, ImprovedRewardsBoxbooleanDetermines whether the client is currently logged in to an account.booleanDetermines whether the client is showing the login screen.booleanChecks whether the logout tab is selected.booleanDetermines whether the welcome screen is open.booleanlogin()Runs the LoginBot random.booleanlogout()Closes the bank if it is open and logs out.booleanmouseChatButton(int button, boolean left) Click chat button.booleanopenTab(GameGUI.Tab tab) Opens the specified tab at the specified index.booleanopenTab(GameGUI.Tab tab, boolean functionKey) Opens the specified tab at the specified index.booleansetChatOption(int chatOption, Game.ChatMode mode) Set the specified chat mode
-
Method Details
-
setChatOption
Set the specified chat mode- Parameters:
chatOption- one of CHAT_OPTION_mode- one of ChatMode- Returns:
trueif item was clicked correctly; otherwisefalse
-
getLastMessage
Access the last message spoken by a player.- Returns:
- The last message spoken by a player or "" if none
-
openTab
Opens the specified tab at the specified index.- Parameters:
tab- The tab to open.- Returns:
trueif tab successfully selected; otherwisefalse.- See Also:
-
openTab
Opens the specified tab at the specified index.- Parameters:
tab- The tab to openfunctionKey- If wanting to use function keys to switch.- Returns:
trueif tab successfully selected; otherwisefalse.
-
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_OPTIONleft- Left or right button? Left = true. Right = false.- Returns:
trueif it was clicked.
-
getCurrentTab
Gets the currently open tab.- Returns:
- The currently open tab or the logout tab by default.
-
getEnergy
Deprecated.Gets the current run energy. Deprecated : use walking.getEnergy()- Returns:
- An
intrepresentation of the players current energy.
-
inRandom
Excludes Loginbot, BankPin, TeleotherCloser, CloseAllInterface, ImprovedRewardsBox- Returns:
- True if player is in a random
-
getTalkInterface
Returns the valid chat component.- Returns:
RSWidgetChildof 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:
trueif on the logout tab.
-
logout
public boolean logout()Closes the bank if it is open and logs out.- Returns:
trueif the player was logged out.
-
login
public boolean login()Runs the LoginBot random.- Returns:
trueif random was run; otherwisefalse.
-
isLoggedIn
public boolean isLoggedIn()Determines whether the client is currently logged in to an account.- Returns:
trueif logged in; otherwisefalse.
-
isLoginScreen
public boolean isLoginScreen()Determines whether the client is showing the login screen.- Returns:
trueif the client is showing the login screen; otherwisefalse.
-
isWelcomeScreen
public boolean isWelcomeScreen()Determines whether the welcome screen is open.- Returns:
trueif the client is showing the welcome screen; otherwisefalse.
-
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
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
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:
-