Skip to content

Comments

Construction 2, Rs2GroundItem, and Rs2GrandExchange improvements.#1538

Closed
Gage307 wants to merge 4 commits intochsami:developmentfrom
Gage307:development
Closed

Construction 2, Rs2GroundItem, and Rs2GrandExchange improvements.#1538
Gage307 wants to merge 4 commits intochsami:developmentfrom
Gage307:development

Conversation

@Gage307
Copy link
Contributor

@Gage307 Gage307 commented Sep 24, 2025

Construction 2: Added support for break handler, added support for both tile objects and game objects as both are needed depending on what we're building.

Rs2GroundItem: Fixed a bug that would cause Rev Killer to click loot on the ground over and over despite a full inventory.

Rs2GrandExchange: Fixed a bug that would cause the script to loop buying an item unsuccessfully; if we've previously searched the item within the Grand Exchange.

…e butler after a break or for the first loop
…we need both for this script. Minor changes to butler, added enter dungeon to returnToTheHouse if we're building oak dungeon doors
…w some time for the widget to load. This is needed because if we have previously searched the item the widget is all ready visible. Causing the script to misclick cyclically.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 24, 2025

Walkthrough

The plugin sets Construction2Script.firstRun to true on startup. Construction2Script refactors object targeting by splitting closest-object retrieval into GameObject and TileObject methods, adds objectIDs and firstRun fields, and introduces callTheButler plus a returnToTheHouse(List) path including dungeon door handling. Build/remove logic now supports both GameObject and TileObject flows, with adjusted thresholds and added logging, and expanded Butler dialogue handling. Rs2GrandExchange adds a short sleep after typing the item name during BUY to allow widget loading. Rs2GroundItem’s coreLoot now exits early when the inventory is full before waiting for despawn.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title lists the actual updated modules and improvements, so it’s directly related to the changes made without introducing off-topic content. It clearly references real parts of the changeset and is not overly generic or misleading. Although it enumerates multiple areas rather than focusing on a single main change, it still meets the criteria for being related to the changeset.
Description Check ✅ Passed The description concisely summarizes each change implemented—Construction2 enhancements, the ground item loot bug fix, and the Grand Exchange purchase loop fix—and directly corresponds to the modifications detailed in the raw summary. It is clearly related to the changeset and not off-topic, providing a coherent overview of the PR’s intent. Therefore, it meets the criteria for the description check.
✨ Finishing touches
  • 📝 Generate Docstrings

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2ca176 and b7f0bdc.

📒 Files selected for processing (4)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/GeoffPlugins/construction2/Construction2Plugin.java (1 hunks)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/GeoffPlugins/construction2/Construction2Script.java (7 hunks)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/grandexchange/Rs2GrandExchange.java (1 hunks)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/grounditem/Rs2GroundItem.java (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-08-25T15:51:39.272Z
Learnt from: runsonmypc
PR: chsami/Microbot#1417
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/agility/AgilityScript.java:13-13
Timestamp: 2025-08-25T15:51:39.272Z
Learning: Both net.runelite.api.ItemID and net.runelite.api.gameval.ItemID are valid import paths in the RuneLite codebase. The microbot plugins consistently use net.runelite.api.ItemID as their established pattern.

Applied to files:

  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/GeoffPlugins/construction2/Construction2Script.java
📚 Learning: 2025-08-25T06:45:09.673Z
Learnt from: Voxsylvae
PR: chsami/Microbot#1415
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/agility/MicroAgilityPrePostScheduleRequirements.java:7-7
Timestamp: 2025-08-25T06:45:09.673Z
Learning: Always use game ID classes from net.runelite.api.gameval package (like ItemID, ObjectID, NpcID) instead of the deprecated classes in net.runelite.api package. The gameval package contains the new, preferred classes while the old ones in the direct api package are deprecated.

Applied to files:

  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/GeoffPlugins/construction2/Construction2Script.java
📚 Learning: 2025-09-10T01:10:09.440Z
Learnt from: T-edit
PR: chsami/Microbot#1500
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/tempoross/TemporossScript.java:674-679
Timestamp: 2025-09-10T01:10:09.440Z
Learning: Rs2NpcModel implements the NPC interface (extends ActorModel implements NPC), so instanceof NPC returns true for Rs2NpcModel instances. When Rs2Player.getInteracting() returns Rs2NpcModel objects, they can be safely cast to NPC.

Applied to files:

  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/GeoffPlugins/construction2/Construction2Script.java
📚 Learning: 2025-09-10T01:10:09.440Z
Learnt from: T-edit
PR: chsami/Microbot#1500
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/tempoross/TemporossScript.java:674-679
Timestamp: 2025-09-10T01:10:09.440Z
Learning: Rs2NpcModel is an NPC class, so `instanceof NPC` returns true for Rs2NpcModel instances. When reviewing code that checks `instanceof NPC` on objects that might be Rs2NpcModel, the check will work correctly.

Applied to files:

  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/GeoffPlugins/construction2/Construction2Script.java
🧬 Code graph analysis (3)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/GeoffPlugins/construction2/Construction2Plugin.java (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/GeoffPlugins/construction2/Construction2Script.java (1)
  • Construction2Script (28-450)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/grounditem/Rs2GroundItem.java (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/inventory/Rs2Inventory.java (1)
  • Rs2Inventory (46-2324)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/GeoffPlugins/construction2/Construction2Script.java (5)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/tile/Rs2Tile.java (1)
  • Rs2Tile (28-1282)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2GameObject.java (1)
  • Rs2GameObject (36-2010)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/player/Rs2Player.java (1)
  • Rs2Player (53-2066)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/keyboard/Rs2Keyboard.java (1)
  • Rs2Keyboard (15-174)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/dialogues/Rs2Dialogue.java (1)
  • Rs2Dialogue (18-725)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (10)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/grounditem/Rs2GroundItem.java (1)

277-278: Inventory full check prevents unnecessary interaction attempts

Good optimization to break early when the inventory is full, avoiding futile despawn waits.

runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/grandexchange/Rs2GrandExchange.java (1)

238-239: Added delay allows widget loading after typing

The 500-800ms sleep after typing the item name gives the search results widget time to populate before validation.

runelite-client/src/main/java/net/runelite/client/plugins/microbot/GeoffPlugins/construction2/Construction2Script.java (7)

44-72: Dual object type support for different furniture

The addition of getClosestTileTileObject alongside the renamed getClosestTileGameObject properly handles both GameObject and TileObject furniture types.


162-166: Butler initialization on first run

The firstRun flag properly triggers butler召唤 when the butler is absent.


189-214: Proper object type selection based on furniture

The code correctly uses TileObject for OAK_DUNGEON_DOOR and GameObject for other furniture types when finding and updating the working tile.


243-266: House re-entry with dungeon navigation

The returnToTheHouse method properly handles portal interaction and dungeon entrance for OAK_DUNGEON_DOOR builds, setting firstRun to ensure butler recall.


268-337: Build logic correctly handles both object types

The build space interaction properly branches based on object type, with appropriate key press and validation for each furniture type.


340-376: Remove logic mirrors build with proper type handling

The remove space interaction correctly handles both GameObject and TileObject types with appropriate validation checks.


416-430: Butler call through house settings interface

The callTheButler method properly navigates the settings interface to summon the butler with appropriate widget interactions and delays.

runelite-client/src/main/java/net/runelite/client/plugins/microbot/GeoffPlugins/construction2/Construction2Plugin.java (1)

49-49: Plugin startup initializes firstRun flag

Setting Construction2Script.firstRun = true on startup ensures the butler is called when the script begins.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Gage307 Gage307 changed the title Development Construction 2, Rs2GroundItem, and Rs2GrandExchange improvements. Sep 24, 2025
@chsami
Copy link
Owner

chsami commented Sep 25, 2025

the construction2 scripts have been moved to the hub. plese take out these changes and apply them in the hub if you like.

Thx

@Gage307
Copy link
Contributor Author

Gage307 commented Sep 25, 2025

the construction2 scripts have been moved to the hub. plese take out these changes and apply them in the hub if you like.

Thx

I'm on it!

@Gage307 Gage307 closed this Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants