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 TypeMethodDescriptionvoid
closeTab()
Closes the currently open tab if in resizable mode.int
getBaseX()
Gets the x coordinate of the loaded map area (far west).int
getBaseY()
Gets the y coordinate of the loaded map area (far south).net.runelite.api.GameState
Gets the game state.getColorAtPoint
(int x, int y) Gets a color corresponding to x and y co ordinates from the current game screen.int
TODO: This is non-functionalGets the currently open tab.int
Deprecated.int
Gets 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.int
getPlane()
Gets the plane we are currently on.byte[][][]
Gets the flags relating to the tiles in the sceneReturns the valid chat component.int
getWidth()
Gets the canvas height.inRandom()
Excludes Loginbot, BankPin, TeleotherCloser, CloseAllInterface, ImprovedRewardsBoxboolean
Determines whether the client is currently logged in to an account.boolean
Determines whether the client is showing the login screen.boolean
Checks whether the logout tab is selected.boolean
Determines whether the welcome screen is open.boolean
login()
Runs the LoginBot random.boolean
logout()
Closes the bank if it is open and logs out.boolean
mouseChatButton
(int button, boolean left) Click chat button.boolean
openTab
(GameGUI.Tab tab) Opens the specified tab at the specified index.boolean
openTab
(GameGUI.Tab tab, boolean functionKey) Opens the specified tab at the specified index.boolean
setChatOption
(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:
true
if 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:
true
if 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:
true
if 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:
true
if 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
int
representation 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:
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; otherwisefalse
.
-
isLoggedIn
public boolean isLoggedIn()Determines whether the client is currently logged in to an account.- Returns:
true
if logged in; otherwisefalse
.
-
isLoginScreen
public boolean isLoginScreen()Determines whether the client is showing the login screen.- Returns:
true
if the client is showing the login screen; otherwisefalse
.
-
isWelcomeScreen
public boolean isWelcomeScreen()Determines whether the welcome screen is open.- Returns:
true
if 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:
-