Repository navigation
fix(AutoMiningPlugin): progressive mode banks and mines at the chosen mine, blank keep list no longer stalls drop mode (1.0.15) - #655
Merged
Conversation
…p list (1.0.15) - Run the progressive location check only in MINING so a bank trip can deposit instead of being walked back to the mine before the deposit tick. - Anchor the mining location to the selected progressive mine, so the walk-back, rock search and bank return no longer pull the player to the start tile (also after a level-up switches the mine). - Parse "Items to keep" with MiningBankRule.parseItemNames so empty entries no longer match every item and stall drop mode on a full inventory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV
A blank or separator-only "Items to keep" parsed to an empty list, so drop mode dropped the whole inventory, including a carried pickaxe. Fall back to the config default "pickaxe" when the parsed list is empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV
keepListDropsEmptyEntries only exercised the empty-entry filtering that parseItemNames already had, so it passed on the old code and proved nothing. The blank-list fallback test, now also covering ", ", is the one that fails without the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hardening for AutoMiningPlugin. Three reliability fixes, plugin version 1.0.14 -> 1.0.15.
1. Progressive mode with banking never deposits (mining-F1)
What a player sees: Progressive mode and Use Bank are both on. The inventory fills at a mine (for example Al Kharid iron). The script walks to the bank and opens it, then closes it and walks back to the mine, then walks to the bank again. It repeats this forever with a full inventory and never deposits anything.
Root cause:
AutoMiningScript.java:82ran the progressive location check on every tick, before the state switch. InRESETTING, the bank branch (AutoMiningScript.java:196-201) returns as soon asRs2Bank.walkToBankAndUseBankopens the bank, so the deposit can only happen on the next tick. On that tick, the check at line 82 ran first. The player was at the bank, far from the mine, so it calledRs2Walker.walkTo(targetPoint, 3). The walker closes an open bank before walking, so the player went back to the mine while still inRESETTING.Change: The progressive location check now runs only in
State.MINING. InRESETTING, the bank branch now gets its next tick: deposit, close the bank, walk back, then setMINING. While mining, progressive mode still walks to the chosen mine and still switches mines on level-up.2 and 3. Progressive mode walks back and forth between the start tile and the chosen mine (mining-F2, mining-F3)
What a player sees:
distanceToStraytiles (default 20) from the chosen mine, for example in Lumbridge castle with level 1 Mining. The script walks to Lumbridge Swamp mine, then walks back to the castle, then to the mine again, and never mines.Root cause: On the first tick, lines 71-73 set
initialPlayerLocationto the player's own tile. InensureProgressiveLocation(AutoMiningScript.java:316-318), the anchor was only moved to the mine wheninitialPlayerLocation == null, which by then can never be true. So the stray check inMINING(lines 142-148), the rock search infindRock(lines 238/244) and the walk back after banking (line 213) all used the start tile or the old mine. #390 (237e175) introduced this when it narrowed the condition to null-only, so that the anchor would not move while the player stood at the bank.targetPointis the fixed coordinate of the selected location, though, not the player's position, so the earlier condition never followed the player to the bank anyway.Change: The pre-#390 condition is back:
ensureProgressiveLocationsets the anchor totargetPointwhenever they differ. The anchor follows the selected mine at start and after every level-up mine switch. It also recovers if another script's shutdown clears the shared static anchor. Non-progressive mode never calls this method, so it is unchanged. The F2 finding proposed setting the anchor inupdateActiveRock. This one change fixes both findings, and it also handles the anchor being cleared by another script's shutdown.4. A blank or comma-only "Items to keep" makes drop mode stall on a full inventory (mining-F4)
What a player sees: Use Bank is off and "Items to keep" is cleared, or set to something like
pickaxe,(comma and space) ora,,b. When the inventory fills, nothing is dropped, and the script stands still with a full inventory. No error is logged.Root cause:
AutoMiningScript.java:217built the keep list with a plainsplit(",")andtrim, which leaves an empty-string entry.Rs2ItemModel.matches(false, ...)does a case-insensitivecontainscheck, andcontains("")is true for every item.dropAllExcepttherefore dropped nothing, the state went back toMINING, the full-inventory check setRESETTINGagain, and this repeated.Change: Drop mode now builds its keep list with the new
MiningBankRule.parseItemsToKeep. It reuses the existingparseItemNames, which the banking path already uses and which removes empty entries. If the parsed list is empty, it falls back topickaxe, the config default, so a blank field never drops an inventory pickaxe. Lowercasing does not change matching, because the match lowercases both sides. Normal values such aspickaxeorDragon pickaxe, Gem bagbehave as before.Validation
./gradlew build -x test -PpluginList=AutoMiningPlugin: BUILD SUCCESSFUL../gradlew cleanTest test --tests 'net.runelite.client.plugins.microbot.mining.*' --tests '*PluginManifestVersionTest*': BUILD SUCCESSFUL (MiningBankRuleTest 9/9, RockSelectorTest 5/5, PluginManifestVersionTest 1/1).MiningBankRuleTest.blankKeepListFallsBackToPickaxecovers""," , ",","and", ". It fails on the base commit 241ecdd (does not compile:parseItemsToKeepdoes not exist there).Rs2Player,Rs2WalkerandRs2Bankcalls. Three reviewers (regression, fidelity, standards) traced each change and approved it.Not live-tested. These changes have not been run against a live game client.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV