Class Client


  • public class Client
    extends java.lang.Object
    • 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()
      • 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 (Uses getBaseX() and getBaseY()) 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
      • getMenu

        @Deprecated
        public static Menu getMenu()
        Deprecated.
        see Menu
      • 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 use getPlayers() 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()
      • getPlayerComposite

        public static PlayerComposite getPlayerComposite​(Player player,
                                                         java.lang.Object playerComposite)
      • 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)