Skip to content

feat(slayer): add finishing item support#486

Merged
chsami merged 12 commits into
chsami:mainfrom
runsonmypc:feat/slayer-finishing-items
Jun 16, 2026
Merged

feat(slayer): add finishing item support#486
chsami merged 12 commits into
chsami:mainfrom
runsonmypc:feat/slayer-finishing-items

Conversation

@runsonmypc

Copy link
Copy Markdown
Contributor

Summary

  • Adds slayer finishing item handling to the Slayer plugin: ice cooler (desert lizards), bag of salt (rockslugs), and rock hammer (gargoyles)
  • Automatically withdraws the correct finishing item from bank with quantity matching remaining task kills (stackable items)
  • Triggers a bank trip when finishing items are depleted mid-task
  • Respects vanilla autokill varbits — skips finishing items if the player already has auto-finish enabled in-game for that monster type
  • Guards against inventory-full edge case with a log warning

Test plan

  • Assign a gargoyle task, verify rock hammers are withdrawn matching task size
  • Confirm rock hammer is used on gargoyles at low HP during combat
  • Enable vanilla gargoyle auto-smash varbit, verify plugin skips rock hammer withdrawal and usage
  • Assign a desert lizard task, verify ice coolers are withdrawn and used
  • Assign a rockslug task, verify bags of salt are withdrawn and used
  • Verify non-finishing-item tasks (e.g. bloodvelds) are unaffected — no unnecessary banking
  • Test with a full 28-slot inventory setup to confirm the inventory-full warning fires
  • Verify re-banking triggers correctly when finishing items run out mid-task

runsonmypc and others added 12 commits May 18, 2026 16:27
…egressions

The X-based center-line check (CENTER_X=3047) only works near the boats.
South of the boats the fishing areas converge — east-side fish spots,
spirit pool, and fires all have X < 3047, so the filter excluded them.

- Remove isOnOurSide from fish spots (distanceTo rangePoint already scopes)
- Remove isOnOurSide from spirit pool (use distanceTo spiritPoolPoint ≤ 15)
- Remove isOnOurSide from fires, tighten fire range from 35 to 5 tiles
- Remove broken inCloud filter from fish spots (was no-op before cloud fix)
- Fix walkToSpiritPool spam: use distance ≤ 2 instead of exact equality
- Fix client-thread NPEs (Rs2Player.getWorldLocation, fightFiresInPath)
- Remove all isInteracting gates (unreliable), use target-identity checks
- Remove blocking waits, add isMoving guards for non-blocking loop
- Add cloud dodge via LocalPoint comparison (fix coordinate space mismatch)
- Lock tether target on wave tick to prevent oscillation
- Add runtime counter to overlay
- Sort item fetching by proximity
- Use walkFastCanvas/walkFastLocal instead of blocking Rs2Walker.walkTo
Filter out fishing spots where the player's fishing position (adjacent
tile) would be under a fire cloud. Uses inCloud radius 1 which covers
2 tiles from the spot center — enough to detect clouds on any adjacent
tile the player would stand on.
… during incoming waves

The client thread was being saturated with ~20+ invoke() round-trips per
300ms script iteration during waves — inventory queries from
areItemsMissing(), live State.getAllFish()/getTotalAvailableFishSlots()
calls in handleStateLoop(), and state.isComplete() in onGameTick all
dispatched to the client thread while it was at peak load processing
wave NPC spawns. On Mac this stalled rendering for seconds.

During a wave the only valid action is tethering, so the script loop
now short-circuits to handleTether() immediately. onGameTick also
returns early during waves. Additional fixes:

- Replace live State method calls in handleStateLoop with cached values
- Replace live isInMinigame() in overlays with cachedInMinigame
- Remove dead Rs2WorldPoint allocation per fish spot per frame
- Remove pathfinding (distanceToPath) from overlay render loop
- Move state transitions and inventory queries out of overlay render
- Add fire-adjacent fish spot detection and douse-before-fish logic
- Enable fire handling in both solo and mass modes
- Fix fire search radius (35 for solo, 5 for mass)
- Remove Rs2Camera.turnTo before tether, click tether immediately
- Add JVM args and javaLauncher to runDebug task for Mac JDK 11
…gions

All distance checks, fire detection, work area determination, and NPC
lookups now use LocalPoint instead of WorldPoint to avoid template vs
instanced coordinate mismatches. Fixes wrong-side boat pathing, broken
fire detection/dousing, ammo crate not found, and spirit pool spam.
… resilience

All sleepUntil calls in item gathering break immediately on incoming wave
so the script can tether. Removed forfeit-on-fire from item gathering to
prevent skipping items when fires are near crates. Reduced ammo crate
cloud filter radius from 1-2 tiles to 0 (only skip if cloud is directly
on crate). Stale fish spot reference cleared when spot despawns.
Convert finishGame, fetchMissingItems, isOnStartingBoat, FILL ammo crate
sorting, and handleDamagedMast/Totem to use LocalPoint. Slow tether
retries with Rs2Random gaussian. No template-vs-instanced comparisons
remain in functional code.
…c log spam

- Gate item fetching to CATCH states only — handleMinigame was interrupting
  cooking by walking to the water pump when buckets were empty
- Fall back to Rs2Walker.walkTo when LocalPoint.fromWorld returns null
  (player too far for canvas click) in all walk methods
- Move harpoon spec code entirely inside enableHarpoonSpec config check
  so no spec logs emit when the option is disabled
- Prevent fish spot switching while moving to a valid target
- Widen Leave NPC search radius to 40 tiles
- Add wave-break to fire douse sleepUntil in fightFiresInPath
- Reduce fire douse timeout from 10s to 5s
- Use Rs2Random.randomGaussian for tether retry delay
- Add spirit pool coordinate logging for random walk diagnosis
…cking, fire responsiveness

- Simplify CATCH guard: return if animating/moving, allow double spot switch
- Per-game randomized thresholds via fancyNormalSample for all energy/intensity checks
- Repair sleepUntil blocks until mast/totem is actually fixed
- Remove doused fires from sortedFires immediately, validate NPC in adjacency checks
- Drop boat-anchor filter in finishGame, pick nearest Leave NPC to player
- Gate item fetching to CATCH states only (no cooking interruption)
- Tether retry uses fancyNormalSample(1200, 2800)
- Config tooltips explain gameplay effects
- Clean up spirit pool spam logging, add NPC coordinate logging
- Rs2Walker fallback for all walk methods when LocalPoint is null
- Two-phase repair sleep: wait for animation start (3s), then wait for
  completion (10s) — prevents premature timeout when walking to repair
- Spirit pool query now requires "Harpoon" action, filtering out inactive
  pools that caused recurring error log spam
Major version bump reflecting the comprehensive rewrite of coordinate
handling, state machine, fire detection, and humanization systems.
…into fix/tempoross

# Conflicts:
#	src/test/java/net/runelite/client/Microbot.java
…ck hammer)

The Slayer plugin lacked the ability to use finishing items on monsters
that require them (desert lizards, rockslugs, gargoyles). This adds:

- Item-on-NPC finishing during combat when monsters reach low HP
- Automatic withdrawal of finishing items from bank (quantity = remaining kills)
- Banking trigger when finishing items are depleted
- Vanilla autokill varbit checks to skip when player has auto-finish enabled
- Inventory-full guard with log warning

@chsami chsami left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed for critical/security issues, malicious code, and plugin version bump. No blocking issues found.

@chsami chsami merged commit 6b7a78e into chsami:main Jun 16, 2026
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