Skip to content

Comments

feat(aiofighter): add wilderness improvements - looting bag support, blighted foods, ferox pool restoration, combat potion optimization#1476

Merged
chsami merged 1 commit intochsami:developmentfrom
runsonmypc:aio-fighter-wildy
Sep 10, 2025
Merged

feat(aiofighter): add wilderness improvements - looting bag support, blighted foods, ferox pool restoration, combat potion optimization#1476
chsami merged 1 commit intochsami:developmentfrom
runsonmypc:aio-fighter-wildy

Conversation

@runsonmypc
Copy link
Contributor

Description

Adds several wilderness-focused improvements to the AIO Fighter plugin to enhance the combat experience in wilderness areas.

Changes

  • Looting Bag Support: Automatically empties looting bag when banking
  • Blighted Food Recognition: Added support for blighted manta ray, anglerfish, and karambwan to the food system
  • Pool of Restoration: New optional feature to use the Pool of Restoration at Ferox Enclave after banking (configurable in banking settings)
  • Combat Potion Optimization: Combat potions now only consumed during active combat to prevent waste
  • Always empty containers when banking: Previously, containers such as Herb sack were only being emptied when using inventory setups, now they will emptied whenever we bank

Testing

  • Tested looting bag emptying with various items
  • Verified blighted foods are properly recognized by the banking system
  • Confirmed Pool of Restoration usage at Ferox Enclave
  • Verified combat potions are only consumed during combat

…blighted foods, ferox pool restoration, combat potion optimization
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 5, 2025

Walkthrough

  • Added AIOFighterConfig option usePoolAtFerox() (default false) under the Banking section with keyName "usePoolAtFerox".
  • BankerScript: introduced usePoolIfNeeded() to drink the "Pool of Refreshment" at Ferox Enclave when enabled and needed; triggers after withdrawUpkeepItems() if current bank is Ferox. Moved depositLootingBag(), emptyGemBag(), emptyHerbSack(), emptySeedBox() to the start of withdrawUpkeepItems(). Added related imports.
  • PotionManagerScript: gated drinking of ranged, magic, strength, attack, and defence potions behind Rs2Combat.inCombat().
  • Rs2Food: added BLIGHTED_MANTA_RAY, BLIGHTED_ANGLERFISH, BLIGHTED_KARAMBWAN enum entries; adjusted CABBAGE entry delimiter.
✨ 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/aiofighter/bank/BankerScript.java (1)

108-121: Banking can be skipped if no inventory setup is configured (regression risk).

Early-return on missing inventory setup happens before the “inventory full/low slots” checks, so players without setups won’t bank even with a full inventory.

-    public boolean needBanking() {
-        if(config.currentInventorySetup() == null){
-            if(config.defaultInventorySetup() != null) {
-                AIOFighterPlugin.setCurrentSlayerInventorySetup(config.defaultInventorySetup());
-            } else {
-                Microbot.log("No inventory setup configured, skipping banking.");
-                return false;
-            }
-        }        
-        if(!config.bank()){
-            return false;
-        }
+    public boolean needBanking() {
+        if (!config.bank()) {
+            return false;
+        }
 
         // Don't bank if we can eat food for space instead
         ...
 
         if(bankingTriggered) {
             return true;
         }
 
         // (1) If inventory is full, we need to bank
         if (Rs2Inventory.isFull()) {
             ...
             return true;
         }
 
         // (2) If there are too few empty slots, missing slayer items, or the inventory setup changed
         if ((Rs2Inventory.getEmptySlots() <= config.minFreeSlots() && config.bank()) || needSlayerItems() || inventorySetupChanged) {
             ...
             return true;
         }
+
+        // Setup-based checks only when using setups or slayer mode
+        boolean usingSetups = config.useInventorySetup() || config.slayerMode();
+        if (!usingSetups) {
+            return false;
+        }
+        if (config.currentInventorySetup() == null) {
+            if (config.defaultInventorySetup() != null) {
+                AIOFighterPlugin.setCurrentSlayerInventorySetup(config.defaultInventorySetup());
+            } else {
+                Microbot.log("No inventory setup configured; skipping setup-based checks.");
+                return false;
+            }
+        }

Also applies to: 133-146

🧹 Nitpick comments (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/aiofighter/combat/PotionManagerScript.java (1)

39-61: Gating combat pots strictly behind inCombat() may block intended pre-potting.

Rs2Combat.inCombat() requires an active interaction/animation; players won’t pre-pot on first engage or while about to attack. Consider allowing a lightweight “pre-engage” window (e.g., target selected or recent combat within N ms) controlled by a config flag to avoid DPS loss on the opener.

Apply a minimal tweak like:

-// Only drink combat potions when in combat
-if (Rs2Combat.inCombat()) {
+// Prefer in-combat, but allow brief pre-engage window
+if (Rs2Combat.inCombat() || Rs2Player.isInteracting() /* or a recent-combat flag */) {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fd75934 and 257cb4a.

📒 Files selected for processing (4)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/aiofighter/AIOFighterConfig.java (1 hunks)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/aiofighter/bank/BankerScript.java (4 hunks)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/aiofighter/combat/PotionManagerScript.java (2 hunks)
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/misc/Rs2Food.java (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 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/misc/Rs2Food.java
🧬 Code graph analysis (2)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/aiofighter/combat/PotionManagerScript.java (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/combat/Rs2Combat.java (1)
  • Rs2Combat (27-244)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/aiofighter/bank/BankerScript.java (2)
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/player/Rs2Player.java (1)
  • Rs2Player (67-2070)
⏰ 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 (3)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/misc/Rs2Food.java (1)

67-70: Blighted food entries added — verify heal/tick values.

Looks good. Please confirm the heal amounts and tick delays for blighted manta/angler/karambwan match OSRS behavior in PvP zones to avoid over/under-eating logic.

runelite-client/src/main/java/net/runelite/client/plugins/microbot/aiofighter/bank/BankerScript.java (2)

366-371: Good move: empty bags/containers at banking time.

Unconditionally emptying Looting Bag, Gem Bag, Herb Sack, and Seed Box at the start of banking aligns with the PR goal and reduces inventory churn. Nice.


483-485: Ferox pool hook placement LGTM.

Triggering restoration right after withdrawUpkeepItems() and only at FEROX_ENCLAVE with the config flag is correct and minimally invasive.

@chsami
Copy link
Owner

chsami commented Sep 6, 2025

@See1Duck Can you take a look at the changes and see if they align with yours.

withdrawUpkeepItems(config);

// Use Pool of Restoration at Ferox if configured
if (config.usePoolAtFerox() && Rs2Bank.getNearestBank() == BankLocation.FEROX_ENCLAVE) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it intended that it should only use the pool if the nearest bank is ferox? Wouldn't it make more sense to force it to select ferox if this option is on?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could potentially force a player through the wilderness so I did not consider it. An option could be added to force Ferox if we have a dueling ring, but I think a forced bank location feature should be its own PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah i see your point, im just thinking that the setting could be somewhat misleading for some users expecting it will teleport to ferox and just ends up going somewhere else

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion if the bank location is Ferox, it should use the pool by default and not as an option (who banks at Ferox if not because of the pool? Castle Wars chest is closer if chosen by distance), and maybe in the place of that option, replace with "Use Ferox Bank" , which would set Ferox as bank location (consequentially using the pool), just an suggestion tho 💯

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually you don't always want to use the pool because you will lose any boosted stats, that's why I made it an option. It's also why I changed combat pots to only be used in combat, to avoid pot -> pool -> pot.

@chsami chsami merged commit dc939fb into chsami:development Sep 10, 2025
2 checks passed
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.

4 participants