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 void
captureNPCModels()
static int
getAccountStatus()
static int
getAgreementStatus()
static Tile
getBase()
Returns the region's base tile (UsesgetBaseX()
andgetBaseY()
) to position tile.static int
getBaseX()
Returns the region's base xstatic int
getBaseY()
Returns the region's base ystatic java.lang.Object
getCanvas()
Gets the RS canvasstatic java.awt.image.BufferedImage
getCanvasImage()
static java.util.List<ClanMember>
getClanMembers()
static int
getClanMembersSize()
static Client
getClient()
static CollisionMap[]
getCollisionMaps()
Gets all collision mapsstatic int[]
getCurrentLevels()
Get all current levelsstatic int
getCurrentTime()
Gets current timestatic int
getCurrentWorld()
Gets the current worldstatic Tile
getDestination()
Gets the tile of your destinationstatic int
getDestX()
Gets the destination Xstatic int
getDestY()
Gets the destination Ystatic java.util.List<Entity>
getEntities()
Gets all entitiesstatic int[]
getExperiences()
Gets all experiencestatic int
getForcedFPS()
static ForumUser
getForumUser()
static int
getFPS()
Gets the FPS limit set by the client, or 50 FPS if it's not activestatic FriendHandler
getFriendHandler()
static Friend[]
getFriends()
Gets your friendsstatic int
getFriendsSize()
Gets the size of your friends liststatic int
getGameCycle()
Gets the game cyclestatic java.awt.Image
getGameImage()
static GameState
getGameState()
Gets the current game statestatic int
getGameStateID()
Gets the current game state ID.static GrandExchangeItem[]
getGrandExchangeItems()
Gets an array of the items that you have in the GrandExchangestatic java.util.List<GraphicsObject>
getGraphicsObjects()
static org.dreambot.api.wrappers.cache.NodeList[][][]
getGroundItems()
Returns the linked list for ground itemsstatic HintArrow
getHintArrow()
Deprecated.static java.lang.String
getHost()
static int
getIdleTime()
Gets idle timestatic org.dreambot.core.Instance
getInstance()
Gets the bot instancestatic org.dreambot.api.wrappers.cache.HashTable
getItemTable()
Gets the item tablestatic int
getLastClickX()
Deprecated.static int
getLastClickY()
Deprecated.static java.lang.String
getLastSelectedItemName()
Gets the last selected item namestatic int[]
getLevels()
Gets all levelsstatic Player
getLocalPlayer()
Returns your playerstatic int
getLoginIndex()
Gets the login indexstatic RSLoginResponse
getLoginResponse()
static int
getLowestPitch()
static int
getMapAngle()
Gets map rotationstatic int
getMembershipLeft()
static Menu
getMenu()
Deprecated.seeMenu
static java.lang.String
getMessage0()
static java.lang.String
getMessage1()
static java.lang.String
getMessage2()
static java.util.List<org.dreambot.api.wrappers.cache.MessageContainer>
getMessageContainers()
Returns all message containersstatic MethodContext
getMethodContext()
static java.awt.Point
getMousePosition()
Gets the current mouse position on the game canvas if the canvas contains the mouse.static int
getMouseX()
Gets the current mouse X coordinate of the mouse if inside the canvas.static int
getMouseY()
Gets the current mouse Y coordinate of the mouse if inside the canvas.static int
getMyPlayerIndex()
Gets your local player's indexstatic java.util.HashMap<java.lang.Integer,ModelWrapper>
getNPCModels()
Returns the NPC model cachestatic java.util.List<NPC>
getNPCs()
Gets all NPCsstatic ModelWrapper
getObjectModel(long hash, boolean force)
static org.dreambot.api.wrappers.cache.Cache
getObjectModelCache()
static java.util.Map<java.lang.Long,ModelWrapper>
getObjectModels()
static java.lang.String
getPassword()
Returns the player's passwordstatic int
getPlane()
Gets your current planestatic Player
getPlayerAtIndex(int index)
static PlayerComposite
getPlayerComposite(Player player, java.lang.Object playerComposite)
static java.lang.String
getPlayerHash()
Hashes the selected account's username, which is allowed in SDN scripts (unlike getUsername)static ModelWrapper
getPlayerModel(Player player)
static java.lang.Object[]
getPlayerReferences()
Gets all player references, this is primarily an internally used method, you should usegetPlayers()
insteadstatic Player[]
getPlayers()
Gets all playersstatic int[]
getPlayerSettings()
Gets player settingsstatic java.util.List<Projectile>
getProjectiles()
static java.lang.Object
getProjectilesRef()
Gets all projectilesstatic Region
getRegion()
Gets the current regionstatic int
getSelectedItemIndex()
static java.lang.String
getSelectedSpellName()
Gets the last selected spell namestatic int
getSelectionState()
Gets the selection statestatic SocialHandler
getSocialHandler()
static JSockWrapperWrapper
getSocketWrapperWrapper()
static boolean
getSpellSelected()
Checks if a spell is selectedstatic int[][][]
getTileHeights()
Gets tile heightsstatic byte[][][]
getTileSettings()
Gets tile settingsstatic java.lang.String
getUsername()
Gets the login usernamestatic boolean[]
getValidWidgets()
Gets the valid widgetsstatic Viewport
getViewport()
Returns the current viewportstatic int
getViewportHeight()
static ViewportTools
getViewportTools()
Returns viewport tool.static int
getViewportWidth()
static org.dreambot.api.wrappers.cache.HashTable
getWidgetNodes()
Gets the widget nodesstatic java.lang.Object[][]
getWidgets()
Returns the widget referencesstatic int[]
getWidgetSettings()
Gets the widget settingsstatic int[]
getWidgetXArray()
Gets the widget x arraystatic int[]
getWidgetYArray()
Gets the widget y arraystatic int
getZoom()
Gets the current game zoom.static Client
initialize(org.dreambot.core.Instance instance)
static boolean
isCameraInMotion()
Checks if the camera is in motionstatic boolean
isESCEnabled()
static boolean
isLoggedIn()
Checks if you're logged instatic boolean
isMembers()
static boolean
isRenderingDisabled()
static boolean
isWorldSelectorOpen()
Checks if the world selector is openstatic boolean
readyToLoad()
static double
seededRandom()
Returns a random number seeded by account name between .9 and 1.1static void
setCameraInMotion(boolean cameraInMotion)
Sets the camera in motionstatic void
setForcedFPS(int fps)
static void
setForumUser(java.lang.String username, int memberId, ForumRank[] ranks)
static void
setMembershipLeft(int membershipLeft)
static void
setRenderingDisabled(boolean disabled)
static void
setViewport(Viewport viewport)
Sets the viewport
-
-
-
Method Detail
-
getClient
public static Client getClient()
-
setForumUser
public static void setForumUser(java.lang.String username, int memberId, ForumRank[] ranks)
-
getForcedFPS
public static int getForcedFPS()
-
setForcedFPS
public static void setForcedFPS(int fps)
-
isRenderingDisabled
public static boolean isRenderingDisabled()
-
setRenderingDisabled
public static void setRenderingDisabled(boolean disabled)
-
getForumUser
public static ForumUser getForumUser()
-
getHost
public static java.lang.String getHost()
-
getMethodContext
public static MethodContext getMethodContext()
-
getLowestPitch
public static int getLowestPitch()
-
getAccountStatus
public static int getAccountStatus()
-
getAgreementStatus
public static int getAgreementStatus()
-
getSocketWrapperWrapper
public static JSockWrapperWrapper getSocketWrapperWrapper()
-
getCanvasImage
public static java.awt.image.BufferedImage getCanvasImage()
-
captureNPCModels
public static void captureNPCModels()
-
getObjectModels
public static java.util.Map<java.lang.Long,ModelWrapper> getObjectModels()
-
getObjectModel
public static ModelWrapper getObjectModel(long hash, boolean force)
-
getPlayerHash
public static java.lang.String getPlayerHash()
Hashes the selected account's username, which is allowed in SDN scripts (unlike getUsername)- Returns:
- A Base64 encoded SHA-256 hash of the player's username if an account is selected, otherwise returns an empty string
-
readyToLoad
public static boolean readyToLoad()
-
getObjectModelCache
public static org.dreambot.api.wrappers.cache.Cache getObjectModelCache()
-
getGameCycle
public static int getGameCycle()
Gets the game cycle- Returns:
- game cycle
-
getFPS
public static int getFPS()
Gets the FPS limit set by the client, or 50 FPS if it's not active- Returns:
- FPS
-
getCurrentTime
public static int getCurrentTime()
Gets current time- Returns:
- current time
-
getIdleTime
public static int getIdleTime()
Gets idle time- Returns:
- idle time
-
getMouseY
public static int getMouseY()
Gets the current mouse Y coordinate of the mouse if inside the canvas.- Returns:
- Y coordinate of the mouse if currently inside the canvas, otherwise -1;
-
getMouseX
public static int getMouseX()
Gets the current mouse X coordinate of the mouse if inside the canvas.- Returns:
- X coordinate of the mouse if currently inside the canvas, otherwise -1;
-
getMousePosition
public static java.awt.Point getMousePosition()
Gets the current mouse position on the game canvas if the canvas contains the mouse.- Returns:
Point
of the position of the mouse if on canvas, otherwise returns -1 for both X and Y coordinates.
-
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 GameState getGameState()
Gets the current game state- Returns:
- game state
-
getGameStateID
public static int getGameStateID()
Gets the current game state ID.- Returns:
- game state
-
getZoom
public static int getZoom()
Gets the current game zoom.- Returns:
- game state
-
getLoginIndex
public static int getLoginIndex()
Gets the login index- Returns:
- login index
-
getLastClickY
@Deprecated public static int getLastClickY()
Deprecated.Gets the last click's y coordinate- Returns:
- y
-
getLastClickX
@Deprecated public static int getLastClickX()
Deprecated.Gets the last click's x coordinate- Returns:
- x
-
getGameImage
public static java.awt.Image getGameImage()
-
getMapAngle
public static int getMapAngle()
Gets map rotation- Returns:
- map 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 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
-
getTileSettings
public static byte[][][] getTileSettings()
Gets tile settings- Returns:
- tile settings
-
getTileHeights
public static int[][][] getTileHeights()
Gets tile heights- Returns:
- tile heights
-
getWidgetYArray
public static int[] getWidgetYArray()
Gets the widget y array- Returns:
- widget Y array
-
getWidgetXArray
public static int[] getWidgetXArray()
Gets the widget x array- Returns:
- widget X array
-
getCurrentWorld
public static int getCurrentWorld()
Gets the current world- Returns:
- current world
-
getValidWidgets
public static boolean[] getValidWidgets()
Gets the valid widgets- Returns:
- valid widgets
-
getWidgetSettings
public static int[] getWidgetSettings()
Gets the widget settings- Returns:
- widget settings
-
getPlayerSettings
public static int[] getPlayerSettings()
Gets player settings- Returns:
- player settings
-
getExperiences
public static int[] getExperiences()
Gets all experience- Returns:
- experiences for all skills
-
getLevels
public static int[] getLevels()
Gets all levels- Returns:
- levels
-
getSpellSelected
public static boolean getSpellSelected()
Checks if a spell is selected- Returns:
- true if a spell is selected false if it isn't
-
getSelectedSpellName
public static java.lang.String getSelectedSpellName()
Gets the last selected spell name- Returns:
- the name of the spell last used
-
getLastSelectedItemName
public static java.lang.String getLastSelectedItemName()
Gets the last selected item name- Returns:
- name of the last/current selected item
-
getSelectionState
public static int getSelectionState()
Gets the selection state- Returns:
- the selection state
-
getCurrentLevels
public static int[] getCurrentLevels()
Get all current levels- Returns:
- current levels
-
getWidgetNodes
public static org.dreambot.api.wrappers.cache.HashTable getWidgetNodes()
Gets the widget nodes- Returns:
- widget nodes
-
getMessageContainers
public static java.util.List<org.dreambot.api.wrappers.cache.MessageContainer> getMessageContainers()
Returns all message containers- Returns:
- message containers
-
getItemTable
public static org.dreambot.api.wrappers.cache.HashTable getItemTable()
Gets the item table- Returns:
- item table
-
getProjectilesRef
public static java.lang.Object getProjectilesRef()
Gets all projectiles- Returns:
- Projectiles references
-
getProjectiles
public static java.util.List<Projectile> getProjectiles()
-
getGraphicsObjects
public static java.util.List<GraphicsObject> getGraphicsObjects()
-
getPassword
public static java.lang.String getPassword()
Returns the player's password- Returns:
- password
-
getRegion
public static Region getRegion()
Gets the current region- Returns:
- region
-
getLocalPlayer
public static Player getLocalPlayer()
Returns your player- Returns:
- Local player
-
getMyPlayerIndex
public static int getMyPlayerIndex()
Gets your local player's index- Returns:
- local player's index
-
getCanvas
public static java.lang.Object getCanvas()
Gets the RS canvas- Returns:
- canvas
-
getWidgets
public static java.lang.Object[][] getWidgets()
Returns the widget references- Returns:
- Widget references
-
getGroundItems
public static org.dreambot.api.wrappers.cache.NodeList[][][] getGroundItems()
Returns the linked list for ground items- Returns:
- all ground items
-
getCollisionMaps
public static CollisionMap[] getCollisionMaps()
Gets all collision maps- Returns:
- collision maps
-
getPlayerReferences
public static java.lang.Object[] getPlayerReferences()
Gets all player references, this is primarily an internally used method, you should usegetPlayers()
instead- Returns:
- An array of the raw player references
-
getPlayers
public static Player[] getPlayers()
Gets all players- Returns:
- All cached players
-
getPlayerAtIndex
public static Player getPlayerAtIndex(int index)
-
getNPCs
public static java.util.List<NPC> getNPCs()
Gets all NPCs- Returns:
- All cached npcs
-
getFriendsSize
public static int getFriendsSize()
Gets the size of your friends list- Returns:
-
getSocialHandler
public static SocialHandler getSocialHandler()
-
getFriendHandler
public static FriendHandler getFriendHandler()
-
getFriends
public static Friend[] getFriends()
Gets your friends- Returns:
- friends
-
getClanMembersSize
public static int getClanMembersSize()
-
getClanMembers
public static java.util.List<ClanMember> getClanMembers()
-
getUsername
public static java.lang.String getUsername()
Gets the login username- Returns:
- username
-
getEntities
public static java.util.List<Entity> getEntities()
Gets all entities- Returns:
- list of all entities
-
getInstance
public static org.dreambot.core.Instance getInstance()
Gets the bot instance- Returns:
- instance
-
getNPCModels
public static java.util.HashMap<java.lang.Integer,ModelWrapper> getNPCModels()
Returns the NPC model cache- Returns:
- NPC model cache
-
getViewport
public static Viewport getViewport()
Returns the current viewport- Returns:
- viewport
-
setViewport
public static void setViewport(Viewport viewport)
Sets the viewport- Parameters:
viewport
- Viewport
-
getViewportWidth
public static int getViewportWidth()
-
getViewportHeight
public static int getViewportHeight()
-
getViewportTools
public static 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 Tile getDestination()
Gets the tile of your destination- Returns:
- Your player's destination, null if not moving
-
getGrandExchangeItems
public static GrandExchangeItem[] getGrandExchangeItems()
Gets an array of the items that you have in the GrandExchange- Returns:
- Array size 6 of GrandExchangeItem
-
isCameraInMotion
public static boolean isCameraInMotion()
Checks if the camera is in motion- Returns:
- true if it's moving false if it's not
-
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 java.lang.String getMessage0()
-
getMessage1
public static java.lang.String getMessage1()
-
getMessage2
public static java.lang.String getMessage2()
-
getLoginResponse
public static RSLoginResponse getLoginResponse()
-
getPlayerComposite
public static PlayerComposite getPlayerComposite(Player player, java.lang.Object playerComposite)
-
getPlayerModel
public static ModelWrapper getPlayerModel(Player player)
-
getMembershipLeft
public static int getMembershipLeft()
-
setMembershipLeft
public static void setMembershipLeft(int membershipLeft)
-
isMembers
public static boolean isMembers()
-
isESCEnabled
public static boolean isESCEnabled()
-
getSelectedItemIndex
public static int getSelectedItemIndex()
-
getHintArrow
@Deprecated public static HintArrow getHintArrow()
Deprecated.
-
initialize
public static Client initialize(org.dreambot.core.Instance instance)
-
-