Skip to content

Comments

Support item mode in Rs2Bank method#1489

Merged
chsami merged 10 commits intochsami:developmentfrom
heap-overfl0w:support-item-mode
Sep 8, 2025
Merged

Support item mode in Rs2Bank method#1489
chsami merged 10 commits intochsami:developmentfrom
heap-overfl0w:support-item-mode

Conversation

@heap-overfl0w
Copy link
Contributor

Currently Rs2Bank.setWithdrawAs(boolean) always clicks the Note button (786458), even when switching to Item (786456), so setWithdrawAsItem() can never flip the mode, therefore never select Item mode.

chsami and others added 10 commits September 3, 2025 14:22
…pawn times.

- Added fuzzy gem bag support because I don't have an account to test this with. My implementation passes the eye test but will need actual testing.
…ragonstones, our gem bag will never be "completely full" (consisting of >= 60 gems of all 5 types) and could cause unnecessary fill attempts. Let's check the 4 types individually.
…checks, so starting with the bank open no longer tricks the script into WALKING/COOKING states without raw food to cook in the inventory.

- BANKING state specifically checks the bank for raw food and handles withdrawals, then closes the bank.
- Null check on Rogue's Den banker
…n (786458), even when switching to Item (786456), so setWithdrawAsItem() can never flip the mode, therefore never select Item mode.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 7, 2025

Walkthrough

This PR updates multiple areas:

  • README.md: removed sections on Quest Helper Integration (Not Enough Runes, Shortest Path) and Help and discussion; other content unchanged.
  • AutoCookingScript: added null checks for location and banker; early return if bank is open during COOKING; adjusted post-cook flow to WALKING; reworked raw-item checks to use hasRawItemInBank; simplified hasRawItem to inventory-only; added hasRawItemInBank helper; error and shutdown when no raw items in bank.
  • FortisGemStallThievingSpot: added world-hop/login recovery, player detection exit, comprehensive gem bag handling (check/open/fill/empty), uncut gem detection, fullness checks, and revised banking steps.
  • Rs2Bank: replaced hard-coded noted toggle with InterfaceID-based selection and click guard.

Possibly related PRs

  • Add fortis gem stall #1472: Introduces FortisGemStallThievingSpot; this PR extends it with gem bag handling and banking/world-hop logic.
  • Stop on no runes #1473: Modifies FortisGemStallThievingSpot thieve/bank logic; this PR builds on that with gem bag management and resilience additions.

📜 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 9cdf8cc and 2676be8.

📒 Files selected for processing (4)
  • README.md (0 hunks)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/cooking/scripts/AutoCookingScript.java (5 hunks)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/thieving/stalls/model/FortisGemStallThievingSpot.java (2 hunks)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/bank/Rs2Bank.java (2 hunks)
💤 Files with no reviewable changes (1)
  • README.md
🧰 Additional context used
🧠 Learnings (3)
📚 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/util/bank/Rs2Bank.java
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/thieving/stalls/model/FortisGemStallThievingSpot.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/util/bank/Rs2Bank.java
📚 Learning: 2025-08-25T15:51:52.157Z
Learnt from: runsonmypc
PR: chsami/Microbot#1417
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/agility/AgilityScript.java:284-291
Timestamp: 2025-08-25T15:51:52.157Z
Learning: In RuneLite's ItemID class, both PIEDISH and PIE_DISH constants exist and are valid, both referring to item ID 2313. The gameval package uses PIEDISH while the regular api package uses PIE_DISH, so either naming convention can be used.

Applied to files:

  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/bank/Rs2Bank.java
🧬 Code graph analysis (3)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/bank/Rs2Bank.java (1)
runelite-api/src/main/java/net/runelite/api/gameval/InterfaceID.java (1)
  • Bankmain (1188-1331)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/cooking/scripts/AutoCookingScript.java (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/player/Rs2Player.java (1)
  • Rs2Player (67-2076)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/thieving/stalls/model/FortisGemStallThievingSpot.java (4)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/Global.java (1)
  • Global (10-171)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2GameObject.java (1)
  • Rs2GameObject (36-2002)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/inventory/Rs2Inventory.java (1)
  • Rs2Inventory (60-2325)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/player/Rs2Player.java (1)
  • Rs2Player (67-2076)
⏰ 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 (13)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/bank/Rs2Bank.java (2)

26-26: Good switch to official InterfaceID source.

Using gameval.InterfaceID aligns with the newer API.


2641-2644: Bug fix verified: correct target for Item vs Note.

Selecting InterfaceID.Bankmain.NOTE/ITEM fixes the prior hardcoded-note bug. Click-guard + wait is sound.

runelite-client/src/main/java/net/runelite/client/plugins/microbot/cooking/scripts/AutoCookingScript.java (5)

77-81: Defensive null-check on location looks good.


90-94: Avoid cooking with bank open — good guard.


132-134: Fallback to WALKING when object missing — sensible.


143-144: NPC null-check prevents NPE at Rogue’s Den.


229-231: Bank-side raw check helper is fine.

runelite-client/src/main/java/net/runelite/client/plugins/microbot/thieving/stalls/model/FortisGemStallThievingSpot.java (6)

39-42: World-hop on nearby player presence — solid anti-profile step.


45-51: Resilience: hop when stall missing.


52-58: Resilience: hop when action missing.


63-76: Gem bag handling (check/open/fill) is correct and contained.


82-93: Bank flow is coherent: deposit uncut, empty bag, deposit rest, close.


100-119: Helpers for uncut detection/fullness are straightforward.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

@chsami chsami merged commit 5c2b461 into chsami:development Sep 8, 2025
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Dec 28, 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