Package org.dreambot.api
Class Client
- java.lang.Object
-
- org.dreambot.api.Client
-
public class Client extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleanfireScriptEvent(@NonNull RuneScriptEvent event)static voidgainFocus()Calls a focus gained event if the client does not currently have focus This behaves as if you were to click the icon in your task bar, no separate events needed.static java.lang.StringgetAccountIdentifier()Gets a more broadly determined identifier for an account.static intgetAccountStatus()static @NonNull TilegetBase()Returns the region's base tile (UsesgetBaseX()andgetBaseY()) to position tile.static intgetBaseX()Returns the region's base xstatic intgetBaseY()Returns the region's base ystatic @NonNull java.awt.CanvasgetCanvas()Gets the RS canvasstatic @NonNull java.awt.image.BufferedImagegetCanvasImage()static @NonNull CollisionMap[]getCollisionMaps()Gets all collision mapsstatic intgetCurrentWorld()Deprecated.static @Nullable TilegetDestination()Gets the tile of your destinationstatic intgetDestX()Gets the destination Xstatic intgetDestY()Gets the destination Ystatic @NonNull java.util.List<Entity>getEntities()static intgetForcedFPS()static @Nullable ForumUsergetForumUser()static intgetFPS()Gets the FPS limit set by the client, or 50 FPS if it's not activestatic @NonNull FriendHandlergetFriendHandler()Deprecated.seeFriendsinsteadstatic intgetGameCycle()Gets the game cyclestatic @Nullable java.net.SocketgetGameSocket()Deprecated.static @NonNull GameStategetGameState()Gets the current game statestatic intgetGameStateId()Gets the current game state Id.static intgetGameStateID()Deprecated.seegetGameStateId()static intgetGameTick()Gets the current game tick, which increases roughly every 600msstatic @NonNull java.util.List<GraphicsObject>getGraphicsObjects()Deprecated.static @NonNull java.lang.StringgetHost()static intgetIdleTime()Gets idle timestatic @NonNull InstancegetInstance()Gets the bot instancestatic intgetLoginIndex()Gets the login indexstatic @NonNull RSLoginResponsegetLoginResponse()static intgetMapAngle()Gets map rotationstatic intgetMembershipLeft()static @Nullable java.lang.StringgetMessage0()static @Nullable java.lang.StringgetMessage1()static @Nullable java.lang.StringgetMessage2()static @NonNull java.util.List<org.dreambot.api.wrappers.cache.MessageContainer>getMessageContainers()Returns all message containersstatic intgetMyPlayerIndex()Gets your local player's indexstatic @Nullable java.lang.StringgetPassword()Returns the player's passwordstatic intgetPlane()Gets your current planestatic @NonNull java.util.List<Projectile>getProjectiles()Deprecated.static intgetRunescapeFps()static @NonNull SocialHandlergetSocialHandler()Deprecated.static int[][][]getTileHeights()Gets tile heightsstatic byte[][][]getTileSettings()Gets tile settingsstatic @Nullable java.lang.StringgetUsername()Gets the username or email that was entered at the login screenstatic @NonNull ViewportgetViewport()Returns the current viewportstatic intgetViewportHeight()static @NonNull ViewportToolsgetViewportTools()Returns viewport tool.static intgetViewportWidth()static booleanhasFocus()Returns if the RS client currently has focusstatic booleanhasMembersAccess()Checks if you currently have access to members features in OSRSstatic voidignoreScriptId(int id)static booleanisCameraInMotion()Checks if the camera is in motionstatic booleanisCpuSaver()static booleanisDynamicRegion()Shows if you are in a dynamic/instanced regionstatic booleanisGroupIronman()Checks if the current character is a group ironmanstatic booleanisInCutscene()Checks if an in game cutscene is activestatic booleanisIronman()Checks if the current character is any non-group ironmanstatic booleanisLoggedIn()Checks if you're logged instatic booleanisMembers()static booleanisRenderingDisabled()static booleanisUltimateIronman()Checks if the current character is an ultimate ironmanstatic booleanisWorldSelectorOpen()Checks if the world selector is openstatic booleanlogout()static voidloseFocus()Sends a focus lost event if the client currently has focus This sends no other events, losing focus by mouse would suggest moving mouse off canvas and then losing focus Losing focus by keyboard would expect the alt key to be pressed at least (for alt+tab)static booleanreadyToLoad()static voidremoveIgnoreScriptId(int id)static doubleseededRandom()Returns a random number seeded by account name between .9 and 1.1static voidsetCameraInMotion(boolean cameraInMotion)Sets the camera in motionstatic voidsetForcedFPS(int fps)static voidsetIdleTime(int idleTime)static voidsetMapAngleDirect(int angle)static voidsetRenderingDisabled(boolean disabled)static voidsetViewport(@NonNull Viewport viewport)Sets the viewport
-
-
-
Method Detail
-
setForcedFPS
public static void setForcedFPS(int fps)
-
isRenderingDisabled
public static boolean isRenderingDisabled()
-
setRenderingDisabled
public static void setRenderingDisabled(boolean disabled)
-
getForumUser
public static @Nullable ForumUser getForumUser()
-
getHost
public static @NonNull java.lang.String getHost()
-
getAccountStatus
public static int getAccountStatus()
-
getGameSocket
@Deprecated public static @Nullable java.net.Socket getGameSocket()
Deprecated.
-
getCanvasImage
public static @NonNull java.awt.image.BufferedImage getCanvasImage()
-
readyToLoad
public static boolean readyToLoad()
-
getGameCycle
public static int getGameCycle()
Gets the game cycle- Returns:
- the current game cycle (1/50th of a second)
-
getFPS
public static int getFPS()
Gets the FPS limit set by the client, or 50 FPS if it's not active- Returns:
- FPS
-
isCpuSaver
public static boolean isCpuSaver()
-
getIdleTime
public static int getIdleTime()
Gets idle time- Returns:
- the number of cycles (1/50th of a second) since the last registered mouse or keyboard event
-
setIdleTime
public static void setIdleTime(int idleTime)
-
isLoggedIn
public static boolean isLoggedIn()
Checks if you're logged in- Returns:
- true if you're logged in false if you're not
-
getGameState
public static @NonNull GameState getGameState()
Gets the current game state- Returns:
- game state
-
getGameStateId
public static int getGameStateId()
Gets the current game state Id.- Returns:
- game state
-
getGameStateID
@Deprecated public static int getGameStateID()
Deprecated.seegetGameStateId()Gets the current game state ID.- Returns:
- game state
-
getLoginIndex
public static int getLoginIndex()
Gets the login index- Returns:
- login index
-
getMapAngle
public static int getMapAngle()
Gets map rotation- Returns:
- map angle
-
setMapAngleDirect
public static void setMapAngleDirect(int angle)
-
getPlane
public static int getPlane()
Gets your current plane- Returns:
- plane
-
getBaseY
public static int getBaseY()
Returns the region's base y- Returns:
- y
-
getBaseX
public static int getBaseX()
Returns the region's base x- Returns:
- x
-
getBase
public static @NonNull Tile getBase()
Returns the region's base tile (UsesgetBaseX()andgetBaseY()) to position tile.- Returns:
- the base tile of the region.
-
isWorldSelectorOpen
public static boolean isWorldSelectorOpen()
Checks if the world selector is open- Returns:
- true if it's open false if it's not
-
isInCutscene
public static boolean isInCutscene()
Checks if an in game cutscene is active- Returns:
- true if there's a cutscene active, otherwise false
-
getTileSettings
public static byte[][][] getTileSettings()
Gets tile settings- Returns:
- tile settings
-
getTileHeights
public static int[][][] getTileHeights()
Gets tile heights- Returns:
- tile heights
-
getCurrentWorld
@Deprecated public static int getCurrentWorld()
Deprecated.
-
getMessageContainers
public static @NonNull java.util.List<org.dreambot.api.wrappers.cache.MessageContainer> getMessageContainers()
Returns all message containers- Returns:
- message containers
-
getProjectiles
@Deprecated public static @NonNull java.util.List<Projectile> getProjectiles()
Deprecated.
-
getGraphicsObjects
@Deprecated public static @NonNull java.util.List<GraphicsObject> getGraphicsObjects()
Deprecated.
-
getPassword
public static @Nullable java.lang.String getPassword()
Returns the player's password- Returns:
- password
-
getMyPlayerIndex
public static int getMyPlayerIndex()
Gets your local player's index- Returns:
- local player's index
-
getCanvas
public static @NonNull java.awt.Canvas getCanvas()
Gets the RS canvas- Returns:
- canvas
-
getCollisionMaps
public static @NonNull CollisionMap[] getCollisionMaps()
Gets all collision maps- Returns:
- collision maps
-
getSocialHandler
@Deprecated public static @NonNull SocialHandler getSocialHandler()
Deprecated.
-
getFriendHandler
@Deprecated public static @NonNull FriendHandler getFriendHandler()
Deprecated.seeFriendsinstead
-
getUsername
public static @Nullable java.lang.String getUsername()
Gets the username or email that was entered at the login screen- Returns:
- username or email
-
getEntities
public static @NonNull java.util.List<Entity> getEntities()
- Returns:
- list of the listed entities
-
getInstance
public static @NonNull Instance getInstance()
Gets the bot instance- Returns:
- instance
-
getViewport
public static @NonNull Viewport getViewport()
Returns the current viewport- Returns:
- viewport
-
setViewport
public static void setViewport(@NonNull Viewport viewport)
Sets the viewport- Parameters:
viewport- Viewport
-
getViewportWidth
public static int getViewportWidth()
-
getViewportHeight
public static int getViewportHeight()
-
getViewportTools
public static @NonNull ViewportTools getViewportTools()
Returns viewport tool.- Returns:
- viewport tools
-
getDestX
public static int getDestX()
Gets the destination X- Returns:
- destination X
-
getDestY
public static int getDestY()
Gets the destination Y- Returns:
- destination Y
-
getDestination
public static @Nullable Tile getDestination()
Gets the tile of your destination- Returns:
- Your player's destination, null if not moving
-
isCameraInMotion
public static boolean isCameraInMotion()
Checks if the camera is in motion- Returns:
- true if it's moving
-
setCameraInMotion
public static void setCameraInMotion(boolean cameraInMotion)
Sets the camera in motion- Parameters:
cameraInMotion- Camera in motion
-
seededRandom
public static double seededRandom()
Returns a random number seeded by account name between .9 and 1.1- Returns:
- Double between .9 and 1.1
-
getMessage0
public static @Nullable java.lang.String getMessage0()
-
getMessage1
public static @Nullable java.lang.String getMessage1()
-
getMessage2
public static @Nullable java.lang.String getMessage2()
-
getLoginResponse
public static @NonNull RSLoginResponse getLoginResponse()
-
getMembershipLeft
public static int getMembershipLeft()
-
isMembers
public static boolean isMembers()
-
isIronman
public static boolean isIronman()
Checks if the current character is any non-group ironman- Returns:
- true if it's any non-group ironman, false otherwise
-
isGroupIronman
public static boolean isGroupIronman()
Checks if the current character is a group ironman- Returns:
- true if it's a group ironman, false otherwise
-
isUltimateIronman
public static boolean isUltimateIronman()
Checks if the current character is an ultimate ironman- Returns:
- true if it's an ultimate ironman
-
hasMembersAccess
public static boolean hasMembersAccess()
Checks if you currently have access to members features in OSRS- Returns:
- True if members and on a members world, False if world is f2p, not logged in, or do not have membership
-
isDynamicRegion
public static boolean isDynamicRegion()
Shows if you are in a dynamic/instanced region- Returns:
- true if dynamic region, else false
-
fireScriptEvent
public static boolean fireScriptEvent(@NonNull RuneScriptEvent event)
-
ignoreScriptId
public static void ignoreScriptId(int id)
-
removeIgnoreScriptId
public static void removeIgnoreScriptId(int id)
-
getRunescapeFps
public static int getRunescapeFps()
-
hasFocus
public static boolean hasFocus()
Returns if the RS client currently has focus- Returns:
- True if focused, else false
-
gainFocus
public static void gainFocus()
Calls a focus gained event if the client does not currently have focus This behaves as if you were to click the icon in your task bar, no separate events needed. For mouse to gain focus you need mouse events For keyboard to gain focus (alt+tab) sends a tab released event after gaining focus
-
loseFocus
public static void loseFocus()
Sends a focus lost event if the client currently has focus This sends no other events, losing focus by mouse would suggest moving mouse off canvas and then losing focus Losing focus by keyboard would expect the alt key to be pressed at least (for alt+tab)
-
getGameTick
public static int getGameTick()
Gets the current game tick, which increases roughly every 600ms
-
getAccountIdentifier
public static java.lang.String getAccountIdentifier()
Gets a more broadly determined identifier for an account. Priority check is characterId->email->account nickname returns null if none of those have valid info.- Returns:
- String used as an account identifier, null if no valid identifier found
-
logout
public static boolean logout()
-
getForcedFPS
public static int getForcedFPS()
-
-