feat(aiofighter): telegrab unreachable loot#462
Merged
Conversation
Opt-in "Telegrab unreachable loot" toggle (Loot section, default off). When enabled, wanted loot that can't be reached on foot (e.g. drops behind the bars at the caged Lesser Demon) is picked up with Telekinetic Grab instead of walking, which otherwise spams "I can't reach that!". - Reachability via Rs2Tile.isTileReachable (strict flood-fill); reachable loot is walked as before. - Casts once per pile and waits for the grab to resolve, keeping cast/ reachability calls off the client-thread hot path. - Reuses the existing Rs2LootEngine selection, so only configured loot is grabbed. 2.1.7 -> 2.2.0 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for Telekinetic Grab looting for unreachable ground items in AIO Fighter, plus a plugin version bump.
Changes:
- Route loot actions through a new
lootOrTelegrab(...)handler that telegrabs unreachable loot when enabled. - Add a config toggle to enable/disable telegrabbing unreachable loot.
- Bump plugin version to
2.2.0.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/main/java/net/runelite/client/plugins/microbot/aiofighter/loot/LootScript.java |
Adds telegrab-based looting path for unreachable items and wires it into the loot engine. |
src/main/java/net/runelite/client/plugins/microbot/aiofighter/AIOFighterPlugin.java |
Updates plugin version to reflect the new feature. |
src/main/java/net/runelite/client/plugins/microbot/aiofighter/AIOFighterConfig.java |
Introduces a config toggle that enables telegrabbing unreachable loot. |
Comment on lines
+110
to
+115
| final int id = groundItem.getId(); | ||
| if (Rs2Magic.canCast(MagicAction.TELEKINETIC_GRAB) && Rs2Magic.cast(MagicAction.TELEKINETIC_GRAB)) { | ||
| sleep(300, 500); // let the spell arm before clicking the item | ||
| final WorldPoint me = Rs2Player.getWorldLocation(); | ||
| final int range = (me == null ? 10 : me.distanceTo(wp) + 2); | ||
| Rs2GroundItem.interact(id, "Cast", range); |
| // pile stops the loot loop from re-casting mid-grab (the spellbook stutter) | ||
| // and keeps the cast/reachability calls off the client thread's hot path, | ||
| // which was saturating it and causing TimeoutExceptions in other scripts. | ||
| sleepUntil(() -> Rs2GroundItem.getGroundItems().get(wp, id) == null, 3000); |
| @ConfigItem( | ||
| keyName = "telegrabUnreachableLoot", | ||
| name = "Telegrab unreachable loot", | ||
| description = "Use Telekinetic Grab (needs 33 Magic + law & air runes) to pick up wanted loot you can't walk to, e.g. caged or fenced-off drops. Off = walk to loot as normal.", |
Comment on lines
+112
to
+114
| sleep(300, 500); // let the spell arm before clicking the item | ||
| final WorldPoint me = Rs2Player.getWorldLocation(); | ||
| final int range = (me == null ? 10 : me.distanceTo(wp) + 2); |
| // pile stops the loot loop from re-casting mid-grab (the spellbook stutter) | ||
| // and keeps the cast/reachability calls off the client thread's hot path, | ||
| // which was saturating it and causing TimeoutExceptions in other scripts. | ||
| sleepUntil(() -> Rs2GroundItem.getGroundItems().get(wp, id) == null, 3000); |
- Align telegrab targeting with the wait condition. interact() grabs the nearest pile of the item id, so we now wait until a pile of that id is removed (the same id selector) instead of keying on a specific WorldPoint; robust when multiple same-id piles are in range. - Extract telegrab timing/range values into named constants. - Document in the config that unreachable loot is skipped (not walked to) when Telekinetic Grab can't be cast. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Thanks for the review. Addressed in 8ad98a4:
|
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.
Summary
Adds an opt-in "Telegrab unreachable loot" toggle to AIO Fighter's Loot section (default off). When enabled, wanted loot the player can't reach on foot (for example, drops behind the bars at the caged Lesser Demon) is collected with Telekinetic Grab instead of walking to it, which otherwise just spams "I can't reach that!". With the toggle off, looting behaviour is unchanged.
How it works
Rs2Tile.isTileReachable(strict collision flood-fill), so only genuinely unreachable tiles trigger a grab and reachable loot is walked to as before. (Rs2Walker.canReachis unsuitable here: it returns true when the player can path to within ~2 tiles of the target, which holds for caged drops you can't actually stand on.)Rs2LootEngineloot action, so it only ever telegrabs items the current loot config already selects (item list / GE value / ashes / bones / etc.). No duplicated selection logic.TimeoutExceptions in other scripts).Rs2Magic.canCast); if it can't cast, the item is skipped rather than walked to.Affected files
aiofighter/AIOFighterConfig.java(newtoggleTelegrabUnreachableLootoption, Loot section, default off)aiofighter/loot/LootScript.java(telegrab-aware loot action)aiofighter/AIOFighterPlugin.java(version bump 2.1.7 -> 2.2.0)minClientVersionstays2.1.32: verifiedRs2Tile.isTileReachable,Rs2Magic.canCast/cast(MagicAction),MagicAction.TELEKINETIC_GRAB, and thegetGroundItems().get(location, id)pattern all exist at that tag.Test plan
./gradlew build -PpluginList=AIOFighterPluginTimeoutExceptions, client thread responsive.Repro context
The caged Lesser Demon is a classic Telekinetic Grab spot: the demon is safespotted and its drops land behind the cage bars where the player can't walk. The looter tried to walk to them every tick, spamming "I can't reach that!" and never collecting the drops. This adds the telegrab path so those drops are collected, with the Magic XP from the grabs being a nice bonus at this training spot.
🤖 Generated with Claude Code