Interface Client
-
- All Superinterfaces:
GameEngine
,OAuthApi
public interface Client extends OAuthApi, GameEngine
Represents the RuneScape client.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description MessageNode
addChatMessage(ChatMessageType type, java.lang.String name, java.lang.String message, java.lang.String sender)
Adds a new chat message to the chatbox.MessageNode
addChatMessage(ChatMessageType type, java.lang.String name, java.lang.String message, java.lang.String sender, boolean postEvent)
Adds a new chat message to the chatbox.void
changeMemoryMode(boolean lowMemory)
Changes how game behaves based on memory mode.void
changeWorld(World world)
Changes the selected world to log in to.void
checkClickbox(Model model, int orientation, int pitchSin, int pitchCos, int yawSin, int yawCos, int x, int y, int z, long hash)
void
clearHintArrow()
Clears the current hint arrow.IndexedSprite
createIndexedSprite()
Creates an empty indexed sprite.SpritePixels
createItemSprite(int itemId, int quantity, int border, int shadowColor, int stackable, boolean noted, int scale)
Creates an item icon sprite with passed variables.MenuEntry
createMenuEntry(int idx)
Create a new menu entryProjectile
createProjectile(int id, int plane, int startX, int startY, int startZ, int startCycle, int endCycle, int slope, int startHeight, int endHeight, Actor target, int targetX, int targetY)
Create a projectile.RuneLiteObject
createRuneLiteObject()
Creates a RuneLiteObject, which is a modifiedGraphicsObject
ScriptEvent
createScriptEvent(java.lang.Object... args)
Creates a blank ScriptEvent for executing a ClientScript2 scriptSpritePixels
createSpritePixels(int[] pixels, int width, int height)
Creates a sprite image with given width and height containing the pixels.World
createWorld()
Creates a new instance of a world.void
draw2010Menu(int alpha)
Draws a menu in the 2010 interface style.SpritePixels
drawInstanceMap(int z)
Draws an instance map for the current viewed plane.void
drawOriginalMenu(int alpha)
Draws a menu in the OSRS interface style.int
get3dZoom()
AccountType
getAccountType()
Gets the account type of the logged in player.Deque<AmbientSoundEffect>
getAmbientSoundEffects()
Gets the ambient sound effectsint
getBaseX()
Returns the x-axis base coordinate.int
getBaseY()
Returns the y-axis base coordinate.int
getBoostedSkillLevel(Skill skill)
Gets the current modified level of a skill.int[]
getBoostedSkillLevels()
BufferProvider
getBufferProvider()
Gets the clients graphic buffer provider.java.lang.String
getBuildID()
NPC[]
getCachedNPCs()
Gets an array of all cached NPCs.Player[]
getCachedPlayers()
Gets an array of all cached players.Callbacks
getCallbacks()
The injected client invokes these callbacks to send events to usint
getCameraPitch()
Gets the actual pitch of the camera.int
getCameraX()
Gets the x-axis coordinate of the camera.int
getCameraX2()
int
getCameraY()
Gets the y-axis coordinate of the camera.int
getCameraY2()
int
getCameraYaw()
Gets the yaw of the camera.int
getCameraZ()
Gets the z-axis coordinate of the camera.int
getCameraZ2()
java.awt.Canvas
getCanvas()
Gets the canvas that contains everything.int
getCanvasHeight()
Gets the canvas heightint
getCanvasWidth()
Gets the canvas widthint
getCenterX()
int
getCenterY()
java.util.Map<java.lang.Integer,ChatLineBuffer>
getChatLineMap()
Gets the map of chat buffers.ClanChannel
getClanChannel()
Get the primary clan channel the player is in.ClanChannel
getClanChannel(int clanId)
Get clan channel by id.ClanSettings
getClanSettings()
Get clan settings for the clan the user is in.ClanSettings
getClanSettings(int clanId)
Get clan settings by idCollisionData[]
getCollisionMaps()
Gets an array of tile collision data.HashTable<WidgetNode>
getComponentTable()
Gets the widget node component table.SpritePixels[]
getCrossSprites()
Returns the array of cross sprites that appear and animate when left-clickinglong[]
getCrossWorldMessageIds()
Get the list of message ids for the recently received cross-world messages.int
getCrossWorldMessageIdsIndex()
Get the index of the next message to be inserted in the cross world message id listint
getCurrentLoginField()
Gets currently selected login field.Widget
getDraggedOnWidget()
Gets the widget that is being dragged on.Widget
getDraggedWidget()
Gets the widget currently being dragged.int
getDragTime()
Get the number of client cycles the current dragged widget has been dragged for.DrawCallbacks
getDrawCallbacks()
The injected client invokes these callbacks for scene drawing, which is used by the gpu plugin to override the client's normal scene drawing codeint
getEnergy()
Gets the current run energy of the logged in player.EnumComposition
getEnum(int id)
int
getFPS()
Gets the current FPS (frames per second).FriendContainer
getFriendContainer()
Retrieve the nameable container containing friendsFriendsChatManager
getFriendsChatManager()
Retrieve the friends chat managerint
getGameCycle()
Gets the local clients game cycle.GameState
getGameState()
Gets the current game state.GrandExchangeOffer[]
getGrandExchangeOffers()
Gets an array of current grand exchange offers.Deque<GraphicsObject>
getGraphicsObjects()
Gets a list of all graphics objects currently drawn.ClanChannel
getGuestClanChannel()
Get the guest clan channel the player is in.ClanSettings
getGuestClanSettings()
Get the guest clan's settings.NPC
getHintArrowNpc()
Gets the NPC that the hint arrow is directed at.Player
getHintArrowPlayer()
Gets the player that the hint arrow is directed at.WorldPoint
getHintArrowPoint()
Gets the world point that the hint arrow is directed at.HintArrowType
getHintArrowType()
Gets the type of hint arrow currently displayed.int
getIf1DraggedItemIndex()
Get the item index of the item being dragged on an if1 widgetWidget
getIf1DraggedWidget()
Get the if1 widget whose item is being draggedNameableContainer<Ignore>
getIgnoreContainer()
Retrieve the nameable container containing ignoresIndexDataBase
getIndex(int id)
Gets an index by idIndexDataBase
getIndexConfig()
Gets the config index.IndexDataBase
getIndexScripts()
Gets the script index.IndexDataBase
getIndexSprites()
Gets the sprite index.int[][][]
getInstanceTemplateChunks()
Contains a 3D array of template chunks for instanced areas.int[]
getIntStack()
Gets the cs2 vm's int stackint
getIntStackSize()
Gets the length of the cs2 vm's int stackNodeCache
getItemCompositionCache()
Returns client item composition cacheItemContainer
getItemContainer(int id)
Get an item container by idItemContainer
getItemContainer(InventoryID inventory)
Get the item container for an inventory.HashTable<ItemContainer>
getItemContainers()
Get all item containersint
getItemCount()
Returns the max item index + 1 from cacheItemComposition
getItemDefinition(int id)
Gets the item composition corresponding to an items ID.NodeCache
getItemModelCache()
Get the item model cache.int
getItemPressedDuration()
Get the number of client ticks an item has been pressedNodeCache
getItemSpriteCache()
Get the item sprite cache.int
getKeyboardIdleTicks()
Gets the amount of client ticks since the last keyboard press occurred.LocalPoint
getLocalDestinationLocation()
Gets the location of the local player.Player
getLocalPlayer()
Gets the logged in player instance.int
getLoginIndex()
Gets index of current login state.int
getMapAngle()
Gets the angle of the map, or target camera yaw.SpritePixels[]
getMapDots()
Gets an array of currently drawn mini-map dots.MapElementConfig[]
getMapElementConfigs()
Gets an array of all world areasSpritePixels[]
getMapIcons()
Gets an array of current map icon sprites.int[]
getMapRegions()
Gets an array of map region IDs that are currently loaded.IndexedSprite[]
getMapScene()
Gets a sprite of the map sceneMenuEntry[]
getMenuEntries()
Gets an array of currently open right-click menu entries that can be clicked and activated.int
getMenuHeight()
Get the menu height.int
getMenuWidth()
Get the menu width.int
getMenuX()
Get the menu x location.int
getMenuY()
Get the menu y location.IterableHashTable<MessageNode>
getMessages()
Map of message node id to message nodeIndexedSprite[]
getModIcons()
Gets an array of mod icon sprites.Point
getMouseCanvasPosition()
Gets the current position of the mouse on the canvas.int
getMouseCurrentButton()
Gets the current mouse button that is pressed.int
getMouseIdleTicks()
Gets the amount of client ticks since the last mouse movement occurred.long
getMouseLastPressedMillis()
Gets the time at which the last mouse press occurred in milliseconds since the UNIX epoch.int
getMusicCurrentTrackId()
int
getMusicVolume()
Gets the music volumeNPCComposition
getNpcDefinition(int npcId)
Gets the NPC composition corresponding to an NPCs ID.java.util.List<NPC>
getNpcs()
Gets a list of all valid NPCs from the NPC cache.NodeCache
getObjectCompositionCache()
Returns client object composition cacheObjectComposition
getObjectDefinition(int objectId)
Gets the object composition corresponding to an objects ID.int
getOculusOrbFocalPointX()
Gets local X coord where the camera is pointing when the Oculus orb is activeint
getOculusOrbFocalPointY()
Gets local Y coord where the camera is pointing when the Oculus orb is activeint
getOculusOrbState()
Gets the enabled state for the Oculus orb modelong
getOverallExperience()
Get the total experience of the playerint
getPlane()
Gets the current plane the player is on.int[]
getPlayerMenuTypes()
Gets an array of player menu types.java.lang.String[]
getPlayerOptions()
Gets an array of options that can currently be used on other players.boolean[]
getPlayerOptionsPriorities()
Gets an array of whether an option is enabled or not.java.util.List<Player>
getPlayers()
Gets a list of all valid players from the player cache.Preferences
getPreferences()
Gets the clients saved preferences.Deque<Projectile>
getProjectiles()
Gets a list of all projectiles currently spawned.int
getRasterizer3D_clipMidX2()
int
getRasterizer3D_clipMidY2()
int
getRasterizer3D_clipNegativeMidX()
int
getRasterizer3D_clipNegativeMidY()
java.awt.Dimension
getRealDimensions()
Gets the real dimensions of the client before being stretched.int
getRealSkillLevel(Skill skill)
Gets the real level of a skill.int[]
getRealSkillLevels()
RenderOverview
getRenderOverview()
Gets the world map overview.int
getRevision()
Gets the client revision number.int
getScale()
Gets the scale of the world (zoom value).Scene
getScene()
Gets the current sceneWidget
getScriptActiveWidget()
Gets the cs2 vm's active widget This is used for allcc_*
operations with a0
operandWidget
getScriptDotWidget()
Gets the cs2 vm's "dot" widget This is used for all.cc_*
operations with a1
operandint
getSelectedItem()
Get if an item is selected with "Use"int
getSelectedItemIndex()
If an item is selected, this is the item index in the inventory.Tile
getSelectedSceneTile()
Gets the currently selected tile.Widget
getSelectedWidget()
Get the selected widget, such as a selected spell or selected item (eg.int
getSkillExperience(Skill skill)
Gets the current experience towards a skill.int[]
getSkillExperiences()
int
getSkyboxColor()
Gets the RGB color of the skyboxboolean
getSpellSelected()
Is a widget is in target mode?java.util.Map<java.lang.Integer,SpritePixels>
getSpriteOverrides()
Gets a mapping of sprites to override.SpritePixels[]
getSprites(IndexDataBase source, int archiveId, int fileId)
Loads and creates the sprite images of the passed archive and file IDs.java.awt.Dimension
getStretchedDimensions()
Gets the current stretched dimensions of the client.java.lang.String[]
getStringStack()
Gets the cs2 vm's string stackint
getStringStackSize()
Gets the length of the cs2 vm's string stackStructComposition
getStructComposition(int structID)
Gets theStructComposition
for a given struct IDNodeCache
getStructCompositionCache()
Gets the client's cache of in memory struct compositionsTextureProvider
getTextureProvider()
int
getTickCount()
Gets the current server tick count.int[][][]
getTileHeights()
Gets a 3D array containing the heights of tiles in the current scene.byte[][][]
getTileSettings()
Gets a 3D array containing the settings of tiles in the current scene.int
getTopLevelInterfaceId()
Gets Interface ID of the root widgetint
getTotalLevel()
Calculates the total level from real skill levels.java.lang.String
getUsername()
Deprecated.int
getVar(int varbit)
Deprecated.int
getVar(VarClientInt varClientInt)
Gets an int value corresponding to the passed variable.java.lang.String
getVar(VarClientStr varClientStr)
Gets a String value corresponding to the passed variable.int
getVar(VarPlayer varPlayer)
Gets the value corresponding to the passed player variable.VarbitComposition
getVarbit(int id)
Gets the varbit composition for a given varbit idint
getVarbitValue(int varbit)
Gets a value corresponding to the passed varbit.int
getVarbitValue(int[] varps, int varbitId)
Gets the value of a given variable.int
getVarcIntValue(int varcIntId)
Gets the value of a given VarClientIntjava.util.Map<java.lang.Integer,java.lang.Object>
getVarcMap()
Gets an array of all client variables.java.lang.String
getVarcStrValue(int varcStrId)
Gets the value of a given VarClientStrint[]
getVarps()
Gets an array of all client variables.int
getVarpValue(int varpId)
Gets the value of a given VarPlayer.int
getViewportHeight()
Gets the height of the viewport.int
getViewportWidth()
Gets the width of the viewport.int
getViewportXOffset()
Gets the x-axis offset of the viewport.int
getViewportYOffset()
Gets the y-axis offset of the viewport.int
getWeight()
Gets the current weight of the logged in player.Widget
getWidget(int packedID)
Gets a widget by it's packed ID.Widget
getWidget(int groupId, int childId)
Gets a widget by its raw group ID and child ID.Widget
getWidget(WidgetInfo widget)
Gets a widget corresponding to the passed widget info.HashTable<IntegerNode>
getWidgetFlags()
Gets the widget flags table.int[]
getWidgetPositionsX()
Gets an array containing the x-axis canvas positions of all widgets.int[]
getWidgetPositionsY()
Gets an array containing the y-axis canvas positions of all widgets.Widget[]
getWidgetRoots()
Gets the root widgets.NodeCache
getWidgetSpriteCache()
Returns widget sprite cache, to be used withgetSpriteOverrides()
java.util.Map<java.lang.Integer,SpritePixels>
getWidgetSpriteOverrides()
Gets a mapping of widget sprites to override.int
getWorld()
Gets the current world number of the logged in player.World[]
getWorldList()
Gets a list of all RuneScape worlds.java.util.EnumSet<WorldType>
getWorldType()
Gets a set of current world types that apply to the logged in world.int[][]
getXteaKeys()
Returns a 2D array containing XTEA encryption keys used to decrypt map region files.boolean
hasHintArrow()
Checks whether or not there is any active hint arrow.void
hopToWorld(World world)
Hops using in-game world hopper widget to another worldvoid
invalidateStretching(boolean resize)
Invalidates cached dimensions that are used for stretching and scaling.boolean
isDraggingWidget()
Checks whether a widget is currently being dragged.boolean
isFriended(java.lang.String name, boolean mustBeLoggedIn)
Checks whether a player is on the friends list.boolean
isGpu()
boolean
isInInstancedRegion()
Checks whether the logged in player is in an instanced region.boolean
isInterpolateNpcAnimations()
Checks whether animation smoothing is enabled for NPC.boolean
isInterpolateObjectAnimations()
Checks whether animation smoothing is enabled for objects.boolean
isInterpolatePlayerAnimations()
Checks whether animation smoothing is enabled for players.boolean
isKeyPressed(int keycode)
Test if a key is pressedboolean
isMenuOpen()
Checks whether a right-click menu is currently open.boolean
isPlayingJingle()
boolean
isPrayerActive(Prayer prayer)
Checks whether or not a prayer is currently active.boolean
isResized()
Checks whether the client window is currently resized.boolean
isStretchedEnabled()
Checks whether the client is in stretched mode.boolean
isStretchedFast()
Checks whether the client is using fast rendering techniques when stretching the canvas.Animation
loadAnimation(int id)
Loads an animation from the cacheModel
loadModel(int id)
Loads and lights a model from the cache This is equivalent toloadModelData(id).light()
Model
loadModel(int id, short[] colorToFind, short[] colorToReplace)
Loads a model from the cache and also recolors itModelData
loadModelData(int id)
Loads an unlit model from the cache.ModelData
mergeModels(ModelData... models)
ModelData
mergeModels(ModelData[] models, int length)
void
openWorldHopper()
Opens in-game world hopper interfacevoid
playSoundEffect(int id)
Play a sound effect at the player's current location.void
playSoundEffect(int id, int volume)
Plays a sound effect, even if the player's sound effect volume is muted.void
playSoundEffect(int id, int x, int y, int range)
Play a sound effect from some point in the world.void
playSoundEffect(int id, int x, int y, int range, int delay)
Play a sound effect from some point in the world.void
queueChangedSkill(Skill skill)
void
queueChangedVarp(int varp)
Mark the given varp as changed, causing var listeners to be triggered next tickvoid
refreshChat()
Refreshes the chat.void
resetHealthBarCaches()
void
runScript(java.lang.Object... args)
Executes a client script from the cache This method must be ran on the client thread and is not reentrant This method is shorthand forclient.createScriptEvent(args).run()
void
setAllWidgetsAreOpTargetable(boolean value)
Makes all widgets behave as if they areWidgetConfig.WIDGET_USE_TARGET
void
setAttackersHidden(boolean state)
Sets whether attacking players or NPCs are hidden.void
setCameraPitchRelaxerEnabled(boolean enabled)
Sets whether the camera pitch can exceed the normal limits set by the RuneScape client.void
setCameraYawTarget(int cameraYawTarget)
Set the target camera yawvoid
setClanChatMembersHidden(boolean state)
Sets whether or not clan members are hidden.void
setCompass(SpritePixels spritePixels)
Sets the compass sprite.void
setDraggedOnWidget(Widget widget)
Sets the widget that is being dragged on.void
setDrawCallbacks(DrawCallbacks drawCallbacks)
void
setFriendsChatMembersHidden(boolean state)
Sets whether or not friends chat members are hidden.void
setFriendsHidden(boolean state)
Sets whether or not friends are hidden.void
setGameState(GameState gameState)
Sets the current game statevoid
setGeSearchResultCount(int count)
Sets the result count for GE searchvoid
setGeSearchResultIds(short[] ids)
Sets the array of item ids for GE searchvoid
setGeSearchResultIndex(int index)
Sets the starting index in the item id array for GE searchvoid
setGpu(boolean gpu)
void
setHintArrow(WorldPoint point)
Sets a hint arrow to point to the passed location.void
setHintArrow(NPC npc)
Sets a hint arrow to point to the passed NPC.void
setHintArrow(Player player)
Sets a hint arrow to point to the passed player.void
setIgnoresHidden(boolean state)
Sets whether or not ignored players are hidden.void
setInterpolateNpcAnimations(boolean interpolate)
Sets the animation smoothing state for NPCs.void
setInterpolateObjectAnimations(boolean interpolate)
Sets the animation smoothing state for objects.void
setInterpolatePlayerAnimations(boolean interpolate)
Sets the animation smoothing state for players.void
setIntStackSize(int stackSize)
Sets the length of the cs2 vm's int stackvoid
setInventoryDragDelay(int delay)
Sets the inventory drag delay in client game cycles (20ms).void
setInvertPitch(boolean invertPitch)
Sets if the moving the camera vertically should be backwardsvoid
setInvertYaw(boolean invertYaw)
Sets if the moving the camera horizontally should be backwardsvoid
setIsHidingEntities(boolean state)
Sets whether the client is hiding entities.void
setLocalPlayerHidden(boolean state)
Sets whether the local player is hidden.void
setLocalPlayerHidden2D(boolean state)
Sets whether 2D sprites related to the local player are hidden.void
setLoginScreen(SpritePixels pixels)
Sets the image to be used for the login screen, provided as SpritePixels If the image is larger than half the width of fixed mode, it won't get mirrored to the other side of the screenvoid
setMenuEntries(MenuEntry[] entries)
Sets the array of open menu entries.void
setModIcons(IndexedSprite[] modIcons)
Replaces the current mod icons with a new array.void
setMusicVolume(int volume)
Sets the music volumevoid
setNPCsHidden(boolean state)
Sets whether NPCs are hidden.void
setNPCsHidden2D(boolean state)
Sets whether 2D sprites related to the NPCs are hidden.void
setOculusOrbNormalSpeed(int speed)
Sets the normal moving speed when using oculus orb (default value is 12)void
setOculusOrbState(int state)
Sets the enabled state for the Oculus orb statevoid
setOthersHidden(boolean state)
Sets whether or not other players are hidden.void
setOthersHidden2D(boolean state)
Sets whether 2D sprites related to the other players are hidden.void
setOtp(java.lang.String otp)
Sets the 6 digit pin used for authenticator on login screen.void
setPassword(java.lang.String password)
Sets the password on login screen.void
setPetsHidden(boolean state)
Sets whether Pets from other players are hidden.void
setProjectilesHidden(boolean state)
Sets whether projectiles are hidden.void
setRenderArea(boolean[][] renderArea)
void
setScalingFactor(int factor)
Sets the scaling factor when scaling resizable mode.void
setShouldRenderLoginScreenFire(boolean val)
Sets whether the flames on the login screen should be renderedvoid
setSkyboxColor(int skyboxColor)
Sets the RGB color of the skyboxvoid
setSpellSelected(boolean selected)
Sets if a widget is in target modevoid
setStretchedEnabled(boolean state)
Sets the client stretched mode state.void
setStretchedFast(boolean state)
Sets whether to use fast rendering techniques when stretching the canvas.void
setStretchedIntegerScaling(boolean state)
Sets whether to force integer scale factor by rounding scale factors towardszero
when stretching.void
setStretchedKeepAspectRatio(boolean state)
Sets whether to keep aspect ratio when stretching.void
setStringStackSize(int stackSize)
Sets the length of the cs2 vm's string stackvoid
setTickCount(int tickCount)
Sets the current server tick count.void
setUnlockedFps(boolean unlock)
void
setUnlockedFpsTarget(int fps)
void
setUsername(java.lang.String name)
Sets the current logged in username.void
setVar(VarClientInt varClientStr, int value)
Sets a VarClientInt to the passed valuevoid
setVar(VarClientStr varClientStr, java.lang.String value)
Sets a VarClientString to the passed valuevoid
setVarbit(int varbit, int value)
Sets the value of a varbitvoid
setVarbitValue(int[] varps, int varbit, int value)
Sets the value of a given variable.void
stopNow()
Causes the client to shutdown.-
Methods inherited from interface net.runelite.api.GameEngine
getClientThread, isClientThread, resizeCanvas
-
Methods inherited from interface com.jagex.oldscape.pub.OAuthApi
getAccountHash
-
-
-
-
Method Detail
-
getCallbacks
Callbacks getCallbacks()
The injected client invokes these callbacks to send events to us
-
getDrawCallbacks
DrawCallbacks getDrawCallbacks()
The injected client invokes these callbacks for scene drawing, which is used by the gpu plugin to override the client's normal scene drawing code
-
setDrawCallbacks
void setDrawCallbacks(DrawCallbacks drawCallbacks)
-
getBuildID
java.lang.String getBuildID()
-
getPlayers
java.util.List<Player> getPlayers()
Gets a list of all valid players from the player cache.- Returns:
- a list of all players
-
getNpcs
java.util.List<NPC> getNpcs()
Gets a list of all valid NPCs from the NPC cache.- Returns:
- a list of all NPCs
-
getCachedNPCs
NPC[] getCachedNPCs()
Gets an array of all cached NPCs.- Returns:
- cached NPCs
-
getCachedPlayers
Player[] getCachedPlayers()
Gets an array of all cached players.- Returns:
- cached players
-
getBoostedSkillLevel
int getBoostedSkillLevel(Skill skill)
Gets the current modified level of a skill.- Parameters:
skill
- the skill- Returns:
- the modified skill level
-
getRealSkillLevel
int getRealSkillLevel(Skill skill)
Gets the real level of a skill.- Parameters:
skill
- the skill- Returns:
- the skill level
-
getTotalLevel
int getTotalLevel()
Calculates the total level from real skill levels.- Returns:
- the total level
-
addChatMessage
MessageNode addChatMessage(ChatMessageType type, java.lang.String name, java.lang.String message, java.lang.String sender)
Adds a new chat message to the chatbox.- Parameters:
type
- the type of messagename
- the name of the player that sent the messagemessage
- the message contentssender
- the sender/channel name- Returns:
- the message node for the message
-
addChatMessage
MessageNode addChatMessage(ChatMessageType type, java.lang.String name, java.lang.String message, java.lang.String sender, boolean postEvent)
Adds a new chat message to the chatbox.- Parameters:
type
- the type of messagename
- the name of the player that sent the messagemessage
- the message contentssender
- the sender/channel namepostEvent
- whether to post the chat message event- Returns:
- the message node for the message
-
getGameState
GameState getGameState()
Gets the current game state.- Returns:
- the game state
-
setGameState
void setGameState(GameState gameState)
Sets the current game state- Parameters:
gameState
-
-
stopNow
void stopNow()
Causes the client to shutdown. It is faster thanApplet.stop()
because it doesn't wait for 4000ms. This will callSystem.exit(int)
when it is done
-
getUsername
@Deprecated java.lang.String getUsername()
Deprecated.DEPRECATED. See getAccountHash instead. Gets the current logged in username.- Returns:
- the logged in username
- See Also:
OAuthApi.getAccountHash()
-
setUsername
void setUsername(java.lang.String name)
Sets the current logged in username.- Parameters:
name
- the logged in username
-
setPassword
void setPassword(java.lang.String password)
Sets the password on login screen.- Parameters:
password
- the login screen password
-
setOtp
void setOtp(java.lang.String otp)
Sets the 6 digit pin used for authenticator on login screen.- Parameters:
otp
- one time password
-
getCurrentLoginField
int getCurrentLoginField()
Gets currently selected login field. 0 is username, and 1 is password.- Returns:
- currently selected login field
-
getLoginIndex
int getLoginIndex()
Gets index of current login state. 2 is username/password form, 4 is authenticator form- Returns:
- current login state index
-
getAccountType
AccountType getAccountType()
Gets the account type of the logged in player.- Returns:
- the account type
-
getCanvas
java.awt.Canvas getCanvas()
Description copied from interface:GameEngine
Gets the canvas that contains everything.- Specified by:
getCanvas
in interfaceGameEngine
- Returns:
- the game canvas
-
getFPS
int getFPS()
Gets the current FPS (frames per second).- Returns:
- the FPS
-
getCameraX
int getCameraX()
Gets the x-axis coordinate of the camera.This value is a local coordinate value similar to
getLocalDestinationLocation()
.- Returns:
- the camera x coordinate
-
getCameraY
int getCameraY()
Gets the y-axis coordinate of the camera.This value is a local coordinate value similar to
getLocalDestinationLocation()
.- Returns:
- the camera y coordinate
-
getCameraZ
int getCameraZ()
Gets the z-axis coordinate of the camera.This value is a local coordinate value similar to
getLocalDestinationLocation()
.- Returns:
- the camera z coordinate
-
getCameraPitch
int getCameraPitch()
Gets the actual pitch of the camera.The value returned by this method is measured in JAU, or Jagex Angle Unit, which is 1/1024 of a revolution.
- Returns:
- the camera pitch
-
getCameraYaw
int getCameraYaw()
Gets the yaw of the camera.- Returns:
- the camera yaw
-
getWorld
int getWorld()
Gets the current world number of the logged in player.- Returns:
- the logged in world number
-
getCanvasHeight
int getCanvasHeight()
Gets the canvas height- Returns:
-
getCanvasWidth
int getCanvasWidth()
Gets the canvas width- Returns:
-
getViewportHeight
int getViewportHeight()
Gets the height of the viewport.- Returns:
- the viewport height
-
getViewportWidth
int getViewportWidth()
Gets the width of the viewport.- Returns:
- the viewport width
-
getViewportXOffset
int getViewportXOffset()
Gets the x-axis offset of the viewport.- Returns:
- the x-axis offset
-
getViewportYOffset
int getViewportYOffset()
Gets the y-axis offset of the viewport.- Returns:
- the y-axis offset
-
getScale
int getScale()
Gets the scale of the world (zoom value).- Returns:
- the world scale
-
getMouseCanvasPosition
Point getMouseCanvasPosition()
Gets the current position of the mouse on the canvas.- Returns:
- the mouse canvas position
-
getTileHeights
int[][][] getTileHeights()
Gets a 3D array containing the heights of tiles in the current scene.- Returns:
- the tile heights
-
getTileSettings
byte[][][] getTileSettings()
Gets a 3D array containing the settings of tiles in the current scene.- Returns:
- the tile settings
-
getPlane
int getPlane()
Gets the current plane the player is on.This value indicates the current map level above ground level, where ground level is 0. For example, going up a ladder in Lumbridge castle will put the player on plane 1.
Note: This value will never be below 0. Basements and caves below ground level use a tile offset and are still considered plane 0 by the game.
- Returns:
- the plane
-
getScene
Scene getScene()
Gets the current scene
-
getLocalPlayer
Player getLocalPlayer()
Gets the logged in player instance.- Returns:
- the logged in player
-
getItemDefinition
@Nonnull ItemComposition getItemDefinition(int id)
Gets the item composition corresponding to an items ID.- Parameters:
id
- the item ID- Returns:
- the corresponding item composition
- See Also:
ItemID
-
createItemSprite
@Nullable SpritePixels createItemSprite(int itemId, int quantity, int border, int shadowColor, int stackable, boolean noted, int scale)
Creates an item icon sprite with passed variables.- Parameters:
itemId
- the item IDquantity
- the item quantityborder
- whether to draw a bordershadowColor
- the shadow colorstackable
- whether the item is stackablenoted
- whether the item is notedscale
- the scale of the sprite- Returns:
- the created sprite
-
getItemModelCache
NodeCache getItemModelCache()
Get the item model cache. These models are used for drawing widgets of typeWidgetType.MODEL
and inventory item icons- Returns:
-
getItemSpriteCache
NodeCache getItemSpriteCache()
Get the item sprite cache. These are 2d SpritePixels which are used to raster item images on the inventory and on widgets of typeWidgetType.GRAPHIC
- Returns:
-
getSprites
@Nullable SpritePixels[] getSprites(IndexDataBase source, int archiveId, int fileId)
Loads and creates the sprite images of the passed archive and file IDs.- Parameters:
source
- the sprite indexarchiveId
- the sprites archive IDfileId
- the sprites file ID- Returns:
- the sprite image of the file
-
getIndexSprites
IndexDataBase getIndexSprites()
Gets the sprite index.
-
getIndexScripts
IndexDataBase getIndexScripts()
Gets the script index.
-
getIndexConfig
IndexDataBase getIndexConfig()
Gets the config index.
-
getIndex
IndexDataBase getIndex(int id)
Gets an index by id
-
getBaseX
int getBaseX()
Returns the x-axis base coordinate.This value is the x-axis world coordinate of tile (0, 0) in the current scene (ie. the bottom-left most coordinates in the scene).
- Returns:
- the base x-axis coordinate
-
getBaseY
int getBaseY()
Returns the y-axis base coordinate.This value is the y-axis world coordinate of tile (0, 0) in the current scene (ie. the bottom-left most coordinates in the scene).
- Returns:
- the base y-axis coordinate
-
getMouseCurrentButton
int getMouseCurrentButton()
Gets the current mouse button that is pressed.- Returns:
- the pressed mouse button
-
getSelectedSceneTile
@Nullable Tile getSelectedSceneTile()
Gets the currently selected tile. (ie. last right clicked tile)- Returns:
- the selected tile
-
isDraggingWidget
boolean isDraggingWidget()
Checks whether a widget is currently being dragged.- Returns:
- true if dragging a widget, false otherwise
-
getDraggedWidget
@Nullable Widget getDraggedWidget()
Gets the widget currently being dragged.- Returns:
- the dragged widget, null if not dragging any widget
-
getDraggedOnWidget
@Nullable Widget getDraggedOnWidget()
Gets the widget that is being dragged on.The widget being dragged has the
WidgetConfig.DRAG_ON
flag set, and is the widget currently under the dragged widget.- Returns:
- the dragged on widget, null if not dragging any widget
-
setDraggedOnWidget
void setDraggedOnWidget(Widget widget)
Sets the widget that is being dragged on.- Parameters:
widget
- the new dragged on widget
-
getDragTime
int getDragTime()
Get the number of client cycles the current dragged widget has been dragged for.- Returns:
-
getTopLevelInterfaceId
int getTopLevelInterfaceId()
Gets Interface ID of the root widget
-
getWidgetRoots
Widget[] getWidgetRoots()
Gets the root widgets.- Returns:
- the root widgets
-
getWidget
@Nullable Widget getWidget(WidgetInfo widget)
Gets a widget corresponding to the passed widget info.- Parameters:
widget
- the widget info- Returns:
- the widget
-
getWidget
@Nullable Widget getWidget(int groupId, int childId)
Gets a widget by its raw group ID and child ID.Note: Use
getWidget(WidgetInfo)
for a more human-readable version of this method.- Parameters:
groupId
- the group IDchildId
- the child widget ID- Returns:
- the widget corresponding to the group and child pair
-
getWidget
@Nullable Widget getWidget(int packedID)
Gets a widget by it's packed ID.Note: Use
getWidget(WidgetInfo)
orgetWidget(int, int)
for a more readable version of this method.
-
getWidgetPositionsX
int[] getWidgetPositionsX()
Gets an array containing the x-axis canvas positions of all widgets.- Returns:
- array of x-axis widget coordinates
-
getWidgetPositionsY
int[] getWidgetPositionsY()
Gets an array containing the y-axis canvas positions of all widgets.- Returns:
- array of y-axis widget coordinates
-
getEnergy
int getEnergy()
Gets the current run energy of the logged in player.- Returns:
- the run energy
-
getWeight
int getWeight()
Gets the current weight of the logged in player.- Returns:
- the weight
-
getPlayerOptions
java.lang.String[] getPlayerOptions()
Gets an array of options that can currently be used on other players.For example, if the player is in a PVP area the "Attack" option will become available in the array. Otherwise, it won't be there.
- Returns:
- an array of options
-
getPlayerOptionsPriorities
boolean[] getPlayerOptionsPriorities()
Gets an array of whether an option is enabled or not.- Returns:
- the option priorities
-
getPlayerMenuTypes
int[] getPlayerMenuTypes()
Gets an array of player menu types.- Returns:
- the player menu types
-
getWorldList
World[] getWorldList()
Gets a list of all RuneScape worlds.- Returns:
- world list
-
createMenuEntry
MenuEntry createMenuEntry(int idx)
Create a new menu entry- Parameters:
idx
- the index to create the menu entry at. Accepts negative indexes eg. -1 inserts at the end.- Returns:
- the newly created menu entry
-
getMenuEntries
MenuEntry[] getMenuEntries()
Gets an array of currently open right-click menu entries that can be clicked and activated.- Returns:
- array of open menu entries
-
setMenuEntries
void setMenuEntries(MenuEntry[] entries)
Sets the array of open menu entries.This method should typically be used in the context of the
MenuOpened
event, since setting the menu entries will be overwritten the next frame- Parameters:
entries
- new array of open menu entries
-
isMenuOpen
boolean isMenuOpen()
Checks whether a right-click menu is currently open.- Returns:
- true if a menu is open, false otherwise
-
getMenuX
int getMenuX()
Get the menu x location. Only valid if the menu is open.- Returns:
- the menu x location
-
getMenuY
int getMenuY()
Get the menu y location. Only valid if the menu is open.- Returns:
- the menu y location
-
getMenuHeight
int getMenuHeight()
Get the menu height. Only valid if the menu is open.- Returns:
- the menu height
-
getMenuWidth
int getMenuWidth()
Get the menu width. Only valid if the menu is open.- Returns:
- the menu width
-
getMapAngle
int getMapAngle()
Gets the angle of the map, or target camera yaw.- Returns:
- the map angle
-
setCameraYawTarget
void setCameraYawTarget(int cameraYawTarget)
Set the target camera yaw- Parameters:
cameraYawTarget
-
-
isResized
boolean isResized()
Checks whether the client window is currently resized.- Returns:
- true if resized, false otherwise
-
getRevision
int getRevision()
Gets the client revision number.- Returns:
- the revision
-
getMapRegions
int[] getMapRegions()
Gets an array of map region IDs that are currently loaded.- Returns:
- the map regions
-
getInstanceTemplateChunks
int[][][] getInstanceTemplateChunks()
Contains a 3D array of template chunks for instanced areas.The array returned is of format [z][x][y], where z is the plane, x and y the x-axis and y-axis coordinates of a tile divided by the size of a chunk.
The bits of the int value held by the coordinates are -1 if there is no data, structured in the following format:
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |rot| y chunk coord | x chunk coord |pln| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Returns:
- the array of instance template chunks
- See Also:
Constants.CHUNK_SIZE
,InstanceTemplates
-
getXteaKeys
int[][] getXteaKeys()
Returns a 2D array containing XTEA encryption keys used to decrypt map region files.The array maps the region keys at index
n
to the region ID held ingetMapRegions()
atn
.The array of keys for the region make up a 128-bit encryption key spread across 4 integers.
- Returns:
- the XTEA encryption keys
-
getVarps
@VisibleForDevtools int[] getVarps()
Gets an array of all client variables.- Returns:
- local player variables
-
getVarcMap
@VisibleForDevtools java.util.Map<java.lang.Integer,java.lang.Object> getVarcMap()
Gets an array of all client variables.
-
getVar
int getVar(VarPlayer varPlayer)
Gets the value corresponding to the passed player variable.- Parameters:
varPlayer
- the player variable- Returns:
- the value
-
getVar
@Deprecated int getVar(@Varbit int varbit)
Deprecated.Gets a value corresponding to the passed varbit.- Parameters:
varbit
- the varbit id- Returns:
- the value
- See Also:
getVarbitValue(int)
-
getVarbitValue
int getVarbitValue(@Varbit int varbit)
Gets a value corresponding to the passed varbit.- Parameters:
varbit
- the varbit id- Returns:
- the value
-
getVar
int getVar(VarClientInt varClientInt)
Gets an int value corresponding to the passed variable.- Parameters:
varClientInt
- the variable- Returns:
- the value
-
getVar
java.lang.String getVar(VarClientStr varClientStr)
Gets a String value corresponding to the passed variable.- Parameters:
varClientStr
- the variable- Returns:
- the value
-
getVarpValue
@VisibleForExternalPlugins int getVarpValue(int varpId)
Gets the value of a given VarPlayer.- Parameters:
varpId
- the VarPlayer id- Returns:
- the value
-
getVarcIntValue
@VisibleForExternalPlugins int getVarcIntValue(int varcIntId)
Gets the value of a given VarClientInt- Parameters:
varcIntId
- the VarClientInt id- Returns:
- the value
-
getVarcStrValue
@VisibleForExternalPlugins java.lang.String getVarcStrValue(int varcStrId)
Gets the value of a given VarClientStr- Parameters:
varcStrId
- the VarClientStr id- Returns:
- the value
-
setVar
void setVar(VarClientStr varClientStr, java.lang.String value)
Sets a VarClientString to the passed value
-
setVar
void setVar(VarClientInt varClientStr, int value)
Sets a VarClientInt to the passed value
-
setVarbit
void setVarbit(@Varbit int varbit, int value)
Sets the value of a varbit- Parameters:
varbit
- the varbit idvalue
- the new value
-
getVarbit
@VisibleForDevtools @Nullable VarbitComposition getVarbit(int id)
Gets the varbit composition for a given varbit id- Parameters:
id
-- Returns:
-
getVarbitValue
@VisibleForDevtools int getVarbitValue(int[] varps, @Varbit int varbitId)
Gets the value of a given variable.- Parameters:
varps
- passed varbitsvarbitId
- the variable ID- Returns:
- the value
- See Also:
Varbits
-
setVarbitValue
@VisibleForDevtools void setVarbitValue(int[] varps, @Varbit int varbit, int value)
Sets the value of a given variable.- Parameters:
varps
- passed varbitsvarbit
- the variablevalue
- the value- See Also:
Varbits
-
queueChangedVarp
void queueChangedVarp(int varp)
Mark the given varp as changed, causing var listeners to be triggered next tick- Parameters:
varp
-
-
getWidgetFlags
HashTable<IntegerNode> getWidgetFlags()
Gets the widget flags table.- Returns:
- the widget flags table
-
getComponentTable
HashTable<WidgetNode> getComponentTable()
Gets the widget node component table.- Returns:
- the widget node component table
- See Also:
WidgetNode
-
getGrandExchangeOffers
GrandExchangeOffer[] getGrandExchangeOffers()
Gets an array of current grand exchange offers.- Returns:
- all grand exchange offers
-
isPrayerActive
boolean isPrayerActive(Prayer prayer)
Checks whether or not a prayer is currently active.- Parameters:
prayer
- the prayer- Returns:
- true if the prayer is active, false otherwise
-
getSkillExperience
int getSkillExperience(Skill skill)
Gets the current experience towards a skill.- Parameters:
skill
- the skill- Returns:
- the experience
-
getOverallExperience
long getOverallExperience()
Get the total experience of the player- Returns:
-
refreshChat
void refreshChat()
Refreshes the chat.
-
getChatLineMap
java.util.Map<java.lang.Integer,ChatLineBuffer> getChatLineMap()
Gets the map of chat buffers.- Returns:
- the chat buffers
-
getMessages
IterableHashTable<MessageNode> getMessages()
Map of message node id to message node- Returns:
- the map
-
getObjectDefinition
ObjectComposition getObjectDefinition(int objectId)
Gets the object composition corresponding to an objects ID.- Parameters:
objectId
- the object ID- Returns:
- the corresponding object composition
- See Also:
ObjectID
-
getNpcDefinition
NPCComposition getNpcDefinition(int npcId)
Gets the NPC composition corresponding to an NPCs ID.- Parameters:
npcId
- the npc ID- Returns:
- the corresponding NPC composition
- See Also:
NpcID
-
getStructComposition
StructComposition getStructComposition(int structID)
Gets theStructComposition
for a given struct ID- See Also:
StructID
-
getStructCompositionCache
NodeCache getStructCompositionCache()
Gets the client's cache of in memory struct compositions
-
getMapElementConfigs
MapElementConfig[] getMapElementConfigs()
Gets an array of all world areas- Returns:
- the world areas
-
getMapScene
IndexedSprite[] getMapScene()
Gets a sprite of the map scene- Returns:
- the sprite
-
getMapDots
SpritePixels[] getMapDots()
Gets an array of currently drawn mini-map dots.- Returns:
- all mini-map dots
-
getGameCycle
int getGameCycle()
Gets the local clients game cycle.Note: This value is incremented every 20ms.
- Returns:
- the game cycle
-
getMapIcons
SpritePixels[] getMapIcons()
Gets an array of current map icon sprites.- Returns:
- the map icons
-
getModIcons
IndexedSprite[] getModIcons()
Gets an array of mod icon sprites.- Returns:
- the mod icons
-
setModIcons
void setModIcons(IndexedSprite[] modIcons)
Replaces the current mod icons with a new array.- Parameters:
modIcons
- the new mod icons
-
createIndexedSprite
IndexedSprite createIndexedSprite()
Creates an empty indexed sprite.- Returns:
- the sprite
-
createSpritePixels
SpritePixels createSpritePixels(int[] pixels, int width, int height)
Creates a sprite image with given width and height containing the pixels.- Parameters:
pixels
- the pixelswidth
- the widthheight
- the height- Returns:
- the sprite image
-
getLocalDestinationLocation
@Nullable LocalPoint getLocalDestinationLocation()
Gets the location of the local player.- Returns:
- the local player location
-
createProjectile
Projectile createProjectile(int id, int plane, int startX, int startY, int startZ, int startCycle, int endCycle, int slope, int startHeight, int endHeight, @Nullable Actor target, int targetX, int targetY)
Create a projectile.- Parameters:
id
- projectile/spotanim idplane
- plane the projectile is onstartX
- local x coordinate the projectile starts atstartY
- local y coordinate the projectile starts atstartZ
- local z coordinate the projectile starts at - includes tile heightstartCycle
- cycle the project startsendCycle
- cycle the projectile endsslope
-startHeight
- start height of projectile - excludes tile heightendHeight
- end height of projectile - excludes tile heighttarget
- optional actor targettargetX
- target x - if an actor target is supplied should be the target xtargetY
- taret y - if an actor target is supplied should be the target y- Returns:
- the new projectile
-
getProjectiles
Deque<Projectile> getProjectiles()
Gets a list of all projectiles currently spawned.- Returns:
- all projectiles
-
getGraphicsObjects
Deque<GraphicsObject> getGraphicsObjects()
Gets a list of all graphics objects currently drawn.- Returns:
- all graphics objects
-
createRuneLiteObject
RuneLiteObject createRuneLiteObject()
Creates a RuneLiteObject, which is a modifiedGraphicsObject
-
loadModelData
@Nullable ModelData loadModelData(int id)
Loads an unlit model from the cache. The returned model shares data such as faces, face colors, face transparencies, and vertex points with other models. If you want to mutate these you MUST call the relevantcloneX
method.- Parameters:
id
- the ID of the model- Returns:
- the model or null if it is loading or nonexistent
- See Also:
ModelData.cloneColors()
-
loadModel
@Nullable Model loadModel(int id)
Loads and lights a model from the cache This is equivalent toloadModelData(id).light()
- Parameters:
id
- the ID of the model- Returns:
- the model or null if it is loading or nonexistent
-
loadModel
@Nullable Model loadModel(int id, short[] colorToFind, short[] colorToReplace)
Loads a model from the cache and also recolors it- Parameters:
id
- the ID of the modelcolorToFind
- array of hsl color values to find in the model to replacecolorToReplace
- array of hsl color values to replace in the model- Returns:
- the model or null if it is loading or nonexistent
-
loadAnimation
Animation loadAnimation(int id)
Loads an animation from the cache- Parameters:
id
- the ID of the animation. Any int is allowed, but implementations in the client should be defined inAnimationID
-
getMusicVolume
int getMusicVolume()
Gets the music volume- Returns:
- volume 0-255 inclusive
-
setMusicVolume
void setMusicVolume(int volume)
Sets the music volume- Parameters:
volume
- 0-255 inclusive
-
isPlayingJingle
boolean isPlayingJingle()
- Returns:
- true if the current
getMusicCurrentTrackId()
is a Jingle, otherwise its a Track
-
getMusicCurrentTrackId
int getMusicCurrentTrackId()
- Returns:
- Currently playing music/jingle id, or -1 if not playing
- See Also:
isPlayingJingle()
-
playSoundEffect
void playSoundEffect(int id)
Play a sound effect at the player's current location. This is how UI, and player-generated (e.g. mining, woodcutting) sound effects are normally played.- Parameters:
id
- the ID of the sound to play. Any int is allowed, but seeSoundEffectID
for some common ones
-
playSoundEffect
void playSoundEffect(int id, int x, int y, int range)
Play a sound effect from some point in the world.- Parameters:
id
- the ID of the sound to play. Any int is allowed, but seeSoundEffectID
for some common onesx
- the ground coordinate on the x axisy
- the ground coordinate on the y axisrange
- the number of tiles away that the sound can be heard from
-
playSoundEffect
void playSoundEffect(int id, int x, int y, int range, int delay)
Play a sound effect from some point in the world.- Parameters:
id
- the ID of the sound to play. Any int is allowed, but seeSoundEffectID
for some common onesx
- the ground coordinate on the x axisy
- the ground coordinate on the y axisrange
- the number of tiles away that the sound can be heard fromdelay
- the amount of frames before the sound starts playing
-
playSoundEffect
void playSoundEffect(int id, int volume)
Plays a sound effect, even if the player's sound effect volume is muted.- Parameters:
id
- the ID of the sound effect -SoundEffectID
volume
- the volume to play the sound effect at, seeSoundEffectVolume
for values used in the settings interface. if the sound effect volume is not muted, uses the set volume
-
getBufferProvider
BufferProvider getBufferProvider()
Gets the clients graphic buffer provider.- Returns:
- the buffer provider
-
getMouseIdleTicks
int getMouseIdleTicks()
Gets the amount of client ticks since the last mouse movement occurred.- Returns:
- amount of idle mouse ticks
- See Also:
Constants.CLIENT_TICK_LENGTH
-
getMouseLastPressedMillis
long getMouseLastPressedMillis()
Gets the time at which the last mouse press occurred in milliseconds since the UNIX epoch.
-
getKeyboardIdleTicks
int getKeyboardIdleTicks()
Gets the amount of client ticks since the last keyboard press occurred.- Returns:
- amount of idle keyboard ticks
- See Also:
Constants.CLIENT_TICK_LENGTH
-
changeMemoryMode
void changeMemoryMode(boolean lowMemory)
Changes how game behaves based on memory mode. Low memory mode skips drawing of all floors and renders ground textures in low quality.- Parameters:
lowMemory
- if we are running in low memory mode or not
-
getItemContainer
@Nullable ItemContainer getItemContainer(InventoryID inventory)
Get the item container for an inventory.- Parameters:
inventory
- the inventory type- Returns:
- the item container
- See Also:
InventoryID
-
getItemContainer
@Nullable ItemContainer getItemContainer(int id)
Get an item container by id- Parameters:
id
- the inventory id- Returns:
- the item container
- See Also:
InventoryID
-
getItemContainers
HashTable<ItemContainer> getItemContainers()
Get all item containers- Returns:
-
getIntStackSize
int getIntStackSize()
Gets the length of the cs2 vm's int stack
-
setIntStackSize
void setIntStackSize(int stackSize)
Sets the length of the cs2 vm's int stack
-
getIntStack
int[] getIntStack()
Gets the cs2 vm's int stack
-
getStringStackSize
int getStringStackSize()
Gets the length of the cs2 vm's string stack
-
setStringStackSize
void setStringStackSize(int stackSize)
Sets the length of the cs2 vm's string stack
-
getStringStack
java.lang.String[] getStringStack()
Gets the cs2 vm's string stack
-
getScriptActiveWidget
Widget getScriptActiveWidget()
Gets the cs2 vm's active widget This is used for allcc_*
operations with a0
operand
-
getScriptDotWidget
Widget getScriptDotWidget()
Gets the cs2 vm's "dot" widget This is used for all.cc_*
operations with a1
operand
-
isFriended
boolean isFriended(java.lang.String name, boolean mustBeLoggedIn)
Checks whether a player is on the friends list.- Parameters:
name
- the name of the playermustBeLoggedIn
- if they player is online- Returns:
- true if the player is friends
-
getFriendsChatManager
@Nullable FriendsChatManager getFriendsChatManager()
Retrieve the friends chat manager- Returns:
-
getFriendContainer
FriendContainer getFriendContainer()
Retrieve the nameable container containing friends- Returns:
-
getIgnoreContainer
NameableContainer<Ignore> getIgnoreContainer()
Retrieve the nameable container containing ignores- Returns:
-
getPreferences
Preferences getPreferences()
Gets the clients saved preferences.- Returns:
- the client preferences
-
setCameraPitchRelaxerEnabled
void setCameraPitchRelaxerEnabled(boolean enabled)
Sets whether the camera pitch can exceed the normal limits set by the RuneScape client.- Parameters:
enabled
- new camera pitch relaxer value
-
setInvertYaw
void setInvertYaw(boolean invertYaw)
Sets if the moving the camera horizontally should be backwards
-
setInvertPitch
void setInvertPitch(boolean invertPitch)
Sets if the moving the camera vertically should be backwards
-
getRenderOverview
RenderOverview getRenderOverview()
Gets the world map overview.- Returns:
- the world map overview
-
isStretchedEnabled
boolean isStretchedEnabled()
Checks whether the client is in stretched mode.- Returns:
- true if the client is in stretched mode, false otherwise
-
setStretchedEnabled
void setStretchedEnabled(boolean state)
Sets the client stretched mode state.- Parameters:
state
- new stretched mode state
-
isStretchedFast
boolean isStretchedFast()
Checks whether the client is using fast rendering techniques when stretching the canvas.- Returns:
- true if stretching is fast rendering, false otherwise
-
setStretchedFast
void setStretchedFast(boolean state)
Sets whether to use fast rendering techniques when stretching the canvas.- Parameters:
state
- new fast rendering state
-
setStretchedIntegerScaling
void setStretchedIntegerScaling(boolean state)
Sets whether to force integer scale factor by rounding scale factors towardszero
when stretching.- Parameters:
state
- new integer scaling state
-
setStretchedKeepAspectRatio
void setStretchedKeepAspectRatio(boolean state)
Sets whether to keep aspect ratio when stretching.- Parameters:
state
- new keep aspect ratio state
-
setScalingFactor
void setScalingFactor(int factor)
Sets the scaling factor when scaling resizable mode.- Parameters:
factor
- new scaling factor
-
invalidateStretching
void invalidateStretching(boolean resize)
Invalidates cached dimensions that are used for stretching and scaling.- Parameters:
resize
- true to tell the game to resize the canvas on the next frame, false otherwise.
-
getStretchedDimensions
java.awt.Dimension getStretchedDimensions()
Gets the current stretched dimensions of the client.- Returns:
- the stretched dimensions
-
getRealDimensions
java.awt.Dimension getRealDimensions()
Gets the real dimensions of the client before being stretched.- Returns:
- the real dimensions
-
changeWorld
void changeWorld(World world)
Changes the selected world to log in to.Note: this method will have no effect unless
GameState
isGameState.LOGIN_SCREEN
.- Parameters:
world
- the world to switch to
-
createWorld
World createWorld()
Creates a new instance of a world.
-
drawInstanceMap
SpritePixels drawInstanceMap(int z)
Draws an instance map for the current viewed plane.- Parameters:
z
- the plane- Returns:
- the map sprite
-
runScript
void runScript(java.lang.Object... args)
Executes a client script from the cache This method must be ran on the client thread and is not reentrant This method is shorthand forclient.createScriptEvent(args).run()
- Parameters:
args
- the script id, then any additional arguments to execute the script with- See Also:
ScriptID
-
createScriptEvent
ScriptEvent createScriptEvent(java.lang.Object... args)
Creates a blank ScriptEvent for executing a ClientScript2 script- Parameters:
args
- the script id, then any additional arguments to execute the script with- See Also:
ScriptID
-
hasHintArrow
boolean hasHintArrow()
Checks whether or not there is any active hint arrow.- Returns:
- true if there is a hint arrow, false otherwise
-
getHintArrowType
HintArrowType getHintArrowType()
Gets the type of hint arrow currently displayed.- Returns:
- the hint arrow type
-
clearHintArrow
void clearHintArrow()
Clears the current hint arrow.
-
setHintArrow
void setHintArrow(WorldPoint point)
Sets a hint arrow to point to the passed location.- Parameters:
point
- the location
-
setHintArrow
void setHintArrow(Player player)
Sets a hint arrow to point to the passed player.- Parameters:
player
- the player
-
setHintArrow
void setHintArrow(NPC npc)
Sets a hint arrow to point to the passed NPC.- Parameters:
npc
- the NPC
-
getHintArrowPoint
WorldPoint getHintArrowPoint()
Gets the world point that the hint arrow is directed at.- Returns:
- hint arrow target
-
getHintArrowPlayer
Player getHintArrowPlayer()
Gets the player that the hint arrow is directed at.- Returns:
- hint arrow target
-
getHintArrowNpc
NPC getHintArrowNpc()
Gets the NPC that the hint arrow is directed at.- Returns:
- hint arrow target
-
isInterpolatePlayerAnimations
boolean isInterpolatePlayerAnimations()
Checks whether animation smoothing is enabled for players.- Returns:
- true if player animation smoothing is enabled, false otherwise
-
setInterpolatePlayerAnimations
void setInterpolatePlayerAnimations(boolean interpolate)
Sets the animation smoothing state for players.- Parameters:
interpolate
- the new smoothing state
-
isInterpolateNpcAnimations
boolean isInterpolateNpcAnimations()
Checks whether animation smoothing is enabled for NPC.- Returns:
- true if NPC animation smoothing is enabled, false otherwise
-
setInterpolateNpcAnimations
void setInterpolateNpcAnimations(boolean interpolate)
Sets the animation smoothing state for NPCs.- Parameters:
interpolate
- the new smoothing state
-
isInterpolateObjectAnimations
boolean isInterpolateObjectAnimations()
Checks whether animation smoothing is enabled for objects.- Returns:
- true if object animation smoothing is enabled, false otherwise
-
setInterpolateObjectAnimations
void setInterpolateObjectAnimations(boolean interpolate)
Sets the animation smoothing state for objects.- Parameters:
interpolate
- the new smoothing state
-
isInInstancedRegion
boolean isInInstancedRegion()
Checks whether the logged in player is in an instanced region.- Returns:
- true if the player is in instanced region, false otherwise
-
getItemPressedDuration
int getItemPressedDuration()
Get the number of client ticks an item has been pressed- Returns:
- the number of client ticks an item has been pressed
-
setIsHidingEntities
void setIsHidingEntities(boolean state)
Sets whether the client is hiding entities.This method does not itself hide any entities. It behaves as a master switch for whether or not any of the related entities are hidden or shown. If this method is set to false, changing the configurations for specific entities will have no effect.
- Parameters:
state
- new entity hiding state
-
setOthersHidden
void setOthersHidden(boolean state)
Sets whether or not other players are hidden.- Parameters:
state
- the new player hidden state
-
setOthersHidden2D
void setOthersHidden2D(boolean state)
Sets whether 2D sprites related to the other players are hidden. (ie. overhead prayers, PK skull)- Parameters:
state
- the new player 2D hidden state
-
setFriendsHidden
void setFriendsHidden(boolean state)
Sets whether or not friends are hidden.- Parameters:
state
- the new friends hidden state
-
setFriendsChatMembersHidden
void setFriendsChatMembersHidden(boolean state)
Sets whether or not friends chat members are hidden.- Parameters:
state
- the new friends chat member hidden state
-
setClanChatMembersHidden
void setClanChatMembersHidden(boolean state)
Sets whether or not clan members are hidden.- Parameters:
state
- the new clan chat member hidden state
-
setIgnoresHidden
void setIgnoresHidden(boolean state)
Sets whether or not ignored players are hidden.- Parameters:
state
- the new ignored player hidden state
-
setLocalPlayerHidden
void setLocalPlayerHidden(boolean state)
Sets whether the local player is hidden.- Parameters:
state
- new local player hidden state
-
setLocalPlayerHidden2D
void setLocalPlayerHidden2D(boolean state)
Sets whether 2D sprites related to the local player are hidden. (ie. overhead prayers, PK skull)- Parameters:
state
- new local player 2D hidden state
-
setNPCsHidden
void setNPCsHidden(boolean state)
Sets whether NPCs are hidden.- Parameters:
state
- new NPC hidden state
-
setNPCsHidden2D
void setNPCsHidden2D(boolean state)
Sets whether 2D sprites related to the NPCs are hidden. (ie. overhead prayers)- Parameters:
state
- new NPC 2D hidden state
-
setPetsHidden
void setPetsHidden(boolean state)
Sets whether Pets from other players are hidden.- Parameters:
state
- new pet hidden state
-
setAttackersHidden
void setAttackersHidden(boolean state)
Sets whether attacking players or NPCs are hidden.- Parameters:
state
- new attacker hidden state
-
setProjectilesHidden
void setProjectilesHidden(boolean state)
Sets whether projectiles are hidden.- Parameters:
state
- new projectile hidden state
-
getCollisionMaps
@Nullable CollisionData[] getCollisionMaps()
Gets an array of tile collision data.The index into the array is the plane/z-axis coordinate.
- Returns:
- the collision data
-
getBoostedSkillLevels
@VisibleForDevtools int[] getBoostedSkillLevels()
-
getRealSkillLevels
@VisibleForDevtools int[] getRealSkillLevels()
-
getSkillExperiences
@VisibleForDevtools int[] getSkillExperiences()
-
queueChangedSkill
void queueChangedSkill(Skill skill)
-
getSpriteOverrides
java.util.Map<java.lang.Integer,SpritePixels> getSpriteOverrides()
Gets a mapping of sprites to override.The key value in the map corresponds to the ID of the sprite, and the value the sprite to replace it with.
-
getWidgetSpriteOverrides
java.util.Map<java.lang.Integer,SpritePixels> getWidgetSpriteOverrides()
Gets a mapping of widget sprites to override.The key value in the map corresponds to the packed widget ID, and the value the sprite to replace the widgets sprite with.
-
setCompass
void setCompass(SpritePixels spritePixels)
Sets the compass sprite.- Parameters:
spritePixels
- the new sprite
-
getWidgetSpriteCache
NodeCache getWidgetSpriteCache()
Returns widget sprite cache, to be used withgetSpriteOverrides()
- Returns:
- the cache
-
getTickCount
int getTickCount()
Gets the current server tick count.- Returns:
- the tick count
-
setTickCount
void setTickCount(int tickCount)
Sets the current server tick count.- Parameters:
tickCount
- the new tick count
-
setInventoryDragDelay
void setInventoryDragDelay(int delay)
Sets the inventory drag delay in client game cycles (20ms).- Parameters:
delay
- the number of game cycles to delay dragging
-
getWorldType
java.util.EnumSet<WorldType> getWorldType()
Gets a set of current world types that apply to the logged in world.- Returns:
- the types for current world
-
getOculusOrbState
int getOculusOrbState()
Gets the enabled state for the Oculus orb mode
-
setOculusOrbState
void setOculusOrbState(int state)
Sets the enabled state for the Oculus orb state- Parameters:
state
- boolean enabled value
-
setOculusOrbNormalSpeed
void setOculusOrbNormalSpeed(int speed)
Sets the normal moving speed when using oculus orb (default value is 12)
-
getOculusOrbFocalPointX
int getOculusOrbFocalPointX()
Gets local X coord where the camera is pointing when the Oculus orb is active
-
getOculusOrbFocalPointY
int getOculusOrbFocalPointY()
Gets local Y coord where the camera is pointing when the Oculus orb is active
-
openWorldHopper
void openWorldHopper()
Opens in-game world hopper interface
-
hopToWorld
void hopToWorld(World world)
Hops using in-game world hopper widget to another world- Parameters:
world
- target world to hop to
-
setSkyboxColor
void setSkyboxColor(int skyboxColor)
Sets the RGB color of the skybox
-
getSkyboxColor
int getSkyboxColor()
Gets the RGB color of the skybox
-
isGpu
boolean isGpu()
-
setGpu
void setGpu(boolean gpu)
-
get3dZoom
int get3dZoom()
-
getCenterX
int getCenterX()
-
getCenterY
int getCenterY()
-
getCameraX2
int getCameraX2()
-
getCameraY2
int getCameraY2()
-
getCameraZ2
int getCameraZ2()
-
getTextureProvider
TextureProvider getTextureProvider()
-
setRenderArea
void setRenderArea(boolean[][] renderArea)
-
getRasterizer3D_clipMidX2
int getRasterizer3D_clipMidX2()
-
getRasterizer3D_clipNegativeMidX
int getRasterizer3D_clipNegativeMidX()
-
getRasterizer3D_clipNegativeMidY
int getRasterizer3D_clipNegativeMidY()
-
getRasterizer3D_clipMidY2
int getRasterizer3D_clipMidY2()
-
checkClickbox
void checkClickbox(Model model, int orientation, int pitchSin, int pitchCos, int yawSin, int yawCos, int x, int y, int z, long hash)
-
getIf1DraggedWidget
Widget getIf1DraggedWidget()
Get the if1 widget whose item is being dragged- Returns:
-
getIf1DraggedItemIndex
int getIf1DraggedItemIndex()
Get the item index of the item being dragged on an if1 widget- Returns:
-
getSpellSelected
boolean getSpellSelected()
Is a widget is in target mode?
-
setSpellSelected
void setSpellSelected(boolean selected)
Sets if a widget is in target mode
-
getSelectedItem
int getSelectedItem()
Get if an item is selected with "Use"- Returns:
- 1 if selected, else 0
-
getSelectedItemIndex
int getSelectedItemIndex()
If an item is selected, this is the item index in the inventory.- Returns:
-
getSelectedWidget
@Nullable Widget getSelectedWidget()
Get the selected widget, such as a selected spell or selected item (eg. "Use")- Returns:
- the selected widget
-
getItemCompositionCache
NodeCache getItemCompositionCache()
Returns client item composition cache
-
getObjectCompositionCache
NodeCache getObjectCompositionCache()
Returns client object composition cache- Returns:
-
getCrossSprites
SpritePixels[] getCrossSprites()
Returns the array of cross sprites that appear and animate when left-clicking
-
getEnum
EnumComposition getEnum(int id)
-
draw2010Menu
void draw2010Menu(int alpha)
Draws a menu in the 2010 interface style.- Parameters:
alpha
- background transparency of the menu
-
drawOriginalMenu
void drawOriginalMenu(int alpha)
Draws a menu in the OSRS interface style.- Parameters:
alpha
- background transparency of the menu
-
resetHealthBarCaches
void resetHealthBarCaches()
-
getItemCount
int getItemCount()
Returns the max item index + 1 from cache
-
setAllWidgetsAreOpTargetable
void setAllWidgetsAreOpTargetable(boolean value)
Makes all widgets behave as if they areWidgetConfig.WIDGET_USE_TARGET
-
setGeSearchResultCount
void setGeSearchResultCount(int count)
Sets the result count for GE search
-
setGeSearchResultIds
void setGeSearchResultIds(short[] ids)
Sets the array of item ids for GE search
-
setGeSearchResultIndex
void setGeSearchResultIndex(int index)
Sets the starting index in the item id array for GE search
-
setLoginScreen
void setLoginScreen(SpritePixels pixels)
Sets the image to be used for the login screen, provided as SpritePixels If the image is larger than half the width of fixed mode, it won't get mirrored to the other side of the screen
-
setShouldRenderLoginScreenFire
void setShouldRenderLoginScreenFire(boolean val)
Sets whether the flames on the login screen should be rendered
-
isKeyPressed
boolean isKeyPressed(int keycode)
Test if a key is pressed- Parameters:
keycode
- the keycode- Returns:
- See Also:
KeyCode
-
getCrossWorldMessageIds
long[] getCrossWorldMessageIds()
Get the list of message ids for the recently received cross-world messages. The upper 32 bits of the id is the world id, the lower is a sequence number per-world.- Returns:
-
getCrossWorldMessageIdsIndex
int getCrossWorldMessageIdsIndex()
Get the index of the next message to be inserted in the cross world message id list- Returns:
-
getClanChannel
@Nullable ClanChannel getClanChannel()
Get the primary clan channel the player is in.- Returns:
-
getGuestClanChannel
@Nullable ClanChannel getGuestClanChannel()
Get the guest clan channel the player is in.- Returns:
-
getClanSettings
@Nullable ClanSettings getClanSettings()
Get clan settings for the clan the user is in.- Returns:
-
getGuestClanSettings
@Nullable ClanSettings getGuestClanSettings()
Get the guest clan's settings.- Returns:
-
getClanChannel
@Nullable ClanChannel getClanChannel(int clanId)
Get clan channel by id.- Parameters:
clanId
- the clan id- Returns:
- See Also:
ClanID
-
getClanSettings
@Nullable ClanSettings getClanSettings(int clanId)
Get clan settings by id- Parameters:
clanId
- the clan id- Returns:
- See Also:
ClanID
-
setUnlockedFps
void setUnlockedFps(boolean unlock)
-
setUnlockedFpsTarget
void setUnlockedFpsTarget(int fps)
-
getAmbientSoundEffects
Deque<AmbientSoundEffect> getAmbientSoundEffects()
Gets the ambient sound effects- Returns:
-
-