public class Controller
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int[] |
bankerIds |
static int |
CTRL_DOWN_MASK |
orsc.mudclient |
mud |
static int |
SHIFT_DOWN_MASK |
static boolean |
temporaryToggleSideMenu |
Constructor and Description |
---|
Controller(Reflector _reflector,
orsc.OpenRSC _client,
orsc.mudclient _mud) |
Modifier and Type | Method and Description |
---|---|
void |
acceptTrade()
Accepts the trade on the first trade window.
|
void |
acceptTradeConfirmation()
Accepts the current trade on the final trade window.
|
void |
addFriend(java.lang.String username)
Adds a friend to the user's friend list.
|
void |
addIgnore(java.lang.String username)
Adds the specified username to the ignore list
|
boolean |
atObject(int id)
Performs the primary command option on the nearest reachable objectId
|
boolean |
atObject(int x,
int y)
Performs the primary command option on the specified object id at the specified coordinates.
|
boolean |
atObject(SceneryId id)
Performs the primary command option on the nearest reachable scenery ID
|
boolean |
atObject2(int id)
Performs the second command option on the nearest reachable objectId
|
boolean |
atObject2(int x,
int y)
Performs the 2nd command option on the specified object id at the specified coordinates.
|
void |
attackNpc(int npcServerIndex)
Attacks the specified NPC.
|
void |
attackPlayer(int playerServerIndex)
Attacks the specified player.
|
void |
atWallObject(int x,
int y)
Walks to the wall object and then interacts with it.
|
void |
atWallObject2(int x,
int y)
Walks to the wall object and then interacts with it (secondary interaction.)
|
void |
auctionBuy(AuctionItem auction,
int itemAmount)
Buys an amount of items from a given auction id.
|
void |
auctionBuyAll(AuctionItem auction)
This method can potentially use all of your carried coins so be cautious when using it.
Attempts to buy all items from the given AuctionItem. |
void |
auctionCancel(AuctionItem auction)
Cancels an auction.
|
void |
auctionCreate(int itemId,
int itemAmount,
int pricePerItem)
Lists an amount of itemId for a specified price in the auction house.
|
void |
auctionRefresh()
Refreshes the Auction House listings.
|
AuctionItem |
auctionSearchCheapestOfItemId(int itemId)
Returns an AuctionItem with the cheapest price per item for an item id.
|
java.util.ArrayList<AuctionItem> |
auctionSearchForItemId(int itemId)
Returns an ArrayList of AuctionItems for a given item id.
|
void |
beginAuctionTimeout()
The auction house requires a minimum of 5 seconds between each interaction.
|
int |
calculateNpcLevel(int npcId)
Calculates an NPC's level based on it's stats
|
boolean |
canCastSpell(int spellId)
Determines if the player can cast a specific spell (high enough stat level and has runes)
|
void |
castSpellOnGroundItem(int spellId,
int itemId,
int x,
int y)
Casts the specified spell on the specified ground item on the specified tile.
|
void |
castSpellOnInventoryItem(int spellId,
int slotIndex)
Casts the specified spell on the specified inventory item.
|
void |
castSpellOnNpc(int serverIndex,
int spellId)
Casts the specified spell on the specified npc.
|
void |
castSpellOnObject(int spellId,
int x,
int y)
Casts the specified spell on the object at the specified coordinates.
|
void |
castSpellOnPlayer(int spellId,
int playerServerIndex)
Casts the specified spell on the specified player.
|
void |
castSpellOnSelf(int spellId)
Casts the specified spell on the player.
|
void |
chatMessage(java.lang.String rstext) |
void |
closeAuctionHouse()
Closes the Auction House window
|
void |
closeBank()
Closes the bank window.
|
void |
closeDoor(int x,
int y)
Closes the door at the specified coordinates.
|
void |
closeServerMessage()
Closes the current server message popup window.
|
void |
closeShop()
Closes the currently open shop window.
|
int |
convertX(int x)
Converts player/NPC coordinates to local region coordinates to global coordinates.
|
int |
convertZ(int z)
Converts player/NPC coordinates to local region coordinates to global coordinates.
|
void |
createAccount(java.lang.String email)
Creates the specified account provided in the command line with the specified email.
|
void |
createAccount(java.lang.String email,
java.lang.String username,
java.lang.String password)
Creates the specified account on the server.
|
int |
currentX()
Retrieves the current X coordinates of the player.
|
int |
currentY()
Retrieves the current Y coordinates of the player.
|
void |
declineTrade()
Declines the trade.
|
boolean |
depositAll()
Deposits all yo stuff in the bank
|
boolean |
depositItem(int itemId)
Deposits one of specified item into the bank.
|
boolean |
depositItem(int itemId,
int amount)
Deposits the specified item, of specified amount, into the bank.
|
void |
disablePrayer(int prayerId)
Disables the prayer.
|
void |
displayMessage(java.lang.String rstext)
Displays a message in the client chat window.
|
void |
displayMessage(java.lang.String rstext,
int type)
Displays a message in the client chat window, of the specified MessageType.
|
int |
distance(int x1,
int y1,
int x2,
int y2)
Retrieves the distance between two tiles.
|
int |
distanceTo(int x,
int y) |
void |
drawBoxAlpha(int x,
int y,
int width,
int height,
int color,
int transparency)
Draws a box at the specified coordinates with the specified color and transparency.
|
void |
drawBoxBorder(int x,
int y,
int width,
int height,
int color)
Draws a hollow rectangle at the specified coordinates.
|
void |
drawCenteredString(java.lang.String str,
int x,
int y,
int color,
int fontSize)
Draws text that is centered at the specified coordinates.
|
void |
drawCircle(int x,
int y,
int radius,
int color,
int transparency,
int dummy)
Draws a circle at the specified coordinates with specified radius, color, and transparency.
|
void |
drawItemSprite(int itemId,
int x,
int y,
int scalePercent,
boolean mirrorX)
Draws the sprite of an item at specified coordinates.
|
void |
drawLineHoriz(int x,
int y,
int width,
int color)
Draws a horizontal line at the specified coordinates with the specified width.
|
void |
drawLineVert(int x,
int y,
int height,
int color)
Draws a vertical line at the specified coordinates with the specified height.
|
void |
drawProgressBar(int current,
int maximum,
int bgColor,
int fgColor,
int borderColor,
int x,
int y,
int width,
int height,
boolean showPercentage,
boolean showValues)
Draws a progress bar.
|
void |
drawShadowText(java.lang.String text,
int x,
int y,
int textColor,
int fontSize,
boolean center)
Draws shadow text at the specified coordinates.
|
void |
drawString(java.lang.String str,
int x,
int y,
int color,
int fontSize)
Draws text at the specified coordinates.
|
void |
drawVerticalGradient(int x,
int y,
int width,
int height,
int topColor,
int bottomColor)
Draws a gradient box at the specified coordinates.
|
void |
dropItem(int slotIndex)
Drops one the specified item at the specified item slot.
|
void |
dropItem(int slotIndex,
int amount)
Drops the specified item at the specified item slot, of specified amount.
|
void |
duelPlayer(int playerServerIndex)
Duels the specified player.
|
void |
enablePrayer(int prayerId)
Enables the prayer.
|
void |
equipItem(int slotIndex)
Equips the item in the specified slot.
|
void |
equipItemById(int id)
Equipts an item by ID.
|
void |
followPlayer(int playerServerIndex)
Follows the specified player.
|
long |
getAccountValue()
Retrieves the estimated value of everything in your inventory and bank
|
int[][] |
getAllNpcsById(int[] npcIds,
boolean inCombatAllowed)
Method to make a 2D array with all [x,y,npcId] positions of the supplied npcIds[] array
Other methods only return the closest npc, this will return all of them in a nx3 matrix |
java.util.ArrayList<AuctionItem> |
getAuctions()
Returns an ArrayList of AuctionItems after checking and waiting for the auction timeout to
finish.
|
int |
getBankItemCount(int itemId)
Retrieves the amount of the item in the bank.
|
java.util.List<com.openrsc.client.entityhandling.instances.Item> |
getBankItems()
Retrieves a list of all the items inside the bank.
|
int |
getBankItemsCount()
Retrieves the total count of all items in the bank.
|
int |
getBaseStat(int statId)
Retrieves the base level (excluding boosted/degraded stats) of the specified skill.
|
boolean |
getBatchBarsOn()
Check if batch bars are enabled
|
int |
getBlockingNpcServerIndex(int npcId)
Returns the server index of the NPC which is currently blocking you.
|
orsc.enumerations.ORSCharacterDirection |
getCharacterDirection(orsc.ORSCharacter c)
Retrieves the direction of the ORSCharacter (NPC or player.)
|
int |
getCurrentStat(int statId)
Retrieves the current level (including boosted/degraded stats) of the specified skill.
|
boolean |
getCustomUiMode()
Checks for the Custom UI mode config in mudclient.
|
java.util.Map<java.lang.Integer,java.lang.Integer> |
getDebuggerBank()
Returns a Map of bank items and their amount from the debugger.
|
int |
getDirection(int x,
int y)
Retrieves the direction of the specified coordinate, relative to the player.
|
int |
getDistanceFromLocalPlayer(int coordX,
int coordY)
Retrieves the distance of the coordinates from the player.
|
int |
getEquippedItemId(int slotIndex)
return a int item id that is equipped in the provided slot index
|
int[] |
getEquippedItemIds()
return a list of all item ids that are equipped
|
int |
getFatigue()
Retrieves the current fatigue.
|
int |
getFatigueDuringSleep()
Retrieves the current fatigue status while sleeping.
|
int |
getFightMode()
Retrieves the current fight mode set.
|
int[] |
getFoodIds()
Retrieves the list of all food items in the game.
|
java.util.List<java.lang.String> |
getFriendList()
Retrieves a list of users on the friends list.
|
int |
getGameHeight()
Returns the height, in pixels, of the game window.
|
int |
getGameWidth()
Returns the width, in pixels, of the game window.
|
int |
getGroundItemAmount(int itemId,
int x,
int y)
Retrieves the amount of the item id on the ground at the specified coordinates.
|
int[] |
getGroundItems()
Retrieves all itemIds of items on the ground.
|
int |
getGroundItemsCount()
Retrieves the count of different item ids on the ground.
|
boolean[] |
getGroundItemsNoted()
Retrieves an array of whether or not the ground item is noted.
|
java.util.List<GroundItemDef> |
getGroundItemsStacked()
Retrieve a list of items on the ground near the player.
|
int[] |
getGroundItemsX()
Retrieves an array of X coordinates of ground items.
|
int[] |
getGroundItemsY()
Retrieves an array of Y coordinates of ground items.
|
java.util.List<java.lang.String> |
getIgnoreList()
Retrieves a list of users on the ignore list.
|
int |
getInventoryItemCount()
Retrieves the number of items currently in the inventory.
|
int |
getInventoryItemCount(int itemId)
Retrieves the count of the specified item in the inventory.
|
int[] |
getInventoryItemIds()
Retrieves an array of all the ids of all items in the inventory.
|
java.util.List<com.openrsc.client.entityhandling.instances.Item> |
getInventoryItems()
Retrieves a list of all items in the inventory.
|
int |
getInventoryItemSlotIndex(int itemId)
Retrieves the slot id of the specified item id.
|
int |
getInventorySlotItemId(int slotIndex)
Retrieves the itemId of the item at the specified `slotIndex`.
|
int[] |
getInventoryUniqueItemIds() |
java.lang.String |
getItemCommand(int itemId)
Retrieves the command of the specified item.
|
java.lang.String |
getItemExamineText(int itemId)
Retrieves the examine text of the specified item.
|
int |
getItemId(java.lang.String itemName)
Retrieves the item id of the specified item name.
|
java.lang.String |
getItemName(int itemId)
Retrieves the name of the specified item.
|
int |
getItemSpriteHeight(int itemId)
Returns the height of the sprite for an item id
|
int |
getItemSpriteScaledHeight(int itemId,
int scalePercent)
Returns the height of the sprite for an item id
|
int |
getItemSpriteScaledWidth(int itemId,
int scalePercent)
Returns the width of the sprite for an item id
|
int |
getItemSpriteWidth(int itemId)
Returns the width of the sprite for an item id
|
int |
getLastNpcKilledCount()
Returns the kill count of the last killed npc
|
int |
getLastNpcKilledId()
Returns the id of the last killed npc
|
java.util.List<com.openrsc.client.entityhandling.instances.Item> |
getLocalTradeItems()
Retrieves items which the player is offering in the trade.
|
int |
getLocalTradeItemsCount()
Retrieves how many items the player is offering in the trade.
|
orsc.mudclient |
getMud()
Retrieves the `mudclient`.
|
java.lang.Object |
getMudClientValue(java.lang.String propertyName)
Retrieves the specified field object value of the `mudclient`.
|
int[] |
getMudMouseCoords() |
java.util.ArrayList<AuctionItem> |
getMyAuctions()
Returns an ArrayList of auctions for sale by the current player
|
int[][] |
getNearbyClosedDoors(int radius)
Returns an int[][] of closed door coordinates
|
int[] |
getNearestBank()
Retrieves the coordinates of the nearest bank, based on your current position.
|
int[] |
getNearestItemById(int itemId)
Retrieves the coordinates of the nearest specified item within the given distance, if on the
ground
|
int[] |
getNearestItemById(int itemId,
int maxDistance)
Retrieves the coordinates of the specified item, if on the ground.
|
int[] |
getNearestItemByIds(int[] itemIds)
Retrieves the coordinates of the specified items, if on the ground.
|
orsc.ORSCharacter |
getNearestNpcById(int npcId,
boolean inCombatAllowed)
Retrieves the character object of the nearest npc.
|
orsc.ORSCharacter |
getNearestNpcByIds(int[] npcIds,
boolean inCombatAllowed)
Retrieves the character object of the nearest NPC specified in the list of ids.
|
orsc.ORSCharacter |
getNearestNPCByLambda(java.util.function.Predicate<orsc.ORSCharacter> condition)
Retrieves the character object of the nearest NPC that satisfies the condition
|
int[] |
getNearestObjectById(int objectId)
Retrieves the coordinates of the nearest specified object ID, if nearby.
|
int[] |
getNearestObjectByIds(int[] objectIds)
Finds the nearest object coordinates based on the given object IDs.
|
int[] |
getNearestReachableObjectById(int objectId,
boolean includeTileEdges)
Retrieves the coordinates of the nearest specified object ID, if nearby and reachable.
|
int[] |
getNearestReachableObjectByIds(int[] objectIds,
boolean includeTileEdges)
Retrieves the coordinates of the nearest specified objects by their IDs, if any are nearby and
reachable.
|
int[] |
getNearestWallObjectById(int wallObjectId)
Retrieves the coordinates of the specified wall object id, if nearby.
|
boolean |
getNeedToMove()
Call this method to check the state of needToMove.
|
int |
getNotedInventoryItemCount(int itemId)
Retrieves the count of the specified item that is noted in the inventory.
|
int |
getNotedInventoryItemSlotIndex(int itemId)
Retrieves the slot id of the specified noted item id.
|
orsc.ORSCharacter |
getNpc(int serverIndex)
Creates an NPC character object based on the server index provided.
|
orsc.ORSCharacter |
getNpcAtCoords(int x,
int y)
Returns the NPC object of the NPC at the specified coordinates.
|
java.lang.String |
getNpcCommand1(int npcId)
Retrieves the 1st command of the specified NPC.
|
java.lang.String |
getNpcCommand2(int npcId)
Retrieves the 2nd command of the specified NPC.
|
int[] |
getNpcCoordsByServerIndex(int serverIndex)
Retrieves the coordinates of the specified NPC.
|
int |
getNpcCount()
Retrieves the count of NPCs nearby.
|
java.lang.String |
getNpcExamineText(int npcId)
Retrieves the examine text of the specified NPC.
|
java.lang.String |
getNpcName(int npcId)
Retrieves the name of the specified NPC.
|
java.util.List<orsc.ORSCharacter> |
getNpcs()
Retrieves a list of NPCs nearby.
|
orsc.ORSCharacter[] |
getNpcsAsArray()
Retrieves ORSCharacter[] array of NPCs nearby.
|
int[] |
getNpcsAsIntArray()
Retrieves int[] array of NPCs nearby.
|
int |
getObjectAtCoord(int x,
int y)
Retrieves the id of the object at the specified coordinates.
|
java.lang.String |
getObjectCommand1(int objId)
Retrieves the 1st command of the specified object id.
|
java.lang.String |
getObjectCommand2(int objId)
Retrieves the 2nd command of the specified object id.
|
java.lang.String |
getObjectExamineText(int objId)
Retrieves the examine text of the specified object id.
|
java.lang.String |
getObjectName(int objId)
Retrieves the name of the specified object id.
|
java.util.List<com.openrsc.client.entityhandling.defs.GameObjectDef> |
getObjects()
Retrieves a list of nearby objects.
|
int[][] |
getObjectsById(int objectId)
Retrieves all the coordinates of the nearby object ID
|
int |
getObjectsCount()
Retrieves the count of objects nearby.
|
int[] |
getObjectsIds()
Retrieves the IDs of objects nearby.
|
int[] |
getObjectsX()
Retrieves an array of all of the X coordinates of nearby objects.
|
int[] |
getObjectsZ()
Retrieves an array of all of the Z coordinates of nearby objects.
|
int |
getOptionMenuCount()
Retrieves the amount of options currently presented to the user.
|
java.lang.String[] |
getOptionsMenuText()
Retrieves the array of options inside of an option menu.
|
java.lang.String |
getOptionsMenuText(int i)
Retrieves the text of the specified option index when talking to an NPC or performing an
action.
|
orsc.ORSCharacter |
getPlayer()
Retrieves the ORSCharacter of the local player.
|
orsc.ORSCharacter |
getPlayer(int serverIndex)
Retrieves the ORSCharacter of the specified player server index.
|
int |
getPlayerAtCoord(int x,
int y)
Retrieves the server index of the player at the specified coordinates.
|
java.util.ArrayList<AuctionItem> |
getPlayerAuctions(java.lang.String playerName)
Returns an ArrayList of auctions for sale by a specified player
|
int[] |
getPlayerCoordsByServerIndex(int serverIndex)
Retrieves the coordinates of the specified NPC.
|
int |
getPlayerCount()
Retrieves the number of nearby players.
|
int |
getPlayerExperience(int statId)
Retrieves the amount of XP gained in the skill since last login.
|
int |
getPlayerMode()
Returns the players gamemode.
|
java.lang.String |
getPlayerName()
Retrieves the name of the currently logged in player.
|
java.util.List<orsc.ORSCharacter> |
getPlayers()
Retrieves a list of nearby players.
|
int |
getPlayerServerIndexByName(java.lang.String name)
Retrieves the server index of the specified player name.
|
int |
getPrayerDrain(int prayerId)
Retrieves the drain rate of the specified prayer.
|
int |
getPrayerId(java.lang.String prayerName)
Retrieves the id of the specified prayerName.
|
int |
getPrayerLevel(int prayerId)
Retrieves the level required to use the specified prayer.
|
java.lang.String |
getPrayerName(int prayerId)
Retrieves the name of the specified prayer id.
|
int |
getPrayersCount()
Retrieves the number of prayers in the game.
|
java.lang.String[] |
getQuestNames()
Returns an array of quest names.
|
int |
getQuestPoints()
Returns the amount of quest points the player has.
|
int |
getQuestsCount()
Returns the number of quests (total)
|
int |
getQuestStage(int questId)
Retrieves the quest stage for the specified quest ID.
|
java.util.List<com.openrsc.client.entityhandling.instances.Item> |
getRecipientTradeItems()
Retrieves a list of items which your trade recipient is offering.
|
int |
getRecipientTradeItemsCount()
Retrieves the number of items presented by the trade recipient
|
java.lang.String |
getServerMessage()
Retrieves the current server message popup window text.
|
int |
getShopItemCount(int itemId)
Retrieves how many of the specified item is in stock.
|
int |
getShopItemPrice(int itemId)
Retrieves the price of a single item in the shop.
|
java.util.List<com.openrsc.client.entityhandling.instances.Item> |
getShopItems()
Retrieves a list of all the shop items in the shop.
|
int |
getShopItemsCount()
Retrieves the number of different items which the shop sells.
|
int |
getShopItemStackPrice(int itemId)
Retrieves the price of the stack of items in the shop.
|
boolean |
getShouldSleep() |
boolean |
getShowBotPaint()
Whether or not bot painting is enabled.
|
boolean |
getShowCoords()
Whether or not the the left-hand coordinates indicator is enabled.
|
boolean |
getShowStatus()
Whether or not the left-hand status indicator is enabled.
|
boolean |
getShowXp()
Whether or not the left-hand XP counter is enabled.
|
java.lang.String[] |
getSkillNamesLong()
Retrieves an array of all the skill names.
|
java.util.List<SkillDef> |
getSkills()
Retrieves a list of all the skills.
|
int |
getSpellIdFromName(java.lang.String name)
Retrieves the spellId of the spell name.
|
int |
getSpellLevel(int spellId)
Retrieves the spell level for the given spell ID.
|
java.lang.String[] |
getSpellNames()
Retrieves the names of all spells.
|
java.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>> |
getSpellRunes(int spellId)
Retrieves the set of spell runes required for a given spell ID.
|
int |
getSpellsCount()
Retrieves the number of spells (total)
|
int |
getSpellType(int spellId)
Gets the spell type for the given spell ID.
|
int |
getStatCount()
Retrieves the number of skills in the game.
|
int |
getStatId(java.lang.String statName)
Retrieves the id of the specified skill name.
|
int |
getStatXp(int statId)
Retrieves the current XP in the specified skill.
|
int |
getStringHeight(int fontSize)
Returns the height of a specified font size.
|
int |
getStringWidth(java.lang.String string,
int fontSize)
Returns the width of a string of a specified font size.
|
orsc.ORSCharacter |
getTargetedNpc() |
int |
getTotalKillCount()
Returns the total kill count of all npcs
|
int |
getTotalLevel()
Returns the total level by summing up the player level for each stat.
|
long |
getTotalXp()
Returns the total XP by summing up the player experience for each stat.
|
int[] |
getTradeItemsCounts()
Retrieves an array of item counts inside of the current trade window.
|
java.lang.String |
getTradeRecipientName()
Retrieves the name of the trade recipient, if we are in a trade.
|
int |
getUnnotedInventoryItemCount(int itemId)
Retrieves the count of the specified item that is not noted in the inventory.
|
int |
getUnnotedInventoryItemSlotIndex(int itemId)
Retrieves the slot id of the specified unnoted item id.
|
int |
getWallObjectDirectionAtCoord(int x,
int y)
Returns the direction of the wall object.
|
java.lang.String |
getWallObjectExamineText(int objId)
Retrieves the examine text of the specified wall object id.
|
int |
getWallObjectIdAtCoord(int x,
int y)
Retrieves the id of the wall object at the specified coordinates.
|
int[] |
getWallObjectIds()
Retrieves an array of all wall object IDs nearby.
|
java.lang.String |
getWallObjectName(int objId)
Retrieves the examine text of the specified wall object id.
|
java.util.List<com.openrsc.client.entityhandling.defs.DoorDef> |
getWallObjects()
Retrieves a list of wall objects nearby.
|
int |
getWallObjectsCount()
Retrieves the count of wall objects nearby.
|
int[] |
getWallObjectsDirections() |
int[] |
getWallObjectsX()
Retrieves an array of all of the X coordinates of nearby wall objects.
|
int[] |
getWallObjectsZ()
Retrieves an array of all of the Z coordinates of nearby wall objects.
|
WebWalker |
getWebWalker()
Returns controllers instance of WebWalker.
|
void |
hideContactDetailsMenu()
Hides Details Menu (Run this every message hook callback to prevent corrupt packets showing
this menu)
|
void |
hideRecoveryDetailsMenu()
Hide Recovery Question Menu (Run this every message hook callback to prevent corrupt packets
showing this menu)
|
void |
hideWelcomeScreen() |
boolean |
isAuthentic()
Whether or not the server is configured to be authentic.
|
boolean |
isAutoLogin()
Retrieves whether or not auto-login is set.
|
boolean |
isBatching()
Whether or not the batch progress bar is currently shown on screen.
|
boolean |
isCloseToCoord(int x,
int y)
Whether or not you are within 1 tile of the specified coordinates.
|
boolean |
isCurrentlyWalking()
Whether or not the player is currently walking.
|
boolean |
isDoorOpen(int x,
int y)
Whether or not the door at the specified coordinates is open.
|
boolean |
isDrawEnabled()
Whether or not draw/graphics is currently enabled.
|
boolean |
isEquipped(int slotIndex)
Whether or not the specified item slot is equipped.
|
boolean |
isInAuctionHouse()
Check if the player is in an auction house and not at the disallowed one on Karamja
|
boolean |
isInBank()
Whether or not the bank window is currently open.
|
boolean |
isInCombat()
Whether or not the player is currently in combat.
|
boolean |
isInOptionMenu()
Whether or not an NPC/action option menu is currently presented to the player.
|
boolean |
isInShop()
Whether or not a shop window is currently open.
|
boolean |
isInterlacing()
Retrieves whether or not the interlacer is set.
|
boolean |
isInTrade()
Whether or not we are currently engaged in a trade.
|
boolean |
isInTradeConfirmation()
Whether or not we are currently in the trade confirmation window.
|
boolean |
isItemAtCoord(int x,
int y,
int itemId)
Whether or not the specified item is present at the specified coordinates.
|
boolean |
isItemIdEquipped(int itemId)
Whether or not the specified item ID is equipped.
|
boolean |
isItemInBank(int itemId)
Whether or not the specified item ID is in the bank.
|
boolean |
isItemInInventory(int itemId)
Whether or not the specified item id is in the inventory.
|
boolean |
isItemNotable(int itemId)
Retrieves whether or not the item is notable.
|
boolean |
isItemStackable(int itemId)
Whether or not the specified item is a stackable item.
|
boolean |
isItemTradeable(int itemId)
Retrieves whether or not the item is tradeable.
|
boolean |
isItemWearable(int itemId)
Whether or not the specified item is a wearable item.
|
boolean |
isLoaded()
Whether or not the client is loaded.
|
boolean |
isLoggedIn()
Whether or not the player is currently logged in.
|
boolean |
isNearbyDoorClosed(int radius)
Checks in the radius for a closed door
|
boolean |
isNpcAttackable(int npcId)
Whether or not the specified npcId is attackable.
|
boolean |
isNpcCurrentlyWalking(int serverIndex)
Checks if an NPC is currently walking.
|
boolean |
isNpcInCombat(int serverIndex)
Whether or not the specified npc is in combat.
|
boolean |
isNpcTalking(int serverIndex)
Checks if the NPC is currently talking.
|
boolean |
isPlayerAnIronMode()
Returns whether the player is an ironman mode.
|
boolean |
isPlayerCurrentlyWalking(int serverIndex)
Determines if the player is currently walking.
|
boolean |
isPlayerInCombat(int playerIndex)
Whether or not the specified player index is in combat.
|
boolean |
isPrayerOn(int prayerId)
Whether or not the specified prayer is currently on.
|
boolean |
isQuestComplete(int questId)
Determines if a quest is complete.
|
boolean |
isReachable(int x,
int y,
boolean includeTileEdges)
Whether or not the tile is reachable in the current map segment.
|
boolean |
isRender3DEnabled()
Whether or not render 3D is currently enabled.
|
boolean |
isRunning() |
boolean |
isSleeping()
Whether or not the player is currently sleeping.
|
boolean |
isTileEmpty(int x,
int y)
Whether or not the specified tile has an object at it.
|
boolean |
isTradeRecipientAccepting()
Whether or not the recipient is currently accepting the trade.
|
boolean |
itemCommand(int itemId)
Uses the command option on the specified item id.
|
void |
itemCommandBySlot(int slotIndex)
Uses the command option on the item at the specified slot id.
|
void |
log(java.lang.String text)
Logs text to the console, bot log window, and OpenRSC applet.
|
void |
log(java.lang.String text,
java.lang.String rsTextColor)
Logs text to the console, bot log window, and OpenRSC applet with the specified @col@.
|
void |
login()
Attempts in using the credentials specified in the command line.
|
void |
logout()
Disables autologin and attempts to logout.
|
void |
moveCharacter()
Call this method from within a script to move the character one tile away to a random tile.
|
java.lang.String |
msToShortString(long milliseconds)
Display String "Hr:Min" version of milliseconds long int.
|
java.lang.String |
msToString(long milliseconds)
Display String "Hr:Min:Sec" version of milliseconds long int.
|
void |
npcCommand1(int serverIndex)
Walks to the NPC and select the 1st command option.
|
void |
npcCommand2(int serverIndex)
Walks to the NPC and select the 2nd command option.
|
int |
offsetX(int x)
Converts local region coordinates to global coordinates.
|
int |
offsetZ(int z)
Converts local region coordinates to global coordinates.
|
void |
openAuctionHouse()
Uses npcCommand1 to open the auction house on the nearest clerk
|
void |
openBank()
Will open bank near any bank NPC or bank chest.
|
void |
openDoor(int x,
int y)
Opens the door at the specified coordinates.
|
void |
openNearbyDoor(int radius)
If standing next to a closed door or gate within the specified radius, open it.
|
void |
openNearbyDoors(int radius)
Opens all reachable doors with the same id that match the ids in the radius.
|
void |
openShop(int[] npcIds)
Uses npcCommand1 to open the shop on the nearest npc id given
|
void |
optionAnswer(int answerIndex)
Selects an option menu when talking to an NPC or performing an action.
|
void |
paste()
Pastes the contents of the clipboard to the dialog box.
|
boolean |
pickupItem(int itemId)
Picks up the nearest reachable item with id itemId
|
void |
pickupItem(int x,
int y,
int itemId,
boolean unused,
boolean async)
Picks up the item at the specified coordinates.
|
void |
printAuctionItem(AuctionItem item)
Prints an AuctionItem to console
|
void |
quitIfAuthentic()
If running on an authentic server, this stops the script and outputs a message about
compatibility.
|
void |
removeAllTradeItems()
Removes all trade items from the current trade window.
|
void |
removeFriend(java.lang.String username)
Removes a friend from the user's friend list.
Does not update on client side |
void |
removeIgnore(java.lang.String username)
Removes the specified player from the ignore list.
|
int |
removeOffsetX(int x)
Converts global coordinates to local region coordinates.
|
int |
removeOffsetZ(int z)
Converts global coordinates to local region coordinates.
|
void |
resizeWindow(int width,
int height)
Resizes the client applet window.
|
void |
sendPrivateMessage(java.lang.String username,
java.lang.String message)
Sends a private message to a specified user.
|
void |
sendSleepWord(java.lang.String word)
Internal function used for sleeping.
|
void |
setAutoLogin(boolean value)
Toggles auto-login.
|
void |
setBatchBars(boolean value)
Method can be called to toggle Batch Bars in the openrsc client config for native scripts
utilizing batch bars.
|
void |
setBatchBarsOff()
(use setBatchBars(boolean)) Method can be called to toggle OFF Batch Bars in the openrsc client
config for native scripts utilizing batch bars.
|
void |
setBatchBarsOn()
(setBatchBars(boolean)) Method can be called to toggle ON Batch Bars in the openrsc client
config.
|
void |
setBotPaint(boolean _showBotPaint)
Toggle bot painting (such as progress reports.) This does not disable client graphics.
|
void |
setCustomUiMode(boolean mode)
Toggles Custom UI mode, this gives a redesigned in-game UI.
|
void |
setDrawing(boolean drawing_,
int pauseTicks)
Toggle draw/graphics.
|
void |
setFightMode(int mode) |
void |
setGroundItemsToggle(int level)
Toggle which types of ground items show up on the screen.
|
void |
setInterlacer(boolean interlace)
Toggles the client interlacer, which is for saving CPU cycles.
|
void |
setKeepInventoryOpenMode(boolean setting)
Set Inventory Toggle Mode.
|
void |
setNeedToMove(java.lang.Boolean needToMove_)
Call this method to trigger a move within scripts.
|
void |
setRender3D(boolean render3D)
Toggle render 3D.
|
void |
setScrollLevel(int level)
Set the in-game scroll level of the client.
|
void |
setServerMessage(java.lang.String msg,
boolean largeBox,
boolean show)
Sets the current server message window text.
|
void |
setShouldSleep(boolean shouldSleep) |
void |
setShowCoords(boolean b)
Toggles the left-hand coordinates indicator.
|
void |
setShowStatus(boolean b)
Toggles the left-hand status indicator.
|
void |
setShowXp(boolean b)
Toggles the left-hand XP counter.
|
void |
setStatus(java.lang.String rstext)
Sets the left-hand status indicator text value.
|
boolean |
setTradeItems(int[] itemIds,
int[] amounts,
boolean notableItems)
Will put up the specified items and amounts on the trade window.
|
boolean |
shopBuy(int itemId)
Buys the specified item from the currently open shop.
|
boolean |
shopBuy(int itemId,
int amount)
Buys the specified itemId from the shop.
|
boolean |
shopSell(int itemId)
Sells the specified item to the currently open shop.
|
boolean |
shopSell(int itemId,
int amount)
Sells the specified itemId to the shop.
|
java.lang.String |
shortTimeToCompletion(int processed,
int remaining,
long time)
Shows short Time to Completions in hours only.
|
void |
showContactDetailsMenu()
Show Details Menu
|
void |
showRecoveryDetailsMenu()
Show Recovery Question Menu
|
void |
skipTutorialIsland()
If on tutorial island, skips tutorial island.
|
void |
sleep(int ms) |
void |
sleepHandler(boolean quitOnNoSleepingBag)
If fatigue is greater or equal to `fatigueToSleepAt`, this will commence the sleep process and
IdleRSC will fill in the answer from the OCR.
|
boolean |
sleepUntil(java.util.function.Supplier<java.lang.Boolean> condition)
Suspends the current thread's execution until the provided condition evaluates to true or a 20
second timeout is reached
|
boolean |
sleepUntil(java.util.function.Supplier<java.lang.Boolean> condition,
int timeout)
Suspends the current thread's execution until the provided condition evaluates to true.
|
boolean |
sleepUntilGainedXp()
Suspends the current thread's execution until the player gains exp
|
boolean |
sleepUntilMoving(long timeout)
Sleeps until the player starts walking
|
boolean |
sleepUntilNotMoving(long timeout)
Sleeps until the player is no longer walking
|
void |
stop()
Stops the currently running script.
|
void |
stopBatching()
Sends a packet to the server to stop batching and sleeps until it has stopped.
|
boolean |
takeScreenshot(java.lang.String fileName)
Takes a screenshot of the client applet and saves a bitmap as the specified filename.
|
boolean |
talkToNpc(int serverIndex)
Talks to the specified npc server index.
|
boolean |
talkToNpcId(int npcId,
boolean waitUntilInDialog)
Talks to the specified npc by ID.
|
void |
thieveNpc(int serverIndex)
Thieves the NPC.
|
java.lang.String |
timeToCompletion(int processed,
int remaining,
long time)
Shows Time to Completions in hours, minutes, and seconds.
|
void |
toggleViewId()
Internal function used to grant the ability for normal accounts to access the developer ID
menus.
|
void |
tradePlayer(int playerServerIndex)
Trades the specified player.
|
void |
typeKey(char key)
Types a single key of the specified char.
|
void |
unequipItem(int slotIndex)
Unequips the item in the specified slot.
|
void |
useItemIdOnObject(int x,
int y,
int itemId)
Uses the specified item id on the object at the specified coordinates.
|
void |
useItemOnGroundItem(int x,
int y,
int itemId,
int groundItemId)
Uses the specified item in the inventory on the specified ground item.
|
void |
useItemOnItemBySlot(int slotIndex1,
int slotIndex2)
Uses the item at `slot1` on `slot2`.
|
void |
useItemOnNpc(int serverIndex,
int itemId)
Uses the specified item on the specified npc.
|
void |
useItemOnPlayer(int slotIndex,
int playerServerIndex)
Uses the specified item on the player.
|
void |
useItemOnWall(int x,
int y,
int slotIndex)
Uses the item at the specified slot on the wall object at the specified coordinates.
|
void |
useItemSlotOnObject(int x,
int y,
int slotIndex)
Uses the specified item slot on the object at the specified coordinates.
|
void |
useNotedItemOnGroundItem(int x,
int y,
int itemId,
int groundItemId)
Uses the specified noted item in the inventory on the specified ground item.
|
void |
useNotedItemOnNpc(int serverIndex,
int itemId)
Uses the specified noted item on the specified npc.
|
void |
useSlotIndexOnGroundItem(int x,
int y,
int slotIndex,
int groundItemId)
Uses the specified item in the inventory on the specified ground item.
|
void |
useUnnotedItemIdOnObject(int x,
int y,
int itemId)
Uses the specified item id on the object at the specified coordinates.
|
void |
useUnnotedItemOnGroundItem(int x,
int y,
int itemId,
int groundItemId)
Uses the specified unnoted item in the inventory on the specified ground item.
|
void |
useUnnotedItemOnNpc(int serverIndex,
int itemId)
Uses the specified unnoted item on the specified npc.
|
void |
waitForAuctionTimer()
Checks if the auction timeout from beginAuctionTimeout is over, and sleeps if it is not over.
|
void |
waitForBatching(boolean checkInventory)
while batching, sleep 1 Game tick.
|
void |
walkDamnit(int x,
int y) |
void |
walkPath(int[] path)
Walks the specified coordinates path.
|
void |
walkPathReverse(int[] path)
Walks the specified coordinates path, but in reverse.
|
void |
walkTo(int x,
int y)
Walks to the specified tile, does not return until at tile, in combat, or a long timeout is
reached
|
void |
walkTo(int x,
int y,
int radius,
boolean forced,
boolean leaveCombat)
Walks to the specified tile, does not return until at tile or within tile radius, in combat, or
a long timeout is reached.
|
void |
walkToAsync(int x,
int y,
int radius)
Walks to the specified tile, non-blocking.
|
void |
walktoNPC(int npcServerIndex,
int radius)
Walks to the specified NPC.
|
void |
walktoNPCAsync(int npcServerIndex)
Walks to the specified NPC.
|
boolean |
walkTowards(int x,
int y)
Smartly takes the next step towards any location.
|
boolean |
walkTowardsBank()
Smartly takes the next step towards the nearest bank.
|
boolean |
withdrawItem_apos(int itemId,
int amount)
Withdraws a specified amount of an item from the bank.
|
boolean |
withdrawItem(int itemId)
Withdraws one of the specified item from the bank.
|
boolean |
withdrawItem(int itemId,
int amount)
Withdraws the specified item, of specified amount, from the bank.
|
boolean |
withdrawItemAsNote(int itemId,
int amount)
Withdraws the specified item, as a note, of specified amount, from the bank.
|
public final orsc.mudclient mud
public final int[] bankerIds
public static boolean temporaryToggleSideMenu
public static final int CTRL_DOWN_MASK
public static final int SHIFT_DOWN_MASK
public Controller(Reflector _reflector, orsc.OpenRSC _client, orsc.mudclient _mud)
public boolean isRunning()
public void stop()
public void sleep(int ms)
ms
- Sleeps for the specified amount of milliseconds.public boolean sleepUntil(java.util.function.Supplier<java.lang.Boolean> condition)
condition
- A Supplier condition that must be met to resume execution.public boolean sleepUntil(java.util.function.Supplier<java.lang.Boolean> condition, int timeout)
condition
- A Supplier condition that must be met to resume execution.timeout
- milliseconds before just returning, even if condition is not yet truepublic boolean sleepUntilGainedXp()
public long getTotalXp()
public int getTotalLevel()
public boolean isLoaded()
public boolean isLoggedIn()
public void typeKey(char key)
key
- characterpublic void chatMessage(java.lang.String rstext)
rstext
- Sends the specified message via chat. You may use @col@ colors here.public void paste()
public void setFightMode(int mode)
mode
- Sets the fight mode.public int getFightMode()
public boolean isItemInInventory(int itemId)
itemId
- intpublic int getInventorySlotItemId(int slotIndex)
slotIndex
- intpublic int getInventoryItemCount()
public int getInventoryItemCount(int itemId)
itemId
- intpublic int getUnnotedInventoryItemCount(int itemId)
itemId
- intpublic int getNotedInventoryItemCount(int itemId)
itemId
- intpublic java.util.List<GroundItemDef> getGroundItemsStacked()
public int[] getGroundItems()
public int getGroundItemsCount()
public int[] getGroundItemsX()
public int[] getGroundItemsY()
public boolean[] getGroundItemsNoted()
public int getGroundItemAmount(int itemId, int x, int y)
itemId
- intx
- inty
- intpublic orsc.ORSCharacter getPlayer()
public orsc.ORSCharacter getPlayer(int serverIndex)
serverIndex
- intpublic java.util.List<orsc.ORSCharacter> getPlayers()
public int getPlayerCount()
public boolean isCurrentlyWalking()
public boolean sleepUntilMoving(long timeout)
Good to combine with sleepUntilNotMoving, so you can wait for the player to start responding to your action, then wait for them to finish
timeout
- Max ms to wait until movingpublic boolean sleepUntilNotMoving(long timeout)
Good to combine with sleepUntilMoving, so you can wait for the player to start responding to your action, then wait for them to finish
timeout
- Max ms to wait to stop movingpublic boolean isPlayerCurrentlyWalking(int serverIndex)
serverIndex
- the index of the player on the serverpublic boolean isNpcCurrentlyWalking(int serverIndex)
serverIndex
- the server index of the NPCpublic int getDistanceFromLocalPlayer(int coordX, int coordY)
coordX
- intcoordY
- intpublic int currentX()
public int currentY()
public void walkTo(int x, int y)
x
- inty
- intpublic void walkTo(int x, int y, int radius, boolean forced, boolean leaveCombat)
x
- inty
- intradius
- intleaveCombat
- boolean - true if bot should keep trying walkTo while in combatforced
- boolean - true if attempt to walkTo should be made reguardless of conditionspublic void walkDamnit(int x, int y)
public void walkToAsync(int x, int y, int radius)
x
- inty
- intradius
- intpublic boolean walkTowards(int x, int y)
It is a _bug_ if it cannot walk from any location to any location!
If it's not getting to your desired location, please update the graph.txt using the GUI program here - https://github.com/dginovker/Runescape-Classic-Webwalker
If this function cannot walk to a certain location, please use the above link to add support!
Note - If you have enough coins in your inventory, this function may use them for boat/gate fees! Note - This might not take the most efficient path, but it will be reasonably efficient
x
- Destination xy
- Desination ypublic boolean walkTowardsBank()
If unable to reach any bank, it suggests updating the graph with the GUI tool available at https://github.com/dginovker/Runescape-Classic-Webwalker.
Note: If sufficient coins are available, it may use them for boat/gate fees. While not guaranteed to take the most efficient path, it seeks to be reasonably efficient.
public WebWalker getWebWalker()
public boolean isTileEmpty(int x, int y)
x
- inty
- intpublic int[] getNearestObjectById(int objectId)
objectId
- The ID of the object to find.public int[] getNearestReachableObjectById(int objectId, boolean includeTileEdges)
objectId
- The ID of the object to find.includeTileEdges
- -- whether or not the edges of the tile are permitted. Such as picking
up an item on a table -- you can't walk on top of the table, but you can reach the edges.public int[] getNearestReachableObjectByIds(int[] objectIds, boolean includeTileEdges)
objectIds
- The array of IDs of the objects to find.includeTileEdges
- -- whether or not the edges of the tile are permitted.public int[][] getObjectsById(int objectId)
This method returns an array of coordinate pairs for each instance of the object with the given ID that is nearby.
objectId
- The ID of the objects to retrieve.public int[] getNearestObjectByIds(int[] objectIds)
objectIds
- an array of object IDspublic boolean atObject(SceneryId id)
id
- scenery IDpublic boolean atObject(int id)
id
- intpublic boolean atObject2(int id)
id
- intpublic boolean atObject(int x, int y)
x
- inty
- intpublic boolean atObject2(int x, int y)
x
- inty
- intpublic boolean isCloseToCoord(int x, int y)
x
- inty
- intpublic java.util.List<com.openrsc.client.entityhandling.defs.GameObjectDef> getObjects()
public int getObjectsCount()
public int[] getObjectsIds()
public int[] getObjectsX()
public int[] getObjectsZ()
public java.util.List<orsc.ORSCharacter> getNpcs()
public orsc.ORSCharacter[] getNpcsAsArray()
public int[] getNpcsAsIntArray()
public int getNpcCount()
public java.util.List<com.openrsc.client.entityhandling.defs.DoorDef> getWallObjects()
public int[] getWallObjectIds()
public int getWallObjectsCount()
public int[] getWallObjectsX()
public int[] getWallObjectsZ()
public int[] getWallObjectsDirections()
public int[] getNearestWallObjectById(int wallObjectId)
wallObjectId
- intpublic orsc.ORSCharacter getNearestNpcByIds(int[] npcIds, boolean inCombatAllowed)
npcIds
- intinCombatAllowed
- -- whether or not to return NPCs which are currently engaged in combat.public orsc.ORSCharacter getNearestNPCByLambda(java.util.function.Predicate<orsc.ORSCharacter> condition)
condition
- - Condition the NPC must satisfypublic int[][] getAllNpcsById(int[] npcIds, boolean inCombatAllowed)
npcIds
- int[n] of npcIds you would like to search forinCombatAllowed
- boolean if in-combat npcs should be recordedpublic orsc.ORSCharacter getNearestNpcById(int npcId, boolean inCombatAllowed)
npcId
- intinCombatAllowed
- -- whether or not to return NPCs which are currently engaged in combat.public int[] getNpcCoordsByServerIndex(int serverIndex)
serverIndex
- intpublic orsc.ORSCharacter getNpc(int serverIndex)
serverIndex
- the server index of the NPC (see getpublic void walktoNPCAsync(int npcServerIndex)
npcServerIndex
- intpublic void walktoNPC(int npcServerIndex, int radius)
npcServerIndex
- intradius
- -- must be 0 or greater.public void attackNpc(int npcServerIndex)
npcServerIndex
- intpublic void castSpellOnNpc(int serverIndex, int spellId)
serverIndex
- intspellId
- intpublic void useItemOnNpc(int serverIndex, int itemId)
serverIndex
- intitemId
- intpublic void useUnnotedItemOnNpc(int serverIndex, int itemId)
serverIndex
- intitemId
- intpublic void useNotedItemOnNpc(int serverIndex, int itemId)
serverIndex
- intitemId
- intpublic void useItemSlotOnObject(int x, int y, int slotIndex)
This is primarily used to interact with an object, such as using an axe with a tree. For tasks like opening locked doors try using "c.useItemOnWall(int x, int y, int slotIndex)" instead
x
- inty
- intslotIndex
- intpublic void useItemIdOnObject(int x, int y, int itemId)
This is primarily used to interact with an object, such as using an axe with a tree. For tasks like opening locked doors try using "c.useItemOnWall(int x, int y, int slotIndex)" instead
x
- inty
- intitemId
- intpublic void useUnnotedItemIdOnObject(int x, int y, int itemId)
This is primarily used to interact with an object, such as using an axe with a tree. For tasks like opening locked doors try using "c.useItemOnWall(int x, int y, int slotIndex)" instead
x
- inty
- intitemId
- intpublic void useItemOnWall(int x, int y, int slotIndex)
x
- inty
- intslotIndex
- intpublic void thieveNpc(int serverIndex)
serverIndex
- intpublic void npcCommand1(int serverIndex)
serverIndex
- intpublic void npcCommand2(int serverIndex)
serverIndex
- intpublic boolean isNpcInCombat(int serverIndex)
serverIndex
- intpublic boolean isDoorOpen(int x, int y)
x
- inty
- intpublic int[][] getNearbyClosedDoors(int radius)
radius
- int -- Radius to check for doorspublic boolean isNearbyDoorClosed(int radius)
radius
- int -- Radius to checkpublic int getWallObjectIdAtCoord(int x, int y)
x
- inty
- intpublic int getWallObjectDirectionAtCoord(int x, int y)
x
- inty
- intpublic void openDoor(int x, int y)
x
- inty
- intpublic void closeDoor(int x, int y)
x
- inty
- intpublic boolean isItemAtCoord(int x, int y, int itemId)
x
- inty
- intitemId
- intpublic int[] getNearestItemById(int itemId)
itemId
- intpublic int[] getNearestItemById(int itemId, int maxDistance)
itemId
- intmaxDistance
- Maximum distance to bother checkingpublic int[] getNearestItemByIds(int[] itemIds)
itemIds
- intpublic void pickupItem(int x, int y, int itemId, boolean unused, boolean async)
x
- inty
- intitemId
- intunused
- async
- -- whether or not to block when walking to the item. If set to true, it will keep
attempting to walk to the item, until it is close enough to pick it up.public boolean pickupItem(int itemId)
itemId
- intpublic boolean itemCommand(int itemId)
itemId
- intpublic void itemCommandBySlot(int slotIndex)
slotIndex
- intpublic void useItemOnItemBySlot(int slotIndex1, int slotIndex2)
slotIndex1
- intslotIndex2
- intpublic int getUnnotedInventoryItemSlotIndex(int itemId)
itemId
- -- returns -1 if item not in inventory.public int getNotedInventoryItemSlotIndex(int itemId)
itemId
- -- returns -1 if item not in inventory.public int getInventoryItemSlotIndex(int itemId)
itemId
- -- returns -1 if item not in inventory.public void dropItem(int slotIndex)
slotIndex
- intpublic void dropItem(int slotIndex, int amount)
slotIndex
- intamount
- intpublic int getEquippedItemId(int slotIndex)
public int[] getEquippedItemIds()
public boolean isEquipped(int slotIndex)
slotIndex
- intpublic boolean isItemIdEquipped(int itemId)
itemId
- intpublic void equipItem(int slotIndex)
slotIndex
- intpublic void equipItemById(int id)
id
- the ID of the item to equippublic void unequipItem(int slotIndex)
slotIndex
- intpublic void createAccount(java.lang.String email)
email
- Stringpublic void createAccount(java.lang.String email, java.lang.String username, java.lang.String password)
email
- Stringusername
- Stringpassword
- Stringpublic void login()
public int getFatigue()
public int getFatigueDuringSleep()
public boolean isInCombat()
public boolean isPlayerInCombat(int playerIndex)
playerIndex
- intpublic boolean isInOptionMenu()
public int getOptionMenuCount()
public java.lang.String getOptionsMenuText(int i)
i
- zero-indexed option (i.e first option is 0, second option is 1, etc..)public java.lang.String[] getOptionsMenuText()
public void optionAnswer(int answerIndex)
answerIndex
- -- the index of the answer, starting at 0.public boolean talkToNpc(int serverIndex)
serverIndex
- intpublic boolean talkToNpcId(int npcId, boolean waitUntilInDialog)
npcId
- intwaitUntilInDialog
- boolean -- whether to wait until the dialog is opened before returningpublic boolean isInBank()
public void closeBank()
public java.util.List<com.openrsc.client.entityhandling.instances.Item> getBankItems()
public int getBankItemsCount()
public int getBankItemCount(int itemId)
itemId
- intpublic long getAccountValue()
public boolean isItemInBank(int itemId)
itemId
- intpublic boolean depositAll()
public boolean depositItem(int itemId)
itemId
- intpublic boolean depositItem(int itemId, int amount)
itemId
- intamount
- intpublic boolean withdrawItem(int itemId)
itemId
- intpublic boolean withdrawItem(int itemId, int amount)
itemId
- intamount
- intpublic boolean withdrawItem_apos(int itemId, int amount)
itemId
- the ID of the item to be withdrawnamount
- the amount of the item to be withdrawnpublic boolean withdrawItemAsNote(int itemId, int amount)
itemId
- intamount
- intpublic void displayMessage(java.lang.String rstext, int type)
EXAMPLE(int type, "default @color code@")
GAME(0, "@whi@")
PRIVATE_RECEIVE(1, "@cya@")
PRIVATE_SEND(2, "@cya@")
QUEST(3, "@whi@")
CHAT(4, "@yel@")
FRIEND_STATUS(5, "@cya@")
TRADE(6, "@whi@")
INVENTORY(7, "@whi@")
GLOBAL_CHAT(8, "@yel@")
CLAN_CHAT(9, "@yel@")
rstext
- -- you may use @col@ colors here.public void displayMessage(java.lang.String rstext)
rstext
- -- you may use @col@ colors here.public int distance(int x1, int y1, int x2, int y2)
x1
- inty1
- intx2
- inty2
- intpublic int distanceTo(int x, int y)
public int offsetX(int x)
x
- intpublic int offsetZ(int z)
z
- intpublic int removeOffsetX(int x)
x
- intpublic int removeOffsetZ(int z)
z
- intpublic int convertX(int x)
x
- intpublic int convertZ(int z)
z
- intpublic void resizeWindow(int width, int height)
width
- intheight
- intpublic boolean takeScreenshot(java.lang.String fileName)
fileName
- Stringpublic java.lang.String getItemCommand(int itemId)
itemId
- intpublic java.lang.String getItemExamineText(int itemId)
itemId
- intpublic boolean isItemTradeable(int itemId)
itemId
- intpublic boolean isItemNotable(int itemId)
itemId
- intpublic java.lang.String getItemName(int itemId)
itemId
- intpublic int getItemId(java.lang.String itemName)
itemName
- Stringpublic boolean isItemWearable(int itemId)
itemId
- intpublic boolean isItemStackable(int itemId)
itemId
- intpublic void setServerMessage(java.lang.String msg, boolean largeBox, boolean show)
msg
- StringlargeBox
- booleanshow
- booleanpublic void closeServerMessage()
public java.lang.String getServerMessage()
public int getSpellIdFromName(java.lang.String name)
name
- -- must match spelling of the spell book. case insensitive.public void castSpellOnObject(int spellId, int x, int y)
spellId
- intx
- inty
- intpublic void stopBatching()
public boolean isInAuctionHouse()
public void closeAuctionHouse()
public void openAuctionHouse()
public void auctionBuy(AuctionItem auction, int itemAmount)
auction
- AuctionItem -- Auction to buy fromitemAmount
- int -- Amount of items to buypublic void auctionBuyAll(AuctionItem auction)
auction
- AuctionItem -- The auction to buy from.public void auctionCreate(int itemId, int itemAmount, int pricePerItem)
itemId
- int -- Item iditemAmount
- int -- Amount of itempricePerItem
- int -- Price to sell each item atpublic void auctionCancel(AuctionItem auction)
auction
- AuctionItem -- Auction Idpublic void auctionRefresh()
public java.util.ArrayList<AuctionItem> auctionSearchForItemId(int itemId)
itemId
- int -- Item id to search for.public AuctionItem auctionSearchCheapestOfItemId(int itemId)
itemId
- int -- Item id to search forpublic java.util.ArrayList<AuctionItem> getMyAuctions()
public java.util.ArrayList<AuctionItem> getPlayerAuctions(java.lang.String playerName)
playerName
- String -- Player name to search forpublic java.util.ArrayList<AuctionItem> getAuctions()
public void beginAuctionTimeout()
public void waitForAuctionTimer()
public void printAuctionItem(AuctionItem item)
item
- AuctionItem -- Auction item to printpublic void castSpellOnInventoryItem(int spellId, int slotIndex)
spellId
- intslotIndex
- intpublic void castSpellOnGroundItem(int spellId, int itemId, int x, int y)
spellId
- intitemId
- intx
- inty
- intpublic int getDirection(int x, int y)
x
- inty
- intpublic java.lang.String getNpcCommand1(int npcId)
npcId
- intpublic java.lang.String getNpcCommand2(int npcId)
npcId
- intpublic java.lang.String getNpcExamineText(int npcId)
npcId
- intpublic java.lang.String getNpcName(int npcId)
npcId
- intpublic int calculateNpcLevel(int npcId)
npcId
- int -- npc idpublic boolean isNpcAttackable(int npcId)
npcId
- int -- the id of the npc. This is NOT a server index.public java.lang.String getObjectCommand1(int objId)
objId
- intpublic java.lang.String getObjectCommand2(int objId)
objId
- intpublic java.lang.String getObjectExamineText(int objId)
objId
- intpublic java.lang.String getObjectName(int objId)
objId
- intpublic int getPrayersCount()
public int getPrayerId(java.lang.String prayerName)
prayerName
- -- must match spelling of what is inside prayer book. Case insensitive.public java.lang.String getPrayerName(int prayerId)
prayerId
- -- the id of the prayerpublic int getPrayerLevel(int prayerId)
prayerId
- intpublic int getPrayerDrain(int prayerId)
prayerId
- intpublic boolean isPrayerOn(int prayerId)
prayerId
- intpublic void enablePrayer(int prayerId)
prayerId
- intpublic void disablePrayer(int prayerId)
prayerId
- intpublic boolean isInShop()
public void openShop(int[] npcIds)
public void closeShop()
public int getShopItemsCount()
public java.util.List<com.openrsc.client.entityhandling.instances.Item> getShopItems()
public int getShopItemCount(int itemId)
itemId
- intpublic int getShopItemStackPrice(int itemId)
itemId
- intpublic int getShopItemPrice(int itemId)
itemId
- intpublic boolean shopBuy(int itemId)
itemId
- intpublic boolean shopSell(int itemId)
itemId
- intpublic java.util.List<SkillDef> getSkills()
public int getStatId(java.lang.String statName)
statName
- intpublic int getBaseStat(int statId)
statId
- intpublic int getCurrentStat(int statId)
statId
- intpublic int getStatXp(int statId)
statId
- intpublic int getStatCount()
public int getPlayerExperience(int statId)
statId
- intpublic java.lang.String[] getSkillNamesLong()
public void logout()
public int getObjectAtCoord(int x, int y)
x
- inty
- intpublic void useSlotIndexOnGroundItem(int x, int y, int slotIndex, int groundItemId)
x
- inty
- intslotIndex
- int (use getInventoryItemSlotIndex)groundItemId
- intpublic void useItemOnGroundItem(int x, int y, int itemId, int groundItemId)
x
- inty
- intitemId
- intgroundItemId
- intpublic void useUnnotedItemOnGroundItem(int x, int y, int itemId, int groundItemId)
x
- inty
- intitemId
- intgroundItemId
- intpublic void useNotedItemOnGroundItem(int x, int y, int itemId, int groundItemId)
x
- inty
- intitemId
- intgroundItemId
- intpublic int getPlayerAtCoord(int x, int y)
x
- inty
- intpublic int getPlayerServerIndexByName(java.lang.String name)
name
- -- must not be null.public void duelPlayer(int playerServerIndex)
playerServerIndex
- intpublic void followPlayer(int playerServerIndex)
playerServerIndex
- intpublic void attackPlayer(int playerServerIndex)
playerServerIndex
- intpublic void useItemOnPlayer(int slotIndex, int playerServerIndex)
slotIndex
- intplayerServerIndex
- intpublic void castSpellOnPlayer(int spellId, int playerServerIndex)
spellId
- intplayerServerIndex
- intpublic void castSpellOnSelf(int spellId)
spellId
- intpublic void tradePlayer(int playerServerIndex)
playerServerIndex
- -- player index, retrievable with getPlayerServerIndexByName("name").public java.lang.String getTradeRecipientName()
public boolean isInTrade()
public boolean isInTradeConfirmation()
public boolean isTradeRecipientAccepting()
public void declineTrade()
public void acceptTrade()
public void acceptTradeConfirmation()
public java.util.List<com.openrsc.client.entityhandling.instances.Item> getLocalTradeItems()
public int getLocalTradeItemsCount()
public int[] getTradeItemsCounts()
public java.util.List<com.openrsc.client.entityhandling.instances.Item> getRecipientTradeItems()
public int getRecipientTradeItemsCount()
public boolean setTradeItems(int[] itemIds, int[] amounts, boolean notableItems)
itemIds
- -- int[]amounts
- -- int[]notableItems
- -- boolean if trade will contain noted itemspublic void removeAllTradeItems()
public void setAutoLogin(boolean value)
value
- booleanpublic boolean isAutoLogin()
public void setInterlacer(boolean interlace)
interlace
- booleanpublic void setCustomUiMode(boolean mode)
mode
- booleanpublic boolean getCustomUiMode()
public void setScrollLevel(int level)
level
- int - level to set zoom to. in range ~ 50 - 300public void setGroundItemsToggle(int level)
Toggle which types of ground items show up on the screen. In-game setting * Level 0 - Show ALL items * Level 1 - Hide ALL items * Level 3 - Hide Bones only * Level 3 - No Bones or Ashes
level
- int - level to set (0-3)public void setKeepInventoryOpenMode(boolean setting)
Set Inventory Toggle Mode. If false, the inventory will not close between actions. This was the old android inventory option, but was removed from legitimate game modes. BOTTING ONLY
setting
- boolean - true to keep invent open, false to let it close.public boolean isInterlacing()
public java.util.List<com.openrsc.client.entityhandling.instances.Item> getInventoryItems()
public int[] getInventoryItemIds()
public int[] getInventoryUniqueItemIds()
public int[] getFoodIds()
public java.util.List<java.lang.String> getFriendList()
public java.util.List<java.lang.String> getIgnoreList()
public boolean isBatching()
public void waitForBatching(boolean checkInventory)
checkInventory
- boolean - true to check for full inventory, false to ignore full invent.public boolean isAuthentic()
public java.lang.Object getMudClientValue(java.lang.String propertyName)
propertyName
- -- field namepublic orsc.mudclient getMud()
public void openBank()
public void walkPath(int[] path)
path
- -- length must be divisible by 2.public void walkPathReverse(int[] path)
path
- -- length must be divisible by 2.public void log(java.lang.String text)
text
- Stringpublic void log(java.lang.String text, java.lang.String rsTextColor)
text
- StringrsTextColor
- -- the color of the text, such as "red" or "cya". Do not wrap in @'s.public boolean isSleeping()
public boolean getShouldSleep()
public void setShouldSleep(boolean shouldSleep)
public void sleepHandler(boolean quitOnNoSleepingBag)
quitOnNoSleepingBag
- -- whether or not to logout and stop the script if no sleeping bag
is present. If no sleeping bag is present and this is false, this function has no effect.public int[] getNearestBank()
public boolean shopBuy(int itemId, int amount)
itemId
- intamount
- intpublic boolean shopSell(int itemId, int amount)
itemId
- intamount
- intpublic void drawVerticalGradient(int x, int y, int width, int height, int topColor, int bottomColor)
x
- inty
- intwidth
- intheight
- inttopColor
- -- RGB "HTML" Color Example: 0x36E2D7bottomColor
- -- RGB "HTML" Color Example: 0x36E2D7public void drawBoxAlpha(int x, int y, int width, int height, int color, int transparency)
x
- inty
- intwidth
- intheight
- intcolor
- -- RGB "HTML" Color Example: 0x36E2D7transparency
- -- must be between 0 and 255public void drawBoxBorder(int x, int y, int width, int height, int color)
x
- inty
- intwidth
- intheight
- intcolor
- -- RGB "HTML" Color Example: 0x36E2D7public void drawCircle(int x, int y, int radius, int color, int transparency, int dummy)
x
- inty
- intradius
- intcolor
- -- RGB "HTML" Color Example: 0x36E2D7transparency
- -- must be between 0 and 255dummy
- intpublic void drawLineHoriz(int x, int y, int width, int color)
x
- inty
- intwidth
- intcolor
- -- RGB "HTML" Color Example: 0x36E2D7public void drawLineVert(int x, int y, int height, int color)
x
- inty
- intheight
- intcolor
- -- RGB "HTML" Color Example: 0x36E2D7public void drawProgressBar(int current, int maximum, int bgColor, int fgColor, int borderColor, int x, int y, int width, int height, boolean showPercentage, boolean showValues)
current
- int -- Current value to calculate the progress bar frommaximum
- int -- Maximum value to calculate the progress bar frombgColor
- int -- Color of the progress bar's background. RGB "HTML" Color Example:
0x36E2D7fgColor
- int -- Color of the progress bar's foreground. RGB "HTML" Color Example:
0x36E2D7borderColor
- int -- Color of the progress bar's border. RGB "HTML" Color Example:
0x36E2D7x
- int -- X coordinate of the top left of the progress bary
- int -- Y coordinate of the top left of the progress barwidth
- int -- Width of the progress barheight
- int -- Height of the progress barshowPercentage
- boolean -- Show the percentage on the barshowValues
- boolean -- Show the current and maximum values on the barpublic void drawString(java.lang.String str, int x, int y, int color, int fontSize)
str
- -- you may use @col@ colors here.x
- inty
- intcolor
- -- RGB "HTML" Color Example: 0x36E2D7fontSize
- -- 1 or greaterpublic void drawCenteredString(java.lang.String str, int x, int y, int color, int fontSize)
str
- String -- String to drawx
- int -- X coordinatey
- int -- Y coordinatecolor
- int -- String color. RGB "HTML" Color Example: 0x36E2D7fontSize
- int -- 1 or greaterpublic void drawShadowText(java.lang.String text, int x, int y, int textColor, int fontSize, boolean center)
text
- -- you may use @col@ colors here.x
- inty
- inttextColor
- int -- RGB "HTML" color Example: 0x36E2D7fontSize
- int -- 1 or greatercenter
- booleanpublic void drawItemSprite(int itemId, int x, int y, int scalePercent, boolean mirrorX)
itemId
- int --x
- int -- X coordinatey
- int -- Y coordinatescalePercent
- int -- Percent to scale the sprite. 100 for normal, less for smaller, and
greater for larger.mirrorX
- boolean -- Mirror the sprite across it's X axis.public int getItemSpriteWidth(int itemId)
itemId
- int -- Item idpublic int getItemSpriteScaledWidth(int itemId, int scalePercent)
itemId
- int -- Item idscalePercent
- int -- Percent to scale the sprite up or downpublic int getItemSpriteHeight(int itemId)
itemId
- int -- Item idpublic int getItemSpriteScaledHeight(int itemId, int scalePercent)
itemId
- int -- Item idscalePercent
- int -- Percent to scale the sprite up or downpublic int getStringWidth(java.lang.String string, int fontSize)
string
- String -- Text to get the width fromfontSize
- int -- Font sizepublic int getStringHeight(int fontSize)
fontSize
- int -- Font size to get height frompublic void setStatus(java.lang.String rstext)
rstext
- -- You may use @col@ colors here.public java.lang.String getPlayerName()
public orsc.enumerations.ORSCharacterDirection getCharacterDirection(orsc.ORSCharacter c)
c
- -- characterpublic boolean getShowStatus()
public void setShowStatus(boolean b)
b
- intpublic boolean getShowCoords()
public void setShowCoords(boolean b)
b
- intpublic boolean getShowXp()
public void setShowXp(boolean b)
b
- intpublic boolean getShowBotPaint()
public void setBotPaint(boolean _showBotPaint)
_showBotPaint
- intpublic boolean isReachable(int x, int y, boolean includeTileEdges)
x
- inty
- intincludeTileEdges
- -- whether or not the edges of the tile are permitted. Such as picking
up an item on a table -- you can't walk on top of the table, but you can reach the edges.public void quitIfAuthentic()
public int[] getPlayerCoordsByServerIndex(int serverIndex)
serverIndex
- intpublic boolean isDrawEnabled()
public void setDrawing(boolean drawing_, int pauseTicks)
drawing_
- boolean - what draw state to set itpauseTicks
- int - how long to wait before reverting graphics selection. 0 to not
derefresh.public boolean isRender3DEnabled()
public void setRender3D(boolean render3D)
render3D
- boolean - what render state to set.public void setNeedToMove(java.lang.Boolean needToMove_)
needToMove_
- boolean - true if need to move, false otherwise.public boolean getNeedToMove()
public void moveCharacter()
public void openNearbyDoor(int radius)
radius
- -- within how many tiles to find said doorpublic void openNearbyDoors(int radius)
radius
- -- within how many tiles to find said doorpublic int[] getMudMouseCoords()
public int getGameHeight()
public int getGameWidth()
public boolean isNpcTalking(int serverIndex)
serverIndex
- the index of the NPC on the serverpublic java.lang.String getWallObjectExamineText(int objId)
objId
- intpublic java.lang.String getWallObjectName(int objId)
objId
- intpublic int getSpellsCount()
public java.lang.String[] getSpellNames()
public int getSpellLevel(int spellId)
spellId
- the ID of the spellpublic int getSpellType(int spellId)
spellId
- the ID of the spellpublic java.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>> getSpellRunes(int spellId)
spellId
- the ID of the spellpublic boolean canCastSpell(int spellId)
spellId
- the ID of the spellpublic java.lang.String[] getQuestNames()
public int getQuestsCount()
public int getQuestStage(int questId)
questId
- the ID of the questpublic boolean isQuestComplete(int questId)
questId
- the ID of the questpublic int getQuestPoints()
public void addFriend(java.lang.String username)
username
- the username of the friend to be addedpublic void addIgnore(java.lang.String username)
username
- the username to add to the ignore listpublic void removeFriend(java.lang.String username)
username
- the username of the friend to be removedpublic void removeIgnore(java.lang.String username)
username
- the username of the user to remove from the ignore listpublic void sendPrivateMessage(java.lang.String username, java.lang.String message)
username
- the username of the recipientmessage
- the message to be sentpublic orsc.ORSCharacter getTargetedNpc()
public int getLastNpcKilledId()
public int getLastNpcKilledCount()
public int getTotalKillCount()
public int getBlockingNpcServerIndex(int npcId)
npcId
- -- necessary because you don't want to accidentally attack the wrong npc.public orsc.ORSCharacter getNpcAtCoords(int x, int y)
x
- inty
- intpublic void skipTutorialIsland()
public void sendSleepWord(java.lang.String word)
word
- Stringpublic void atWallObject(int x, int y)
x
- inty
- intpublic void atWallObject2(int x, int y)
x
- inty
- intpublic void toggleViewId()
public void setBatchBarsOn()
public void setBatchBarsOff()
public void setBatchBars(boolean value)
public boolean getBatchBarsOn()
public java.util.Map<java.lang.Integer,java.lang.Integer> getDebuggerBank()
public java.lang.String msToString(long milliseconds)
milliseconds
- long timeInMillisecondspublic java.lang.String msToShortString(long milliseconds)
milliseconds
- long timeInMillisecondspublic java.lang.String timeToCompletion(int processed, int remaining, long time)
credit to chomp for toTimeToCompletion (from AA_Script) (totalBars, barsInBank, startTime)
processed
- int totalItemsUsedremaining
- int totalItemsUnusedtime
- startTime System.currentTimeMillis when bot startedpublic java.lang.String shortTimeToCompletion(int processed, int remaining, long time)
credit to chomp for toTimeToCompletion (from AA_Script) (totalBars, barsInBank, startTime)
processed
- int totalItemsUsedremaining
- int totalItemsUnusedtime
- startTime System.currentTimeMillis when bot startedpublic void showRecoveryDetailsMenu()
public void hideRecoveryDetailsMenu()
public void showContactDetailsMenu()
public void hideContactDetailsMenu()
public void hideWelcomeScreen()
public int getPlayerMode()
public boolean isPlayerAnIronMode()