Package org.dreambot.api
Class Client
- java.lang.Object
- 
- org.dreambot.api.Client
 
- 
 public class Client extends java.lang.Object
- 
- 
Method SummaryAll 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- 
setForcedFPSpublic static void setForcedFPS(int fps) 
 - 
isRenderingDisabledpublic static boolean isRenderingDisabled() 
 - 
setRenderingDisabledpublic static void setRenderingDisabled(boolean disabled) 
 - 
getForumUserpublic static @Nullable ForumUser getForumUser() 
 - 
getHostpublic static @NonNull java.lang.String getHost() 
 - 
getAccountStatuspublic static int getAccountStatus() 
 - 
getGameSocket@Deprecated public static @Nullable java.net.Socket getGameSocket() Deprecated.
 - 
getCanvasImagepublic static @NonNull java.awt.image.BufferedImage getCanvasImage() 
 - 
readyToLoadpublic static boolean readyToLoad() 
 - 
getGameCyclepublic static int getGameCycle() Gets the game cycle- Returns:
- the current game cycle (1/50th of a second)
 
 - 
getFPSpublic static int getFPS() Gets the FPS limit set by the client, or 50 FPS if it's not active- Returns:
- FPS
 
 - 
isCpuSaverpublic static boolean isCpuSaver() 
 - 
getIdleTimepublic static int getIdleTime() Gets idle time- Returns:
- the number of cycles (1/50th of a second) since the last registered mouse or keyboard event
 
 - 
setIdleTimepublic static void setIdleTime(int idleTime) 
 - 
isLoggedInpublic static boolean isLoggedIn() Checks if you're logged in- Returns:
- true if you're logged in false if you're not
 
 - 
getGameStatepublic static @NonNull GameState getGameState() Gets the current game state- Returns:
- game state
 
 - 
getGameStateIdpublic 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
 
 - 
getLoginIndexpublic static int getLoginIndex() Gets the login index- Returns:
- login index
 
 - 
getMapAnglepublic static int getMapAngle() Gets map rotation- Returns:
- map angle
 
 - 
setMapAngleDirectpublic static void setMapAngleDirect(int angle) 
 - 
getPlanepublic static int getPlane() Gets your current plane- Returns:
- plane
 
 - 
getBaseYpublic static int getBaseY() Returns the region's base y- Returns:
- y
 
 - 
getBaseXpublic static int getBaseX() Returns the region's base x- Returns:
- x
 
 - 
getBasepublic static @NonNull Tile getBase() Returns the region's base tile (UsesgetBaseX()andgetBaseY()) to position tile.- Returns:
- the base tile of the region.
 
 - 
isWorldSelectorOpenpublic static boolean isWorldSelectorOpen() Checks if the world selector is open- Returns:
- true if it's open false if it's not
 
 - 
isInCutscenepublic static boolean isInCutscene() Checks if an in game cutscene is active- Returns:
- true if there's a cutscene active, otherwise false
 
 - 
getTileSettingspublic static byte[][][] getTileSettings() Gets tile settings- Returns:
- tile settings
 
 - 
getTileHeightspublic static int[][][] getTileHeights() Gets tile heights- Returns:
- tile heights
 
 - 
getCurrentWorld@Deprecated public static int getCurrentWorld() Deprecated.
 - 
getMessageContainerspublic 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.
 - 
getPasswordpublic static @Nullable java.lang.String getPassword() Returns the player's password- Returns:
- password
 
 - 
getMyPlayerIndexpublic static int getMyPlayerIndex() Gets your local player's index- Returns:
- local player's index
 
 - 
getCanvaspublic static @NonNull java.awt.Canvas getCanvas() Gets the RS canvas- Returns:
- canvas
 
 - 
getCollisionMapspublic 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
 - 
getUsernamepublic static @Nullable java.lang.String getUsername() Gets the username or email that was entered at the login screen- Returns:
- username or email
 
 - 
getEntitiespublic static @NonNull java.util.List<Entity> getEntities() - Returns:
- list of the listed entities
 
 - 
getInstancepublic static @NonNull Instance getInstance() Gets the bot instance- Returns:
- instance
 
 - 
getViewportpublic static @NonNull Viewport getViewport() Returns the current viewport- Returns:
- viewport
 
 - 
setViewportpublic static void setViewport(@NonNull Viewport viewport) Sets the viewport- Parameters:
- viewport- Viewport
 
 - 
getViewportWidthpublic static int getViewportWidth() 
 - 
getViewportHeightpublic static int getViewportHeight() 
 - 
getViewportToolspublic static @NonNull ViewportTools getViewportTools() Returns viewport tool.- Returns:
- viewport tools
 
 - 
getDestXpublic static int getDestX() Gets the destination X- Returns:
- destination X
 
 - 
getDestYpublic static int getDestY() Gets the destination Y- Returns:
- destination Y
 
 - 
getDestinationpublic static @Nullable Tile getDestination() Gets the tile of your destination- Returns:
- Your player's destination, null if not moving
 
 - 
isCameraInMotionpublic static boolean isCameraInMotion() Checks if the camera is in motion- Returns:
- true if it's moving
 
 - 
setCameraInMotionpublic static void setCameraInMotion(boolean cameraInMotion) Sets the camera in motion- Parameters:
- cameraInMotion- Camera in motion
 
 - 
seededRandompublic static double seededRandom() Returns a random number seeded by account name between .9 and 1.1- Returns:
- Double between .9 and 1.1
 
 - 
getMessage0public static @Nullable java.lang.String getMessage0() 
 - 
getMessage1public static @Nullable java.lang.String getMessage1() 
 - 
getMessage2public static @Nullable java.lang.String getMessage2() 
 - 
getLoginResponsepublic static @NonNull RSLoginResponse getLoginResponse() 
 - 
getMembershipLeftpublic static int getMembershipLeft() 
 - 
isMemberspublic static boolean isMembers() 
 - 
isIronmanpublic static boolean isIronman() Checks if the current character is any non-group ironman- Returns:
- true if it's any non-group ironman, false otherwise
 
 - 
isGroupIronmanpublic static boolean isGroupIronman() Checks if the current character is a group ironman- Returns:
- true if it's a group ironman, false otherwise
 
 - 
isUltimateIronmanpublic static boolean isUltimateIronman() Checks if the current character is an ultimate ironman- Returns:
- true if it's an ultimate ironman
 
 - 
hasMembersAccesspublic 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
 
 - 
isDynamicRegionpublic static boolean isDynamicRegion() Shows if you are in a dynamic/instanced region- Returns:
- true if dynamic region, else false
 
 - 
fireScriptEventpublic static boolean fireScriptEvent(@NonNull RuneScriptEvent event) 
 - 
ignoreScriptIdpublic static void ignoreScriptId(int id) 
 - 
removeIgnoreScriptIdpublic static void removeIgnoreScriptId(int id) 
 - 
getRunescapeFpspublic static int getRunescapeFps() 
 - 
hasFocuspublic static boolean hasFocus() Returns if the RS client currently has focus- Returns:
- True if focused, else false
 
 - 
gainFocuspublic 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
 - 
loseFocuspublic 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)
 - 
getGameTickpublic static int getGameTick() Gets the current game tick, which increases roughly every 600ms
 - 
getAccountIdentifierpublic 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
 
 - 
logoutpublic static boolean logout() 
 - 
getForcedFPSpublic static int getForcedFPS() 
 
- 
 
-