From 9f28f79cb9b9409ae294734899d214e39129d05d Mon Sep 17 00:00:00 2001 From: Michael <994599+mzarglis@users.noreply.github.com> Date: Fri, 13 Feb 2026 12:36:02 -0500 Subject: [PATCH 1/2] docs(api): add and update utility class documentation --- docs/api/Mouse.md | 96 +++++++++++++++ docs/api/NewMenuEntry.md | 145 ++++++++++++++++++++++ docs/api/Rs2Antiban.md | 76 ++++++++++++ docs/api/Rs2Cannon.md | 19 ++- docs/api/Rs2DepositBox.md | 160 ++++++++++++++++++++++++ docs/api/Rs2Farming.md | 80 ++++++++++++ docs/api/Rs2GameObject.md | 18 +++ docs/api/Rs2Gembag.md | 56 +++++++++ docs/api/Rs2GrandExchange.md | 232 +++++++++++++++++++++++++++++++++++ docs/api/Rs2GroundItem.md | 17 +++ docs/api/Rs2Npc.md | 19 +++ docs/api/Rs2Pvp.md | 36 +++++- docs/api/Rs2RunePouch.md | 108 ++++++++++++++++ docs/api/Rs2Settings.md | 88 ++++++++++++- docs/api/Rs2Shop.md | 76 ++++++++++++ docs/api/Rs2Spells.md | 16 ++- docs/api/Rs2Tab.md | 80 +++++++++++- docs/api/Rs2Walker.md | 44 ++++++- docs/api/Rs2Widget.md | 212 +++++++++++++++++++++++++++++++- docs/api/Rs2WorldPoint.md | 52 ++++++++ 20 files changed, 1623 insertions(+), 7 deletions(-) create mode 100644 docs/api/Mouse.md create mode 100644 docs/api/NewMenuEntry.md create mode 100644 docs/api/Rs2Antiban.md create mode 100644 docs/api/Rs2DepositBox.md create mode 100644 docs/api/Rs2Farming.md create mode 100644 docs/api/Rs2Gembag.md create mode 100644 docs/api/Rs2GrandExchange.md create mode 100644 docs/api/Rs2RunePouch.md create mode 100644 docs/api/Rs2Shop.md create mode 100644 docs/api/Rs2WorldPoint.md diff --git a/docs/api/Mouse.md b/docs/api/Mouse.md new file mode 100644 index 00000000000..4ad1aac9201 --- /dev/null +++ b/docs/api/Mouse.md @@ -0,0 +1,96 @@ +# Mouse Class Documentation + +## [Back](development.md) + +## Overview +The `Mouse` class defines the abstract interface for mouse interactions. It provides methods for clicking, moving, scrolling, and dragging the mouse. + +## Methods + +### `click` +- **Signature**: `public abstract Mouse click()` +- **Description**: Performs a left click at the current mouse position. + +### `click` +- **Signature**: `public abstract Mouse click(int x, int y)` +- **Description**: Clicks at the specified X and Y coordinates. + +### `click` +- **Signature**: `public abstract Mouse click(int x, int y, boolean rightClick)` +- **Description**: Clicks at the specified X and Y coordinates, optionally using a right click. + +### `click` +- **Signature**: `public abstract Mouse click(Point point)` +- **Description**: Clicks at the specified `Point`. + +### `click` +- **Signature**: `public abstract Mouse click(Point point, boolean rightClick)` +- **Description**: Clicks at the specified `Point`, optionally using a right click. + +### `click` +- **Signature**: `public abstract Mouse click(Point point, NewMenuEntry entry)` +- **Description**: Clicks at the specified `Point` associated with a `NewMenuEntry`. + +### `click` +- **Signature**: `public abstract Mouse click(Rectangle rectangle)` +- **Description**: Clicks at a random point within the specified `Rectangle`. + +### `click` +- **Signature**: `public abstract Mouse click(double x, double y)` +- **Description**: Clicks at the specified double coordinates. + +### `drag` +- **Signature**: `public abstract Mouse drag(Point startPoint, Point endPoint)` +- **Description**: Drags the mouse from the start point to the end point. + +### `getCanvas` +- **Signature**: `public Canvas getCanvas()` +- **Description**: Retrieves the game canvas. + +### `getMousePosition` +- **Signature**: `public abstract java.awt.Point getMousePosition()` +- **Description**: Gets the current position of the mouse. + +### `getRainbowColor` +- **Signature**: `public Color getRainbowColor()` +- **Description**: Generates a rainbow color cycling through hues. + +### `move` +- **Signature**: `public abstract Mouse move(int x, int y)` +- **Description**: Moves the mouse to the specified X and Y coordinates. + +### `move` +- **Signature**: `public abstract Mouse move(Point point)` +- **Description**: Moves the mouse to the specified `Point`. + +### `move` +- **Signature**: `public abstract Mouse move(Rectangle rect)` +- **Description**: Moves the mouse to a random point within the specified `Rectangle`. + +### `move` +- **Signature**: `public abstract Mouse move(double x, double y)` +- **Description**: Moves the mouse to the specified double coordinates. + +### `move` +- **Signature**: `public abstract Mouse move(Polygon polygon)` +- **Description**: Moves the mouse to a point within the specified `Polygon`. + +### `randomizeClick` +- **Signature**: `public int randomizeClick()` +- **Description**: Generates a random offset for clicking. + +### `scrollDown` +- **Signature**: `public abstract Mouse scrollDown(Point point)` +- **Description**: Scrolls down at the specified `Point`. + +### `scrollUp` +- **Signature**: `public abstract Mouse scrollUp(Point point)` +- **Description**: Scrolls up at the specified `Point`. + +### `setLastClick` +- **Signature**: `public abstract void setLastClick(Point point)` +- **Description**: Sets the last click position. + +### `setLastMove` +- **Signature**: `public abstract void setLastMove(Point point)` +- **Description**: Sets the last move position. diff --git a/docs/api/NewMenuEntry.md b/docs/api/NewMenuEntry.md new file mode 100644 index 00000000000..1efe2f52c67 --- /dev/null +++ b/docs/api/NewMenuEntry.md @@ -0,0 +1,145 @@ +# NewMenuEntry Class Documentation + +## [Back](development.md) + +## Overview +The `NewMenuEntry` class implements the `MenuEntry` interface and serves as a builder for creating and configuring menu entries. It allows for fluent chaining of methods to set properties like option, target, identifier, type, and more. + +## Constructors + +### `NewMenuEntry()` +- **Description**: Creates a new, empty `NewMenuEntry`. + +### `NewMenuEntry(int param0, int param1, int opcode, int identifier, int itemId, String target)` +- **Description**: Creates a new `NewMenuEntry` with specified parameters. + +### `NewMenuEntry(int param0, int param1, int opcode, int identifier, int itemId, String target, int worldViewId)` +- **Description**: Creates a new `NewMenuEntry` with specified parameters including world view ID. + +### `NewMenuEntry(int param0, int param1, int opcode, int identifier, int itemId, String target, Actor actor)` +- **Description**: Creates a new `NewMenuEntry` for an actor interaction with default option "Use". + +### `NewMenuEntry(int param0, int param1, int opcode, int identifier, int itemId, String target, Actor actor, String option)` +- **Description**: Creates a new `NewMenuEntry` for an actor interaction with a specified option. + +### `NewMenuEntry(int param0, int param1, int opcode, int identifier, int itemId, String option, String target, TileObject gameObject)` +- **Description**: Creates a new `NewMenuEntry` for a game object interaction. + +### `NewMenuEntry(int param0, int param1, int opcode, int identifier, int itemId, String option, String target, TileObject gameObject, int worldViewId)` +- **Description**: Creates a new `NewMenuEntry` for a game object interaction including world view ID. + +### `NewMenuEntry(String option, int param0, int param1, int opcode, int identifier, int itemId, String target)` +- **Description**: Creates a new `NewMenuEntry` with specified option and parameters. + +### `NewMenuEntry(String option, String target, int identifier, MenuAction type, int param0, int param1, boolean forceLeftClick)` +- **Description**: Creates a new `NewMenuEntry` with full specification. + +## Methods + +### `actor` +- **Signature**: `public NewMenuEntry actor(Actor actor)` +- **Description**: Sets the actor for the menu entry. + +### `findIdentifier` +- **Signature**: `public static int findIdentifier(int menuOption)` +- **Description**: Calculates the identifier for a given menu option using the default offset of +6. + +### `findIdentifier` +- **Signature**: `public static int findIdentifier(int menuOption, int offset)` +- **Description**: Calculates the identifier for a given menu option using a custom offset. + +### `forceLeftClick` +- **Signature**: `public NewMenuEntry forceLeftClick(boolean forceLeftClick)` +- **Description**: Sets whether the menu entry should force a left click. + +### `gameObject` +- **Signature**: `public NewMenuEntry gameObject(TileObject gameObject)` +- **Description**: Sets the game object for the menu entry. + +### `getActor` +- **Signature**: `public Actor getActor()` +- **Description**: Retrieves the actor associated with the menu entry. + +### `getGameObject` +- **Signature**: `public TileObject getGameObject()` +- **Description**: Retrieves the game object associated with the menu entry. + +### `getIdentifier` +- **Signature**: `public int getIdentifier()` +- **Description**: Gets the identifier of the menu entry. + +### `getItemId` +- **Signature**: `public int getItemId()` +- **Description**: Gets the item ID associated with the menu entry. + +### `getNpc` +- **Signature**: `public NPC getNpc()` +- **Description**: Retrieves the NPC if the actor is an NPC. + +### `getOption` +- **Signature**: `public String getOption()` +- **Description**: Gets the option text of the menu entry. + +### `getParam0` +- **Signature**: `public int getParam0()` +- **Description**: Gets the first parameter of the menu entry. + +### `getParam1` +- **Signature**: `public int getParam1()` +- **Description**: Gets the second parameter of the menu entry. + +### `getPlayer` +- **Signature**: `public Player getPlayer()` +- **Description**: Retrieves the Player if the actor is a Player. + +### `getTarget` +- **Signature**: `public String getTarget()` +- **Description**: Gets the target text of the menu entry. + +### `getType` +- **Signature**: `public MenuAction getType()` +- **Description**: Gets the menu action type. + +### `getWidget` +- **Signature**: `public Widget getWidget()` +- **Description**: Retrieves the widget associated with the menu entry. + +### `identifier` +- **Signature**: `public NewMenuEntry identifier(int identifier)` +- **Description**: Sets the identifier for the menu entry. + +### `itemId` +- **Signature**: `public NewMenuEntry itemId(int itemId)` +- **Description**: Sets the item ID for the menu entry. + +### `opcode` +- **Signature**: `public NewMenuEntry opcode(int opcode)` +- **Description**: Sets the menu action type using an opcode ID. + +### `option` +- **Signature**: `public NewMenuEntry option(String option)` +- **Description**: Sets the option text for the menu entry. + +### `param0` +- **Signature**: `public NewMenuEntry param0(int param0)` +- **Description**: Sets the first parameter for the menu entry. + +### `param1` +- **Signature**: `public NewMenuEntry param1(int param1)` +- **Description**: Sets the second parameter for the menu entry. + +### `target` +- **Signature**: `public NewMenuEntry target(String target)` +- **Description**: Sets the target text for the menu entry. + +### `type` +- **Signature**: `public NewMenuEntry type(MenuAction type)` +- **Description**: Sets the menu action type. + +### `widget` +- **Signature**: `public NewMenuEntry widget(Widget widget)` +- **Description**: Sets the widget for the menu entry. + +### `worldViewId` +- **Signature**: `public NewMenuEntry worldViewId(int worldViewId)` +- **Description**: Sets the world view ID for the menu entry. diff --git a/docs/api/Rs2Antiban.md b/docs/api/Rs2Antiban.md new file mode 100644 index 00000000000..9f7fd633567 --- /dev/null +++ b/docs/api/Rs2Antiban.md @@ -0,0 +1,76 @@ +# Rs2Antiban Class Documentation + +## [Back](development.md) + +## Overview +The `Rs2Antiban` class provides a comprehensive anti-ban system that simulates human-like behavior during various in-game activities. This system includes features such as mouse fatigue, random intervals, micro-breaks, action cooldowns, and contextually aware mouse movements, all aimed at reducing the risk of detection. + +## Methods + +### `actionCooldown` +- **Signature**: `public static void actionCooldown()` +- **Description**: Handles the execution of an action cooldown based on anti-ban behaviors. Controls the flow for activating the cooldown either with certainty or based on a chance. Includes logic to adjust behaviors such as non-linear intervals, behavioral variability, and random mouse movements. + +### `activateAntiban` +- **Signature**: `public static void activateAntiban()` +- **Description**: Activates the antiban system. + +### `checkForCookingEvent` +- **Signature**: `public static boolean checkForCookingEvent(ChatMessage event)` +- **Description**: Checks if a chat message corresponds to a cooking event. + +### `deactivateAntiban` +- **Signature**: `public static void deactivateAntiban()` +- **Description**: Deactivates the antiban system. + +### `isIdle` +- **Signature**: `public static boolean isIdle()` +- **Description**: Checks if the player is currently idle. + +### `isIdleTooLong` +- **Signature**: `public static boolean isIdleTooLong(int timeoutTicks)` +- **Description**: Checks if the player has been idle for too long based on a specified timeout in ticks. + +### `isMining` +- **Signature**: `public static boolean isMining()` +- **Description**: Checks if the player is currently performing a mining animation. + +### `isWoodcutting` +- **Signature**: `public static boolean isWoodcutting()` +- **Description**: Checks if the player is currently performing a woodcutting animation. + +### `moveMouseOffScreen` +- **Signature**: `public static void moveMouseOffScreen()` +- **Description**: Moves the mouse off the screen with a 100% chance to trigger. Used to simulate a user taking a break. + +### `moveMouseOffScreen` +- **Signature**: `public static void moveMouseOffScreen(double chance)` +- **Description**: Moves the mouse off the screen based on a specified chance percentage. + +### `moveMouseRandomly` +- **Signature**: `public static void moveMouseRandomly()` +- **Description**: Moves the mouse randomly based on the settings. Used to simulate natural mouse behavior. + +### `renderAntibanOverlayComponents` +- **Signature**: `public static void renderAntibanOverlayComponents(PanelComponent panelComponent)` +- **Description**: Renders an overlay component that displays various anti-ban settings and information within a panel. Populates a `PanelComponent` with details regarding the current anti-ban system's state. + +### `resetAntibanSettings` +- **Signature**: `public static void resetAntibanSettings()` +- **Description**: Resets all antiban settings to their default values. + +### `resetAntibanSettings` +- **Signature**: `public static void resetAntibanSettings(boolean forceReset)` +- **Description**: Resets all antiban settings, optionally forcing the reset even if overwrite settings are disabled. + +### `setActivity` +- **Signature**: `public static void setActivity(@NotNull Activity activity)` +- **Description**: Sets the current activity and adjusts antiban settings based on the activity type. + +### `setActivityIntensity` +- **Signature**: `public static void setActivityIntensity(ActivityIntensity activityIntensity)` +- **Description**: Sets the intensity level of the current activity. + +### `takeMicroBreakByChance` +- **Signature**: `public static boolean takeMicroBreakByChance()` +- **Description**: Attempts to trigger a micro-break based on a random chance, as configured in settings. Simulates human-like pauses. diff --git a/docs/api/Rs2Cannon.md b/docs/api/Rs2Cannon.md index 6f11096fba2..db815fe4b42 100644 --- a/docs/api/Rs2Cannon.md +++ b/docs/api/Rs2Cannon.md @@ -1,3 +1,20 @@ +# Rs2Cannon Class Documentation + ## [Back](development.md) -TODO \ No newline at end of file +## Overview +The `Rs2Cannon` class provides utility methods for interacting with the Dwarf Multicannon, including refilling and repairing it. + +## Methods + +### `refill` +- **Signature**: `public static boolean refill()` +- **Description**: Refills the cannon with a random amount of cannonballs (between 10 and 15) if the current ammo count is low. + +### `refill` +- **Signature**: `public static boolean refill(int cannonRefillAmount)` +- **Description**: Refills the cannon if the current ammo count is less than or equal to the specified `cannonRefillAmount`. Checks for cannonballs in inventory and interacts with the cannon. + +### `repair` +- **Signature**: `public static boolean repair()` +- **Description**: Repairs a broken multicannon. Finds the broken cannon object and interacts with it using the "Repair" option. diff --git a/docs/api/Rs2DepositBox.md b/docs/api/Rs2DepositBox.md new file mode 100644 index 00000000000..474adb3a211 --- /dev/null +++ b/docs/api/Rs2DepositBox.md @@ -0,0 +1,160 @@ +# Rs2DepositBox Class Documentation + +## [Back](development.md) + +## Overview +The `Rs2DepositBox` class provides utility methods for interacting with deposit boxes in the game, including opening, closing, and depositing items. + +## Methods + +### `bankItemsAndWalkBackToOriginalPosition` +- **Signature**: `public static boolean bankItemsAndWalkBackToOriginalPosition(List itemNames, WorldPoint initialPlayerLocation)` +- **Description**: Banks items if the inventory is full and returns to the initial player location. + +### `bankItemsAndWalkBackToOriginalPosition` +- **Signature**: `public static boolean bankItemsAndWalkBackToOriginalPosition(List itemNames, WorldPoint initialPlayerLocation, int emptySlotCount)` +- **Description**: Banks items if your inventory does not have enough empty slots. Will walk back to the initial player location. + +### `bankItemsAndWalkBackToOriginalPosition` +- **Signature**: `public static boolean bankItemsAndWalkBackToOriginalPosition(List itemNames, WorldPoint initialPlayerLocation, int emptySlotCount, int distance)` +- **Description**: Banks items if the inventory does not have enough empty slots. Will walk back to the initial player location, allowing a specified distance deviation. + +### `bankItemsAndWalkBackToOriginalPosition` +- **Signature**: `public static boolean bankItemsAndWalkBackToOriginalPosition(List itemNames, boolean exactItemNames, WorldPoint initialPlayerLocation, int emptySlotCount, int distance)` +- **Description**: Banks items at a deposit box if the inventory does not have enough empty slots. Will walk back to the initial player location. Supports exact or partial item name matching. + +### `closeDepositBox` +- **Signature**: `public static boolean closeDepositBox()` +- **Description**: Closes the deposit box interface. + +### `depositAll` +- **Signature**: `public static void depositAll()` +- **Description**: Deposits all items from the inventory into the deposit box. + +### `depositAll` +- **Signature**: `public static boolean depositAll(Integer... ids)` +- **Description**: Deposits only the inventory items that match the specified IDs. + +### `depositAll` +- **Signature**: `public static boolean depositAll(List names)` +- **Description**: Deposits all inventory items that match the specified names (partial match). + +### `depositAll` +- **Signature**: `public static boolean depositAll(List names, boolean exact)` +- **Description**: Deposits all inventory items that match the specified names with option for exact match. + +### `depositAll` +- **Signature**: `public static boolean depositAll(Predicate predicate)` +- **Description**: Deposits all inventory items that match the given predicate. + +### `depositAll` +- **Signature**: `public static boolean depositAll(String... names)` +- **Description**: Deposits all inventory items that match the specified names (partial match). + +### `depositAllExcept` +- **Signature**: `public static boolean depositAllExcept(Integer... ids)` +- **Description**: Deposits all inventory items except those with the specified IDs. + +### `depositAllExcept` +- **Signature**: `public static boolean depositAllExcept(List names)` +- **Description**: Deposits all inventory items excluding items with the specified names (partial match). + +### `depositAllExcept` +- **Signature**: `public static boolean depositAllExcept(List names, boolean exact)` +- **Description**: Deposits all inventory items excluding items with the specified names with option for exact match. + +### `depositAllExcept` +- **Signature**: `public static boolean depositAllExcept(String... names)` +- **Description**: Deposits all inventory items except those with the specified names. + +### `depositEquipment` +- **Signature**: `public static void depositEquipment()` +- **Description**: Deposits all equipment into the deposit box. + +### `depositOne` +- **Signature**: `public static void depositOne(int itemId)` +- **Description**: Deposits a specific item by its ID. + +### `depositOne` +- **Signature**: `public static void depositOne(Rs2ItemModel rs2Item)` +- **Description**: Deposits a specific item by its `Rs2ItemModel` reference. + +### `depositOne` +- **Signature**: `public static void depositOne(String itemName)` +- **Description**: Deposits a specific item by its name (partial match). + +### `depositOne` +- **Signature**: `public static void depositOne(String itemName, boolean exact)` +- **Description**: Deposits a specific item by its name with option for exact match. + +### `depositX` +- **Signature**: `public static void depositX(int itemId, int amount)` +- **Description**: Deposits a specified quantity of an item by its ID. + +### `depositX` +- **Signature**: `public static void depositX(Rs2ItemModel rs2Item, int amount)` +- **Description**: Deposits a specified quantity of an item by its `Rs2ItemModel` reference. + +### `depositX` +- **Signature**: `public static void depositX(String itemName, int amount)` +- **Description**: Deposits a specified quantity of an item by its name (partial match). + +### `depositX` +- **Signature**: `public static void depositX(String itemName, int amount, boolean exact)` +- **Description**: Deposits a specified quantity of an item by its name with option for exact match. + +### `getDepositBoxBounds` +- **Signature**: `public static Rectangle getDepositBoxBounds()` +- **Description**: Retrieves the bounding rectangle of the deposit box widget. + +### `getDepositBoxWidget` +- **Signature**: `public static Widget getDepositBoxWidget()` +- **Description**: Retrieves the widget for the deposit box if it is currently open. + +### `getItems` +- **Signature**: `public static List getItems()` +- **Description**: Retrieves the list of item widgets in the deposit box container. + +### `getItemWidget` +- **Signature**: `public static Widget getItemWidget(int slotId)` +- **Description**: Retrieves the widget of an item based on the specified slot ID in the deposit box. + +### `getNearestDepositBox` +- **Signature**: `public static DepositBoxLocation getNearestDepositBox()` +- **Description**: Returns the nearest accessible deposit box to the local player’s current location. + +### `getNearestDepositBox` +- **Signature**: `public static DepositBoxLocation getNearestDepositBox(WorldPoint worldPoint)` +- **Description**: Returns the nearest accessible deposit box to the specified world point. + +### `getNearestDepositBox` +- **Signature**: `public static DepositBoxLocation getNearestDepositBox(WorldPoint worldPoint, int maxObjectSearchRadius)` +- **Description**: Finds the nearest accessible deposit box from the given world point, scanning for objects or using pathfinding. + +### `isOpen` +- **Signature**: `public static boolean isOpen()` +- **Description**: Checks if the deposit box interface is open. + +### `itemBounds` +- **Signature**: `public static Rectangle itemBounds(Rs2ItemModel rs2Item)` +- **Description**: Gets the bounding rectangle for the slot of the specified item in the deposit box. + +### `openDepositBox` +- **Signature**: `public static boolean openDepositBox()` +- **Description**: Opens the deposit box interface by interacting with a nearby deposit box. + +### `walkToAndUseDepositBox` +- **Signature**: `public static boolean walkToAndUseDepositBox()` +- **Description**: Walks to the nearest deposit box location and opens it. + +### `walkToAndUseDepositBox` +- **Signature**: `public static boolean walkToAndUseDepositBox(DepositBoxLocation depositBoxLocation)` +- **Description**: Walks to the specified deposit box location and opens it. + +### `walkToDepositBox` +- **Signature**: `public static boolean walkToDepositBox()` +- **Description**: Walks to the nearest deposit box location. + +### `walkToDepositBox` +- **Signature**: `public static boolean walkToDepositBox(DepositBoxLocation depositBoxLocation)` +- **Description**: Walks to the specified deposit box location. diff --git a/docs/api/Rs2Farming.md b/docs/api/Rs2Farming.md new file mode 100644 index 00000000000..7fe00a5efb7 --- /dev/null +++ b/docs/api/Rs2Farming.md @@ -0,0 +1,80 @@ +# Rs2Farming Class Documentation + +## [Back](development.md) + +## Overview +The `Rs2Farming` class provides utility methods for farming operations, including retrieving farming patches, checking patch states, and managing farming-related tasks. + +## Methods + +### `getClosestPatch` +- **Signature**: `public static Optional getClosestPatch(List patches)` +- **Description**: Finds the closest patch to the player's current location from a list of patches. + +### `getEmptyPatches` +- **Signature**: `public static List getEmptyPatches(List patches)` +- **Description**: Gets empty patches ready for planting from a list of patches. + +### `getFruitTreePatches` +- **Signature**: `public static List getFruitTreePatches()` +- **Description**: Get all fruit tree farming patches. + +### `getHarvestablePatches` +- **Signature**: `public static List getHarvestablePatches(List patches)` +- **Description**: Gets patches that are healthy and ready for harvest from a list of patches. + +### `getHerbPatches` +- **Signature**: `public static List getHerbPatches()` +- **Description**: Get all herb farming patches. + +### `getPatchByRegionAndVarbit` +- **Signature**: `public static Optional getPatchByRegionAndVarbit(String regionName, int varbit)` +- **Description**: Get a patch by its region name and varbit for unique identification. + +### `getPatchesByTab` +- **Signature**: `public static List getPatchesByTab(Tab tab)` +- **Description**: Get all farming patches of a specific type (tab). + +### `getPatchesNeedingAttention` +- **Signature**: `public static List getPatchesNeedingAttention(List patches)` +- **Description**: Gets patches that need attention (diseased or dead) from a list of patches. + +### `getPatchesWithinDistance` +- **Signature**: `public static List getPatchesWithinDistance(List patches, WorldPoint location, int maxDistance)` +- **Description**: Get patches within a certain distance of a location. + +### `getReadyPatches` +- **Signature**: `public static List getReadyPatches(List patches)` +- **Description**: Get patches that are ready for action (not growing). This includes harvestable, diseased, dead, or empty patches. + +### `getSpiritTreePatches` +- **Signature**: `public static List getSpiritTreePatches()` +- **Description**: Get all spirit tree farming patches. + +### `getTreePatches` +- **Signature**: `public static List getTreePatches()` +- **Description**: Get all tree farming patches (regular trees). + +### `hasQuestRequirement` +- **Signature**: `public static boolean hasQuestRequirement(QuestState questState)` +- **Description**: Check if player has completed required quests for farming. + +### `hasRequiredFarmingLevel` +- **Signature**: `public static boolean hasRequiredFarmingLevel(int requiredLevel)` +- **Description**: Check if player has the required farming level for a specific patch type. + +### `isFarmingSystemReady` +- **Signature**: `public static boolean isFarmingSystemReady()` +- **Description**: Check if farming tracking is properly initialized. + +### `isPatchAccessible` +- **Signature**: `public static boolean isPatchAccessible(FarmingPatch patch, int maxDistance)` +- **Description**: Check if a patch is accessible (player is within range). + +### `logPatchStates` +- **Signature**: `public static void logPatchStates(List patches)` +- **Description**: Log farming patch states for debugging. + +### `predictPatchState` +- **Signature**: `public static CropState predictPatchState(FarmingPatch patch)` +- **Description**: Predict the state of a farming patch based on time tracking data. diff --git a/docs/api/Rs2GameObject.md b/docs/api/Rs2GameObject.md index 9dd9b1a74a9..e130e767bbd 100644 --- a/docs/api/Rs2GameObject.md +++ b/docs/api/Rs2GameObject.md @@ -1,5 +1,23 @@ # Rs2GameObject Class Documentation ## [Back](development.md) + +> **Deprecated:** `Rs2GameObject` is deprecated and marked for removal. Use the **Queryable API** via `Microbot.getRs2TileObjectCache().query()` instead. It provides a fluent, type-safe interface with better performance through tick-based caching. +> +> See the [Queryable API Documentation & Migration Guide](../../runelite-client/src/main/java/net/runelite/client/plugins/microbot/api/QUERYABLE_API.md#migration-guide) for migration steps and side-by-side examples. +> +> **Quick comparison:** +> ```java +> // Legacy (deprecated) +> TileObject tree = Rs2GameObject.findObject("Tree"); +> Rs2GameObject.interact(tree, "Chop down"); +> +> // Queryable API (recommended) +> Rs2TileObjectModel tree = Microbot.getRs2TileObjectCache().query() +> .withName("Tree") +> .nearest(); +> tree.click("Chop down"); +> ``` + ## Overview The `Rs2GameObject` class provides methods to interact with game objects within the game environment. It offers functionalities to locate, interact, and manipulate game objects based on various criteria like ID, name, or location. diff --git a/docs/api/Rs2Gembag.md b/docs/api/Rs2Gembag.md new file mode 100644 index 00000000000..c6e85c1d8bc --- /dev/null +++ b/docs/api/Rs2Gembag.md @@ -0,0 +1,56 @@ +# Rs2Gembag Class Documentation + +## [Back](development.md) + +## Overview +The `Rs2Gembag` class manages the state and interactions with the Gem Bag. It tracks the contents of the gem bag based on chat messages and inventory interactions. + +## Methods + +### `checkGemBag` +- **Signature**: `public static void checkGemBag()` +- **Description**: Initiates checking the gem bag contents. Interacts with the gem bag to "Check" it, which triggers a chat message with the contents. + +### `getGemBagContents` +- **Signature**: `public static List getGemBagContents()` +- **Description**: Retrieves the current list of items believed to be in the gem bag. + +### `getGemBagItemIds` +- **Signature**: `public static List getGemBagItemIds()` +- **Description**: Returns the list of item IDs that correspond to the gem bag (open and closed). + +### `getGemCount` +- **Signature**: `public static int getGemCount(String gem)` +- **Description**: Gets the count of a specific gem in the gem bag by its name. Returns 0 if the gem bag is missing or contents are unknown. + +### `getTotalGemCount` +- **Signature**: `public static int getTotalGemCount()` +- **Description**: Gets the total count of all gems currently stored in the gem bag. + +### `hasGemBag` +- **Signature**: `public static boolean hasGemBag()` +- **Description**: Checks if the player has a gem bag in their inventory. + +### `isAnyGemSlotFull` +- **Signature**: `public static boolean isAnyGemSlotFull()` +- **Description**: Checks if any gem slot in the gem bag is full (quantity 60). + +### `isGemBagOpen` +- **Signature**: `public static boolean isGemBagOpen()` +- **Description**: Checks if the gem bag is currently open (based on item ID). + +### `isUnknown` +- **Signature**: `public static boolean isUnknown()` +- **Description**: Checks if the contents of the gem bag are currently unknown (e.g., haven't been checked yet). + +### `onChatMessage` +- **Signature**: `public static void onChatMessage(ChatMessage event)` +- **Description**: Handles chat messages to update gem bag contents. Listens for messages indicating gems found or the "Check" message from the gem bag. + +### `onMenuOptionClicked` +- **Signature**: `public static void onMenuOptionClicked(MenuOptionClicked event)` +- **Description**: Handles menu option clicks related to the gem bag, such as "Empty" or "Fill", to update the internal state of the bag contents. + +### `resetGemBagContents` +- **Signature**: `public static void resetGemBagContents()` +- **Description**: Clears the internal record of the gem bag contents. diff --git a/docs/api/Rs2GrandExchange.md b/docs/api/Rs2GrandExchange.md new file mode 100644 index 00000000000..7757c23a93c --- /dev/null +++ b/docs/api/Rs2GrandExchange.md @@ -0,0 +1,232 @@ +# Rs2GrandExchange Class Documentation + +## [Back](development.md) + +## Overview +The `Rs2GrandExchange` class provides methods for interacting with the Grand Exchange in the game. It allows for buying, selling, collecting offers, and managing Grand Exchange slots. + +## Methods + +### `abortAllOffers` +- **Signature**: `public static boolean abortAllOffers(boolean collectToBank)` +- **Description**: Aborts all active Grand Exchange offers. Iterates through all Grand Exchange slots and attempts to abort any active offers. After aborting, collects all items from the Grand Exchange interface. + +### `abortOffer` +- **Signature**: `public static boolean abortOffer(String name, boolean collectToBank)` +- **Description**: Aborts an active Grand Exchange offer for the specified item name. Attempts to locate a non-available Grand Exchange slot containing an offer matching the given item name (case-insensitive). If found, sends an "Abort offer" action. After aborting, collects all items from the Grand Exchange. + +### `backToOverview` +- **Signature**: `public static void backToOverview()` +- **Description**: Clicks the back button to go from the buy/sell offer screen to the all slots overview. + +### `buyItem` +- **Signature**: `public static boolean buyItem(String itemName, int price, int quantity)` +- **Description**: Creates and processes a request to buy an item on the Grand Exchange. Constructs a `BUY` type request using the specified item name, price, and quantity. + +### `cancelSpecificOffers` +- **Signature**: `public static List> cancelSpecificOffers(List slotsToCancel, boolean collectToBank)` +- **Description**: Cancels only specific Grand Exchange slots instead of all offers. Returns details of cancelled offers for potential restoration. + +### `closeExchange` +- **Signature**: `public static void closeExchange()` +- **Description**: Closes the Grand Exchange interface. + +### `collectAll` +- **Signature**: `public static boolean collectAll(boolean collectToBank)` +- **Description**: Collects all completed Grand Exchange offers either into the bank or inventory. Checks if all slots are empty first. If the inventory is full, attempts to open the bank and deposit all items before continuing. + +### `collectAllToBank` +- **Signature**: `public static boolean collectAllToBank()` +- **Description**: Collects all completed Grand Exchange offers directly into the bank. Convenience method calling `collectAll(true)`. + +### `collectAllToInventory` +- **Signature**: `public static boolean collectAllToInventory()` +- **Description**: Collects all completed Grand Exchange offers into the inventory. Convenience method calling `collectAll(false)`. + +### `collectOffer` +- **Signature**: `public static boolean collectOffer(GrandExchangeSlots slot, boolean toBank)` +- **Description**: Collects items from a specific Grand Exchange slot. + +### `collectOfferAndGetQuantity` +- **Signature**: `public static int collectOfferAndGetQuantity(GrandExchangeSlots slot, boolean toBank, int itemId)` +- **Description**: Collects a specific offer and returns the exact number of items obtained. Tracks the actual quantity collected. + +### `findSlotForItem` +- **Signature**: `public static GrandExchangeSlots findSlotForItem(int itemId, boolean isSelling)` +- **Description**: Finds the Grand Exchange slot currently holding an offer for the specified item ID. + +### `findSlotForItem` +- **Signature**: `public static GrandExchangeSlots findSlotForItem(String itemName, boolean isSelling)` +- **Description**: Finds the Grand Exchange slot currently holding an offer for the specified item name. + +### `getActiveOfferSlots` +- **Signature**: `public static GrandExchangeSlots[] getActiveOfferSlots()` +- **Description**: Returns all slots with active offers. + +### `getAdaptiveBuyPrice` +- **Signature**: `public static int getAdaptiveBuyPrice(int itemId, double basePercentage, int retryAttempt)` +- **Description**: Calculates an intelligent buy price based on market conditions and retry attempts. + +### `getAdaptiveSellPrice` +- **Signature**: `public static int getAdaptiveSellPrice(int itemId, double basePercentage, int retryAttempt)` +- **Description**: Calculates an intelligent sell price based on market conditions and retry attempts. + +### `getAvailableSlot` +- **Signature**: `public static GrandExchangeSlots getAvailableSlot()` +- **Description**: Retrieves the first available Grand Exchange slot. + +### `getAvailableSlots` +- **Signature**: `public static GrandExchangeSlots[] getAvailableSlots()` +- **Description**: Retrieves all currently available Grand Exchange slots. + +### `getAvailableSlotsCount` +- **Signature**: `public static int getAvailableSlotsCount()` +- **Description**: Returns the count of currently available Grand Exchange slots. + +### `getAveragePrice` +- **Signature**: `public static int getAveragePrice(int itemId)` +- **Description**: Gets average price over the last hour. + +### `getAveragePrice` +- **Signature**: `public static int getAveragePrice(int itemId, TimeSeriesInterval interval)` +- **Description**: Gets average price over a specific time period using time-series data. + +### `getBuyingVolume` +- **Signature**: `public static int getBuyingVolume(int itemId)` +- **Description**: Gets the buying volume for an item from GE Tracker. + +### `getCompletedOffers` +- **Signature**: `public static Map getCompletedOffers()` +- **Description**: Finds and returns all slots that have completed offers ready for collection. + +### `getItemMappingData` +- **Signature**: `public static ItemMappingData getItemMappingData(int itemId)` +- **Description**: Gets item mapping data including trade limits from OSRS Wiki API. + +### `getItemsBoughtFromOffer` +- **Signature**: `public static int getItemsBoughtFromOffer(GrandExchangeSlots slot)` +- **Description**: Gets the exact number of items bought from a specific Grand Exchange slot offer. + +### `getItemsSoldFromOffer` +- **Signature**: `public static int getItemsSoldFromOffer(GrandExchangeSlots slot)` +- **Description**: Gets the exact number of items sold from a specific Grand Exchange slot offer. + +### `getOfferDetails` +- **Signature**: `public static GrandExchangeOfferDetails getOfferDetails(GrandExchangeSlots slot)` +- **Description**: Gets detailed information about a Grand Exchange offer in the specified slot. + +### `getOfferDetailsForCancellation` +- **Signature**: `public static Map getOfferDetailsForCancellation(GrandExchangeSlots slot)` +- **Description**: Enhanced slot management: Gets detailed information about an offer before cancelling it. + +### `getPrice` +- **Signature**: `public static int getPrice(int itemId)` +- **Description**: Gets the overall price for an item from GE Tracker. + +### `getRealTimePrices` +- **Signature**: `public static WikiPrice getRealTimePrices(int itemId)` +- **Description**: Gets real-time price data with caching from OSRS Wiki API (primary) or GE Tracker (fallback). + +### `getSearchResultWidget` +- **Signature**: `public static Pair getSearchResultWidget(String search, boolean exact)` +- **Description**: Searches the Grand Exchange item search results widget for an entry matching the specified search text. + +### `getSellingVolume` +- **Signature**: `public static int getSellingVolume(int itemId)` +- **Description**: Gets the selling volume for an item from GE Tracker. + +### `getSellPrice` +- **Signature**: `public static int getSellPrice(int itemId)` +- **Description**: Gets the selling price for an item from GE Tracker. + +### `getSlotFromIndex` +- **Signature**: `public static GrandExchangeSlots getSlotFromIndex(int index)` +- **Description**: Helper method to get a GrandExchangeSlots enum value from its index. + +### `getSlotIndex` +- **Signature**: `public static int getSlotIndex(GrandExchangeSlots slot)` +- **Description**: Gets the index (0-7) of the slot in the GE interface. + +### `getTimeSeriesData` +- **Signature**: `public static TimeSeriesAnalysis getTimeSeriesData(int itemId, TimeSeriesInterval interval)` +- **Description**: Gets time-series data starting from current time going back. + +### `getTimeSeriesData` +- **Signature**: `public static TimeSeriesAnalysis getTimeSeriesData(int itemId, TimeSeriesInterval interval, Long fromTimestamp)` +- **Description**: Gets time-series price data from OSRS Wiki API. + +### `hasBoughtOffer` +- **Signature**: `public static boolean hasBoughtOffer()` +- **Description**: Checks if any offer has a state of `BOUGHT`. + +### `hasBoughtOffer` +- **Signature**: `public static boolean hasBoughtOffer(GrandExchangeSlots slot)` +- **Description**: Checks if a specific Grand Exchange slot has a completed buy offer ready to collect. + +### `hasFinishedBuyingOffers` +- **Signature**: `public static boolean hasFinishedBuyingOffers()` +- **Description**: Checks if there are bought offers and no buying offers active. + +### `hasFinishedSellingOffers` +- **Signature**: `public static boolean hasFinishedSellingOffers()` +- **Description**: Checks if there are sold offers and no selling offers active. + +### `hasSoldOffer` +- **Signature**: `public static boolean hasSoldOffer()` +- **Description**: Checks if any offer has a state of `SOLD`. + +### `hasSoldOffer` +- **Signature**: `public static boolean hasSoldOffer(GrandExchangeSlots slot)` +- **Description**: Checks if a specific Grand Exchange slot has a completed sell offer ready to collect. + +### `isAllSlotsEmpty` +- **Signature**: `public static boolean isAllSlotsEmpty()` +- **Description**: Checks if all Grand Exchange slots are currently empty (available). + +### `isCancelledOfferWithItems` +- **Signature**: `public static boolean isCancelledOfferWithItems(GrandExchangeSlots slot)` +- **Description**: Checks if an offer was cancelled and still has items that can be collected. + +### `isOfferScreenOpen` +- **Signature**: `public static boolean isOfferScreenOpen()` +- **Description**: Checks if the offer screen (buy/sell offer screen) is open. + +### `isOpen` +- **Signature**: `public static boolean isOpen()` +- **Description**: Checks if the Grand Exchange screen is open. + +### `isSlotAvailable` +- **Signature**: `public static boolean isSlotAvailable(GrandExchangeSlots slot)` +- **Description**: Checks if a specified Grand Exchange slot is available for a new offer. + +### `openExchange` +- **Signature**: `public static boolean openExchange()` +- **Description**: Opens the Grand Exchange. Interacts with the "Grand Exchange Clerk" NPC. Handles bank pin if necessary. + +### `processOffer` +- **Signature**: `public static boolean processOffer(GrandExchangeRequest request)` +- **Description**: Processes a Grand Exchange offer request based on the action specified in the `GrandExchangeRequest`. Supports `COLLECT`, `BUY`, and `SELL` actions. + +### `restoreOffer` +- **Signature**: `public static boolean restoreOffer(Map offerDetails, GrandExchangeSlots targetSlot)` +- **Description**: Attempts to restore a cancelled offer using the provided details. + +### `sellInventory` +- **Signature**: `public static boolean sellInventory()` +- **Description**: Attempts to sell all tradeable items currently in the player's inventory on the Grand Exchange. + +### `sellItem` +- **Signature**: `public static boolean sellItem(String itemName, int quantity, int price)` +- **Description**: Creates and processes a request to sell an item on the Grand Exchange. Constructs a `SELL` type request. + +### `sellLoot` +- **Signature**: `public static boolean sellLoot(String npcName, List itemsToNotSell)` +- **Description**: Sells all the tradeable loot items from a specific NPC name, excluding specified items. + +### `setChatboxValue` +- **Signature**: `public static void setChatboxValue(int value)` +- **Description**: Sets a value in the chatbox input. + +### `walkToGrandExchange` +- **Signature**: `public static boolean walkToGrandExchange()` +- **Description**: Walks to the Grand Exchange location. diff --git a/docs/api/Rs2GroundItem.md b/docs/api/Rs2GroundItem.md index ae4f22fb9ff..9e71c573bd9 100644 --- a/docs/api/Rs2GroundItem.md +++ b/docs/api/Rs2GroundItem.md @@ -1,5 +1,22 @@ # Rs2GroundItem Class Documentation ## [Back](development.md) + +> **Deprecated:** `Rs2GroundItem` is deprecated and marked for removal. Use the **Queryable API** via `Microbot.getRs2TileItemCache().query()` instead. It provides a fluent, type-safe interface with better performance through tick-based caching. +> +> See the [Queryable API Documentation & Migration Guide](../../runelite-client/src/main/java/net/runelite/client/plugins/microbot/api/QUERYABLE_API.md#migration-guide) for migration steps and side-by-side examples. +> +> **Quick comparison:** +> ```java +> // Legacy (deprecated) +> Rs2GroundItem.loot("Dragon bones", 1, 10); +> +> // Queryable API (recommended) +> Rs2TileItemModel bones = Microbot.getRs2TileItemCache().query() +> .withName("Dragon bones") +> .nearest(); +> bones.click("Take"); +> ``` + ## Overview The `Rs2GroundItem` class provides methods to interact with ground items within the game, facilitating operations like picking up, checking existence, and interacting with items based on various criteria such as item ID, name, or location. diff --git a/docs/api/Rs2Npc.md b/docs/api/Rs2Npc.md index 92435925fc9..f06ff50ea35 100644 --- a/docs/api/Rs2Npc.md +++ b/docs/api/Rs2Npc.md @@ -1,5 +1,24 @@ # Rs2Npc Class Documentation ## [Back](development.md) + +> **Deprecated:** `Rs2Npc` is deprecated and marked for removal. Use the **Queryable API** via `Microbot.getRs2NpcCache().query()` instead. It provides a fluent, type-safe interface with better performance through tick-based caching. +> +> See the [Queryable API Documentation & Migration Guide](../../runelite-client/src/main/java/net/runelite/client/plugins/microbot/api/QUERYABLE_API.md#migration-guide) for migration steps and side-by-side examples. +> +> **Quick comparison:** +> ```java +> // Legacy (deprecated) +> NPC banker = Rs2Npc.getNpc("Banker"); +> Rs2Npc.interact(banker, "Bank"); +> +> // Queryable API (recommended) +> Rs2NpcModel banker = Microbot.getRs2NpcCache().query() +> .withName("Banker") +> .where(npc -> !npc.isInteracting()) +> .nearest(); +> banker.click("Bank"); +> ``` + ## Overview The `Rs2Npc` class provides a comprehensive suite of methods for interacting with NPCs within the game. These methods include retrieving NPCs by various attributes, validating NPC interactability, performing actions like attacking or pickpocketing, and handling NPC visibility and targeting through the game's camera and walking systems. diff --git a/docs/api/Rs2Pvp.md b/docs/api/Rs2Pvp.md index 8853d94e879..df0f1f0c82c 100644 --- a/docs/api/Rs2Pvp.md +++ b/docs/api/Rs2Pvp.md @@ -1,2 +1,36 @@ +# Rs2Pvp Class Documentation + ## [Back](development.md) -TODO \ No newline at end of file + +## Overview +The `Rs2Pvp` class provides utility methods for player-vs-player (PVP) related checks, such as wilderness levels, attackability of other players, and risk calculation. + +## Methods + +### `calculateRisk` +- **Signature**: `public static int calculateRisk(Client client, ItemManager itemManager)` +- **Description**: Calculates the total wealth risk of the player based on inventory and equipment. Considers tradeable value and high alchemy value for untradeables. + +### `getWildernessLevelFrom` +- **Signature**: `public static int getWildernessLevelFrom(WorldPoint point)` +- **Description**: Calculates the wilderness level at a specific `WorldPoint`. Handles various wilderness areas including main wilderness, God Wars Dungeon wilderness, underground areas, and specific PVP hotspots like Ferox Enclave or BH craters. + +### `isAttackable` +- **Signature**: `public static boolean isAttackable()` +- **Description**: Checks if there are any players nearby who are attackable by the local player, considering wilderness levels and combat level differences. + +### `isAttackable` +- **Signature**: `public static boolean isAttackable(Player player)` +- **Description**: Checks if a specific `Player` is attackable by the local player. + +### `isAttackable` +- **Signature**: `public static boolean isAttackable(Rs2PlayerModel rs2Player)` +- **Description**: Checks if a specific `Rs2PlayerModel` is attackable by the local player. + +### `isAttackable` +- **Signature**: `public static boolean isAttackable(Rs2PlayerModel rs2Player, boolean isDeadManworld, boolean isPvpWorld, int wildernessLevel)` +- **Description**: Checks if a specific `Rs2PlayerModel` is attackable given specific world conditions and wilderness level. + +### `isInWilderness` +- **Signature**: `public static boolean isInWilderness()` +- **Description**: Checks if the local player is currently in the wilderness based on varbit values. diff --git a/docs/api/Rs2RunePouch.md b/docs/api/Rs2RunePouch.md new file mode 100644 index 00000000000..6c8c81499a4 --- /dev/null +++ b/docs/api/Rs2RunePouch.md @@ -0,0 +1,108 @@ +# Rs2RunePouch Class Documentation + +## [Back](development.md) + +## Overview +The `Rs2RunePouch` class provides utilities to manage and interact with the Rune Pouch. It allows for checking rune contents, loading loadouts, and depositing runes into the bank. + +## Methods + +### `closeRunePouch` +- **Signature**: `public static boolean closeRunePouch()` +- **Description**: Closes the rune pouch interface if it is open. + +### `contains` +- **Signature**: `public static boolean contains(int itemId)` +- **Description**: Checks if the rune pouch contains at least one of the specified rune by item ID. + +### `contains` +- **Signature**: `public static boolean contains(int itemId, boolean allowCombinationRunes)` +- **Description**: Checks if the rune pouch contains at least one of the specified rune by item ID, with optional combination rune support. + +### `contains` +- **Signature**: `public static boolean contains(int itemId, int amt)` +- **Description**: Checks if the rune pouch contains at least the specified quantity of the given rune item ID. + +### `contains` +- **Signature**: `public static boolean contains(int itemId, int amt, boolean allowCombinationRunes)` +- **Description**: Checks if the rune pouch contains at least the specified quantity of the given rune item ID, with optional combination rune support. + +### `contains` +- **Signature**: `public static boolean contains(Map requiredRunes)` +- **Description**: Checks if the rune pouch contains all of the specified runes in the required quantities (strict match). + +### `contains` +- **Signature**: `public static boolean contains(Map requiredRunes, boolean allowCombinationRunes)` +- **Description**: Checks if the rune pouch contains the required runes and their quantities, with optional combination rune support. + +### `contains` +- **Signature**: `public static boolean contains(Runes rune)` +- **Description**: Checks if the rune pouch contains at least one of the specified rune. + +### `contains` +- **Signature**: `public static boolean contains(Runes rune, boolean allowCombinationRunes)` +- **Description**: Checks if the rune pouch contains at least one of the specified rune, with optional combination rune support. + +### `contains` +- **Signature**: `public static boolean contains(Runes rune, int amt)` +- **Description**: Checks if the rune pouch contains at least the specified quantity of the given rune. + +### `contains` +- **Signature**: `public static boolean contains(Runes rune, int amt, boolean allowCombinationRunes)` +- **Description**: Checks if the rune pouch contains at least the specified quantity of the given rune, with optional combination rune support. + +### `depositAll` +- **Signature**: `public static boolean depositAll()` +- **Description**: Deposits all runes from the pouch into the bank. Requires the bank to be open. + +### `fullUpdate` +- **Signature**: `public static void fullUpdate()` +- **Description**: Updates the internal state of the pouch from the current game varbits. + +### `getLoadoutSlots` +- **Signature**: `public static Map> getLoadoutSlots()` +- **Description**: Retrieves the map of loaded pouch slots from the bank interface. + +### `getQuantity` +- **Signature**: `public static int getQuantity(int itemId)` +- **Description**: Retrieves the current quantity of the specified rune item ID in the rune pouch. + +### `getQuantity` +- **Signature**: `public static int getQuantity(Runes rune)` +- **Description**: Retrieves the current quantity of the specified rune in the rune pouch. + +### `getRunes` +- **Signature**: `public static Map getRunes()` +- **Description**: Retrieves the current rune pouch contents as a map of runes and their quantities. + +### `getSlots` +- **Signature**: `public static List getSlots()` +- **Description**: Retrieves the list of current pouch slots. + +### `isEmpty` +- **Signature**: `public static boolean isEmpty()` +- **Description**: Checks if the rune pouch is currently empty. + +### `isRunePouchOpen` +- **Signature**: `public static boolean isRunePouchOpen()` +- **Description**: Checks if the rune pouch UI is currently open. + +### `load` +- **Signature**: `public static boolean load(Map requiredRunes)` +- **Description**: Attempts to load the specified runes into the rune pouch using strict matching. Can use bank loadouts or direct withdrawal. + +### `loadFromInventorySetup` +- **Signature**: `public static boolean loadFromInventorySetup(Map inventorySetupRunes)` +- **Description**: Attempts to load the specified runes into the rune pouch using fuzzy logic where applicable (e.g. from Inventory Setups). + +### `onVarbitChanged` +- **Signature**: `public static void onVarbitChanged(VarbitChanged ev)` +- **Description**: Updates the specific pouch slot when a varbit is changed. + +### `onWidgetLoaded` +- **Signature**: `public static void onWidgetLoaded(WidgetLoaded ev)` +- **Description**: Handles reading rune pouch loadouts from the bank interface widgets. + +### `openRunePouch` +- **Signature**: `public static boolean openRunePouch()` +- **Description**: Opens the rune pouch UI. diff --git a/docs/api/Rs2Settings.md b/docs/api/Rs2Settings.md index 8853d94e879..cf6f338802a 100644 --- a/docs/api/Rs2Settings.md +++ b/docs/api/Rs2Settings.md @@ -1,2 +1,88 @@ +# Rs2Settings Class Documentation + ## [Back](development.md) -TODO \ No newline at end of file + +## Overview +The `Rs2Settings` class provides methods to interact with and toggle various in-game settings, such as shift-dropping, hiding roofs, notifications, and audio settings. + +## Methods + +### `disableLevelUpNotifications` +- **Signature**: `public static boolean disableLevelUpNotifications()` +- **Description**: Disables level-up notifications in the settings. Convenience method that also closes the interface. + +### `disableLevelUpNotifications` +- **Signature**: `public static boolean disableLevelUpNotifications(boolean closeInterface)` +- **Description**: Disables level-up notifications in the settings, with an option to keep the interface open. + +### `disableWorldSwitcherConfirmation` +- **Signature**: `public static boolean disableWorldSwitcherConfirmation()` +- **Description**: Disables the confirmation dialog when switching worlds. Convenience method that also closes the interface. + +### `disableWorldSwitcherConfirmation` +- **Signature**: `public static boolean disableWorldSwitcherConfirmation(boolean closeInterface)` +- **Description**: Disables the confirmation dialog when switching worlds, with an option to keep the interface open. + +### `enableBankSlotLocking` +- **Signature**: `public static boolean enableBankSlotLocking()` +- **Description**: Enables bank slot locking if currently disabled. Navigates bank settings to toggle the feature. + +### `enableDropShiftSetting` +- **Signature**: `public static boolean enableDropShiftSetting()` +- **Description**: Enables shift-click dropping in the settings. Convenience method that also closes the interface. + +### `enableDropShiftSetting` +- **Signature**: `public static boolean enableDropShiftSetting(boolean closeInterface)` +- **Description**: Enables shift-click dropping in the settings, with an option to keep the interface open. + +### `enableSpellFiltering` +- **Signature**: `public static void enableSpellFiltering()` +- **Description**: Enables spell filtering in the magic spellbook if it is currently disabled. + +### `getMinimumItemValueAlchemyWarning` +- **Signature**: `public static int getMinimumItemValueAlchemyWarning()` +- **Description**: Retrieves the minimum item value that triggers a high alchemy warning. + +### `hideRoofs` +- **Signature**: `public static boolean hideRoofs()` +- **Description**: Hides roofs in the settings. Convenience method that also closes the interface. + +### `hideRoofs` +- **Signature**: `public static boolean hideRoofs(boolean closeInterface)` +- **Description**: Hides roofs in the settings, with an option to keep the interface open. + +### `isBankSlotLockingEnabled` +- **Signature**: `public static boolean isBankSlotLockingEnabled()` +- **Description**: Checks if bank slot locking is enabled. + +### `isDropShiftSettingEnabled` +- **Signature**: `public static boolean isDropShiftSettingEnabled()` +- **Description**: Checks if shift-click dropping is enabled. + +### `isEscCloseInterfaceSettingEnabled` +- **Signature**: `public static boolean isEscCloseInterfaceSettingEnabled()` +- **Description**: Checks if the "Esc closes interface" setting is enabled. + +### `isHideRoofsEnabled` +- **Signature**: `public static boolean isHideRoofsEnabled()` +- **Description**: Checks if roofs are currently hidden. + +### `isLevelUpNotificationsEnabled` +- **Signature**: `public static boolean isLevelUpNotificationsEnabled()` +- **Description**: Checks if level-up notifications are enabled. + +### `isSpellFilteringEnabled` +- **Signature**: `public static boolean isSpellFilteringEnabled()` +- **Description**: Checks if spell filtering is enabled in the magic spellbook. + +### `isWorldSwitcherConfirmationEnabled` +- **Signature**: `public static boolean isWorldSwitcherConfirmationEnabled()` +- **Description**: Checks if the world switcher confirmation is enabled. + +### `openSettings` +- **Signature**: `public static boolean openSettings()` +- **Description**: Opens the main settings interface. + +### `turnOffMusic` +- **Signature**: `public static void turnOffMusic()` +- **Description**: Turns off music, sound effects, and area sounds in the settings tab. diff --git a/docs/api/Rs2Shop.md b/docs/api/Rs2Shop.md new file mode 100644 index 00000000000..adbc45ef374 --- /dev/null +++ b/docs/api/Rs2Shop.md @@ -0,0 +1,76 @@ +# Rs2Shop Class Documentation + +## [Back](development.md) + +## Overview +The `Rs2Shop` class manages interactions with shops in the game, including opening shops, buying items, checking stock, and handling shop interfaces. + +## Methods + +### `buyItem` +- **Signature**: `public static boolean buyItem(String itemName, String quantity)` +- **Description**: Buys a specified quantity of an item from the shop by its name. + +### `buyItem` +- **Signature**: `public static boolean buyItem(int itemId, String quantity)` +- **Description**: Buys a specified quantity of an item from the shop by its ID. + +### `buyItemOptimally` +- **Signature**: `public static void buyItemOptimally(String itemName, int desiredQuantity)` +- **Description**: Buys an item in an optimal way given the desired total quantity. Uses allowed purchase quantities (50, 10, 5, 1) to minimize calls. + +### `closeShop` +- **Signature**: `public static void closeShop()` +- **Description**: Closes the shop interface if it is open. + +### `getNearestShopNpc` +- **Signature**: `public static Rs2NpcModel getNearestShopNpc(String npcName)` +- **Description**: Finds the nearest shop NPC with the specified name and "Trade" action (partial name matching). + +### `getNearestShopNpc` +- **Signature**: `public static Rs2NpcModel getNearestShopNpc(String npcName, boolean exact)` +- **Description**: Finds the nearest shop NPC with the specified name and "Trade" action. + +### `getSlot` +- **Signature**: `public static int getSlot(String itemName)` +- **Description**: Retrieves the slot number of the specified item in the shop. + +### `hasMinimumStock` +- **Signature**: `public static boolean hasMinimumStock(int itemId, int minimumQuantity)` +- **Description**: Checks if the specified item is in stock in the shop with quantity >= minimumQuantity. + +### `hasMinimumStock` +- **Signature**: `public static boolean hasMinimumStock(String itemName, int minimumQuantity)` +- **Description**: Checks if the specified item is in stock in the shop with quantity >= minimumQuantity. + +### `hasStock` +- **Signature**: `public static boolean hasStock(int itemId)` +- **Description**: Checks if the specified item is in stock in the shop. + +### `hasStock` +- **Signature**: `public static boolean hasStock(String itemName)` +- **Description**: Checks if the specified item is in stock in the shop. + +### `isFull` +- **Signature**: `public static boolean isFull()` +- **Description**: Checks if the shop is completely full. + +### `isOpen` +- **Signature**: `public static boolean isOpen()` +- **Description**: Checks if the shop interface is open. + +### `openShop` +- **Signature**: `public static boolean openShop(String npc)` +- **Description**: Opens the shop interface by interacting with the specified NPC (partial name match). + +### `openShop` +- **Signature**: `public static boolean openShop(String npcName, boolean exact)` +- **Description**: Opens the shop interface by interacting with the specified NPC. + +### `storeShopItemsInMemory` +- **Signature**: `public static void storeShopItemsInMemory(ItemContainerChanged e, int id)` +- **Description**: Updates the shop items in memory based on the provided event. + +### `waitForShopChanges` +- **Signature**: `public static boolean waitForShopChanges()` +- **Description**: Waits for the shop content to change by comparing the current items with the cached values. diff --git a/docs/api/Rs2Spells.md b/docs/api/Rs2Spells.md index 8853d94e879..bc049c3c344 100644 --- a/docs/api/Rs2Spells.md +++ b/docs/api/Rs2Spells.md @@ -1,2 +1,16 @@ +# Rs2Spells Class Documentation + ## [Back](development.md) -TODO \ No newline at end of file + +## Overview +The `Rs2Spells` enum defines all supported spells from Modern, Ancient, Lunar, and Arceuus spellbooks. Each enum constant represents a spell and contains information about its required runes, level, and spellbook. + +## Methods + +### `getElementalRunes` +- **Signature**: `public List getElementalRunes()` +- **Description**: Returns only the elemental runes (Air, Water, Earth, Fire) required for this spell. This is useful for checking if a staff or combination runes can satisfy the spell's requirements. + +### `getRequiredRunes` +- **Signature**: `public HashMap getRequiredRunes()` +- **Description**: Returns a map of runes and their quantities required to cast this spell. diff --git a/docs/api/Rs2Tab.md b/docs/api/Rs2Tab.md index 8853d94e879..20df099c03f 100644 --- a/docs/api/Rs2Tab.md +++ b/docs/api/Rs2Tab.md @@ -1,2 +1,80 @@ +# Rs2Tab Class Documentation + ## [Back](development.md) -TODO \ No newline at end of file + +## Overview +The `Rs2Tab` class manages interface tabs in the game, such as Inventory, Combat, Skills, and others. It provides methods to switch between tabs and check the currently active tab. + +## Methods + +### `getCurrentTab` +- **Signature**: `public static InterfaceTab getCurrentTab()` +- **Description**: Retrieves the currently open interface tab based on the `TOPLEVEL_PANEL` client variable. + +### `getSpellBookTab` +- **Signature**: `public static Widget getSpellBookTab()` +- **Description**: Retrieves the widget corresponding to the spellbook tab, accounting for different game layouts (resizable, fixed). + +### `isCurrentTab` +- **Signature**: `public static boolean isCurrentTab(InterfaceTab tab)` +- **Description**: Checks if the specified tab is currently selected. + +### `switchTo` +- **Signature**: `public static boolean switchTo(InterfaceTab tab)` +- **Description**: Switches to the specified interface tab using hotkeys. Returns `true` if the switch was successful or the tab was already active. + +### `switchToAccountManagementTab` +- **Signature**: `public static boolean switchToAccountManagementTab()` +- **Description**: Deprecated. Use `switchTo(InterfaceTab.ACC_MAN)`. + +### `switchToCombatOptionsTab` +- **Signature**: `public static boolean switchToCombatOptionsTab()` +- **Description**: Deprecated. Use `switchTo(InterfaceTab.COMBAT)`. + +### `switchToEmotesTab` +- **Signature**: `public static boolean switchToEmotesTab()` +- **Description**: Deprecated. Use `switchTo(InterfaceTab.EMOTES)`. + +### `switchToEquipmentTab` +- **Signature**: `public static boolean switchToEquipmentTab()` +- **Description**: Deprecated. Use `switchTo(InterfaceTab.EQUIPMENT)`. + +### `switchToFriendsTab` +- **Signature**: `public static boolean switchToFriendsTab()` +- **Description**: Deprecated. Use `switchTo(InterfaceTab.FRIENDS)`. + +### `switchToGroupingTab` +- **Signature**: `public static boolean switchToGroupingTab()` +- **Description**: Deprecated. Use `switchTo(InterfaceTab.CHAT)`. + +### `switchToInventoryTab` +- **Signature**: `public static boolean switchToInventoryTab()` +- **Description**: Deprecated. Use `switchTo(InterfaceTab.INVENTORY)`. + +### `switchToLogout` +- **Signature**: `public static boolean switchToLogout()` +- **Description**: Deprecated. Use `switchTo(InterfaceTab.LOGOUT)`. + +### `switchToMagicTab` +- **Signature**: `public static boolean switchToMagicTab()` +- **Description**: Deprecated. Use `switchTo(InterfaceTab.MAGIC)`. + +### `switchToMusicTab` +- **Signature**: `public static boolean switchToMusicTab()` +- **Description**: Deprecated. Use `switchTo(InterfaceTab.MUSIC)`. + +### `switchToPrayerTab` +- **Signature**: `public static boolean switchToPrayerTab()` +- **Description**: Deprecated. Use `switchTo(InterfaceTab.PRAYER)`. + +### `switchToQuestTab` +- **Signature**: `public static boolean switchToQuestTab()` +- **Description**: Deprecated. Use `switchTo(InterfaceTab.QUESTS)`. + +### `switchToSettingsTab` +- **Signature**: `public static boolean switchToSettingsTab()` +- **Description**: Deprecated. Use `switchTo(InterfaceTab.SETTINGS)`. + +### `switchToSkillsTab` +- **Signature**: `public static boolean switchToSkillsTab()` +- **Description**: Deprecated. Use `switchTo(InterfaceTab.SKILLS)`. diff --git a/docs/api/Rs2Walker.md b/docs/api/Rs2Walker.md index 8853d94e879..1d3298c7188 100644 --- a/docs/api/Rs2Walker.md +++ b/docs/api/Rs2Walker.md @@ -1,2 +1,44 @@ +# Rs2Walker Class Documentation + ## [Back](development.md) -TODO \ No newline at end of file + +## Overview +The `Rs2Walker` class is the primary utility for handling player movement and pathfinding. It supports walking to specific coordinates, handling obstacles, using transports (teleports, ships, etc.), and interacting with the minimap. + +## Methods + +### `canReach` +- **Signature**: `public static boolean canReach(WorldPoint worldPoint)` +- **Description**: Checks if a specific world point is reachable from the current location. + +### `getWalkPath` +- **Signature**: `public static List getWalkPath(WorldPoint target)` +- **Description**: Retrieves the walk path from the player's current location to the specified target location. + +### `getTotalTiles` +- **Signature**: `public static int getTotalTiles(WorldPoint destination)` +- **Description**: Gets the total amount of tiles to travel to destination. Returns `Integer.MAX_VALUE` if unreachable. + +### `setTarget` +- **Signature**: `public static void setTarget(WorldPoint target)` +- **Description**: Sets the current target for the walker. Can be used to update or clear the target. + +### `walkFastCanvas` +- **Signature**: `public static boolean walkFastCanvas(WorldPoint worldPoint)` +- **Description**: interacting with the game canvas to click the tile. Useful for short distances or when the tile is on screen. + +### `walkMiniMap` +- **Signature**: `public static boolean walkMiniMap(WorldPoint worldPoint)` +- **Description**: Walks to the specified world point by clicking on the minimap. + +### `walkTo` +- **Signature**: `public static boolean walkTo(int x, int y, int plane)` +- **Description**: Walks to the specified coordinates. + +### `walkTo` +- **Signature**: `public static boolean walkTo(WorldPoint target)` +- **Description**: Walks to the specified `WorldPoint`. Uses the shortest pathfinder and handles transports/obstacles. + +### `walkTo` +- **Signature**: `public static boolean walkTo(WorldPoint target, int distance)` +- **Description**: Walks to the specified `WorldPoint`, considering the action complete when within the specified distance. diff --git a/docs/api/Rs2Widget.md b/docs/api/Rs2Widget.md index 8853d94e879..494e1750a43 100644 --- a/docs/api/Rs2Widget.md +++ b/docs/api/Rs2Widget.md @@ -1,2 +1,212 @@ +# Rs2Widget Class Documentation + ## [Back](development.md) -TODO \ No newline at end of file + +## Overview +The `Rs2Widget` class provides a comprehensive set of methods for finding, checking, and interacting with widgets in the game interface. It supports finding widgets by text, ID, or structure, and interacting with them. + +## Methods + +### `calculateTextSimilarity` +- **Signature**: `public static double calculateTextSimilarity(String source, String target)` +- **Description**: Calculates text similarity score between two strings (0.0 to 1.0). + +### `checkBoundsOverlapWidgetInMainModal` +- **Signature**: `public static boolean checkBoundsOverlapWidgetInMainModal(Rectangle overlayBoundsCanvas, int viewportXOffset, int viewportYOffset)` +- **Description**: Checks if a given rectangle overlaps with any widget in the main modal interface. + +### `clickChildWidget` +- **Signature**: `public static boolean clickChildWidget(int id, int childId)` +- **Description**: Clicks on a child widget specified by the parent ID and child index. + +### `clickWidget` +- **Signature**: `public static boolean clickWidget(String text)` +- **Description**: Clicks a widget containing the specified text (partial match). + +### `clickWidget` +- **Signature**: `public static boolean clickWidget(String text, boolean exact)` +- **Description**: Clicks a widget containing the specified text, with an option for exact matching. + +### `clickWidget` +- **Signature**: `public static boolean clickWidget(String text, Optional widgetId, int childId, boolean exact)` +- **Description**: Clicks a widget matching text criteria, optionally scoped to a specific parent widget ID. + +### `clickWidget` +- **Signature**: `public static boolean clickWidget(Widget widget)` +- **Description**: Clicks the specified widget instance. + +### `clickWidget` +- **Signature**: `public static boolean clickWidget(int id)` +- **Description**: Clicks a widget specified by its ID. + +### `clickWidget` +- **Signature**: `public static boolean clickWidget(int parentId, int childId)` +- **Description**: Clicks a widget specified by its parent ID and child index. + +### `clickWidgetFast` +- **Signature**: `public static void clickWidgetFast(Widget widget)` +- **Description**: Performs a fast click on a widget using menu entry invocation. + +### `clickWidgetFast` +- **Signature**: `public static void clickWidgetFast(Widget widget, int param0)` +- **Description**: Performs a fast click on a widget with a specified parameter. + +### `clickWidgetFast` +- **Signature**: `public static void clickWidgetFast(Widget widget, int param0, int identifier)` +- **Description**: Performs a fast click on a widget with specified parameters and identifier. + +### `clickWidgetFast` +- **Signature**: `public static void clickWidgetFast(int packetId, int identifier)` +- **Description**: Performs a fast click on a widget specified by its packet ID. + +### `enableQuantityOption` +- **Signature**: `public static boolean enableQuantityOption(String quantity)` +- **Description**: Enables a specific quantity option (e.g., "All") in processing interfaces. + +### `enterWilderness` +- **Signature**: `public static boolean enterWilderness()` +- **Description**: Detects the wilderness warning interface and clicks the enter button. + +### `findBestMatchingWidget` +- **Signature**: `public static Widget findBestMatchingWidget(int widgetId, String targetText)` +- **Description**: Finds the best matching widget within a parent based on exact match, contains match, or word similarity. + +### `findSimilarWidgets` +- **Signature**: `public static List findSimilarWidgets(List widgets, String targetText, double threshold)` +- **Description**: Finds all widgets that match above a text similarity threshold. + +### `findWidget` +- **Signature**: `public static Widget findWidget(String text)` +- **Description**: Finds a widget containing the specified text (partial match). + +### `findWidget` +- **Signature**: `public static Widget findWidget(String text, boolean exact)` +- **Description**: Finds a widget containing the specified text with matching option. + +### `findWidget` +- **Signature**: `public static Widget findWidget(String text, List children)` +- **Description**: Finds a widget containing the specified text within a list of children (partial match). + +### `findWidget` +- **Signature**: `public static Widget findWidget(String text, List children, boolean exact)` +- **Description**: Searches for a widget with matching text, either in the provided children or across all root widgets. + +### `findWidget` +- **Signature**: `public static Widget findWidget(int spriteId, List children)` +- **Description**: Searches for a widget with the specified sprite ID among root widgets or specified children. + +### `findWidgetsWithAction` +- **Signature**: `public static Map findWidgetsWithAction(String actionText, int widgetGroupId, boolean clickWidget)` +- **Description**: Finds widgets with specific action text in a group. + +### `findWidgetsWithAction` +- **Signature**: `public static Map findWidgetsWithAction(String actionText, int widgetGroupId, int widgetSubGroupId, boolean clickWidget)` +- **Description**: Finds all widgets with specific action text in a subgroup. + +### `getChildWidgetSpriteID` +- **Signature**: `public static int getChildWidgetSpriteID(int id, int childId)` +- **Description**: Retrieves the sprite ID of a child widget. + +### `getChildWidgetText` +- **Signature**: `public static String getChildWidgetText(int id, int childId)` +- **Description**: Retrieves the text of a child widget. + +### `getWidget` +- **Signature**: `public static Widget getWidget(int id)` +- **Description**: Retrieves a widget by its ID. + +### `getWidget` +- **Signature**: `public static Widget getWidget(int id, int child)` +- **Description**: Retrieves a widget by parent ID and child index. + +### `getWidgetsKeyMap` +- **Signature**: `public static Map getWidgetsKeyMap(int widgetGroupId, int widgetSubGroupId)` +- **Description**: Gets keyboard shortcut keys for widgets in processing interfaces. + +### `handleProcessConfirmation` +- **Signature**: `public static boolean handleProcessConfirmation(int widgetGroupId)` +- **Description**: Handles chat/trade dialogue confirmations. + +### `handleProcessingInterface` +- **Signature**: `public static boolean handleProcessingInterface(String actionText)` +- **Description**: Handles generic processing interface interactions with quantity selection. + +### `hasVisibleWidgetText` +- **Signature**: `public static boolean hasVisibleWidgetText(String text)` +- **Description**: Checks if specific widget text exists and is visible. + +### `hasWidget` +- **Signature**: `public static boolean hasWidget(String text)` +- **Description**: Checks if a widget containing the specified text exists. + +### `hasWidgetText` +- **Signature**: `public static boolean hasWidgetText(String text, int componentId, boolean exact)` +- **Description**: Checks if a root widget or its descendants contain the specified text. + +### `hasWidgetText` +- **Signature**: `public static boolean hasWidgetText(String text, int widgetId, int childId, boolean exact)` +- **Description**: Checks if a specific widget or its descendants contain the specified text. + +### `isDepositBoxWidgetOpen` +- **Signature**: `public static boolean isDepositBoxWidgetOpen()` +- **Description**: Checks if the deposit box widget is open. + +### `isGoldCraftingWidgetOpen` +- **Signature**: `public static boolean isGoldCraftingWidgetOpen()` +- **Description**: Checks if the gold crafting widget is open. + +### `isHidden` +- **Signature**: `public static boolean isHidden(int id)` +- **Description**: Checks if a widget is hidden by ID. + +### `isHidden` +- **Signature**: `public static boolean isHidden(int parentId, int childId)` +- **Description**: Checks if a child widget is hidden. + +### `isProductionWidgetOpen` +- **Signature**: `public static boolean isProductionWidgetOpen()` +- **Description**: Checks if the production widget is open. + +### `isSilverCraftingWidgetOpen` +- **Signature**: `public static boolean isSilverCraftingWidgetOpen()` +- **Description**: Checks if the silver crafting widget is open. + +### `isSmithingWidgetOpen` +- **Signature**: `public static boolean isSmithingWidgetOpen()` +- **Description**: Checks if the smithing widget is open. + +### `isWidgetVisible` +- **Signature**: `public static boolean isWidgetVisible(int id)` +- **Description**: Checks if a widget is visible by ID. + +### `isWidgetVisible` +- **Signature**: `public static boolean isWidgetVisible(int widgetId, int childId)` +- **Description**: Checks if a child widget is visible. + +### `isWildernessInterfaceOpen` +- **Signature**: `public static boolean isWildernessInterfaceOpen()` +- **Description**: Checks if the wilderness warning interface is open. + +### `searchChildren` +- **Signature**: `public static Widget searchChildren(String text, Widget child, boolean exact)` +- **Description**: Recursively searches through child widgets for a text match. + +### `searchChildren` +- **Signature**: `public static Widget searchChildren(int spriteId, Widget child)` +- **Description**: Recursively searches through child widgets for a sprite ID match. + +### `sleepUntilHasNotWidgetText` +- **Signature**: `public static boolean sleepUntilHasNotWidgetText(String text, int widgetId, int childId, boolean exact, int sleep)` +- **Description**: Waits until a widget does NOT contain the specified text. + +### `sleepUntilHasWidget` +- **Signature**: `public static boolean sleepUntilHasWidget(String text)` +- **Description**: Waits until a widget containing the specified text appears. + +### `sleepUntilHasWidgetText` +- **Signature**: `public static boolean sleepUntilHasWidgetText(String text, int widgetId, int childId, boolean exact, int sleep)` +- **Description**: Waits until a widget contains the specified text. + +### `waitForWidget` +- **Signature**: `public static boolean waitForWidget(String text, int timeout)` +- **Description**: Waits for a widget to appear with specified text. diff --git a/docs/api/Rs2WorldPoint.md b/docs/api/Rs2WorldPoint.md new file mode 100644 index 00000000000..caef119190d --- /dev/null +++ b/docs/api/Rs2WorldPoint.md @@ -0,0 +1,52 @@ +# Rs2WorldPoint Class Documentation + +## [Back](development.md) + +## Overview +The `Rs2WorldPoint` class acts as a wrapper and utility for `WorldPoint`, providing additional functionality for pathfinding, distance calculation, and coordinate conversion, especially useful for instanced areas. + +## Methods + +### `convertInstancedWorldPoint` +- **Signature**: `public static WorldPoint convertInstancedWorldPoint(WorldPoint worldPoint)` +- **Description**: Converts an instanced `WorldPoint` coordinate to a global `WorldPoint`. This is useful for locating objects within instanced rooms relative to the global map. + +### `distanceToPath` +- **Signature**: `public int distanceToPath(WorldPoint other)` +- **Description**: Calculates the distance to a target `WorldPoint` along a path. Returns `Integer.MAX_VALUE` if no path is found or the path does not end at the target. + +### `getPlane` +- **Signature**: `public int getPlane()` +- **Description**: Gets the plane (height level) of the `Rs2WorldPoint`. + +### `getWorldPoint` +- **Signature**: `public WorldPoint getWorldPoint()` +- **Description**: Retrieves the underlying `WorldPoint` object. + +### `getX` +- **Signature**: `public int getX()` +- **Description**: Gets the X coordinate of the `Rs2WorldPoint`. + +### `getY` +- **Signature**: `public int getY()` +- **Description**: Gets the Y coordinate of the `Rs2WorldPoint`. + +### `normalizeY` +- **Signature**: `public static int normalizeY(WorldPoint point)` +- **Description**: Normalizes the Y coordinate of a `WorldPoint`. This is typically used for comparing locations in caves or dungeons where Y coordinates are shifted. + +### `pathTo` +- **Signature**: `public List pathTo(WorldPoint other)` +- **Description**: Calculates a path to the specified `WorldPoint`. Returns a list of `WorldPoint`s representing the path, or `null` if no path is found. + +### `pathTo` +- **Signature**: `public List pathTo(WorldPoint other, boolean fullPath)` +- **Description**: Calculates a path to the specified `WorldPoint`, optionally returning the full list of tiles (including intermediate steps) instead of just key checkpoints. + +### `quickDistance` +- **Signature**: `public static int quickDistance(WorldPoint a, WorldPoint b)` +- **Description**: Calculates the Chebyshev distance between two `WorldPoint`s. This is a quick approximation of distance often used in tile-based games. + +### `toLocalInstance` +- **Signature**: `public static WorldPoint toLocalInstance(WorldPoint worldPoint)` +- **Description**: Converts a global `WorldPoint` to a local instance `WorldPoint` if the player is currently in an instance. From 0f83b95a7709831fd464c9405adfe1426f76f90e Mon Sep 17 00:00:00 2001 From: Michael <994599+mzarglis@users.noreply.github.com> Date: Fri, 13 Feb 2026 12:54:27 -0500 Subject: [PATCH 2/2] docs(api): fix inconsistent description in Rs2DepositBox --- docs/api/Rs2DepositBox.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/Rs2DepositBox.md b/docs/api/Rs2DepositBox.md index 474adb3a211..6fb2d49a1df 100644 --- a/docs/api/Rs2DepositBox.md +++ b/docs/api/Rs2DepositBox.md @@ -9,7 +9,7 @@ The `Rs2DepositBox` class provides utility methods for interacting with deposit ### `bankItemsAndWalkBackToOriginalPosition` - **Signature**: `public static boolean bankItemsAndWalkBackToOriginalPosition(List itemNames, WorldPoint initialPlayerLocation)` -- **Description**: Banks items if the inventory is full and returns to the initial player location. +- **Description**: Banks items if the inventory does not have enough empty slots. Will walk back to the initial player location. ### `bankItemsAndWalkBackToOriginalPosition` - **Signature**: `public static boolean bankItemsAndWalkBackToOriginalPosition(List itemNames, WorldPoint initialPlayerLocation, int emptySlotCount)`