Skip to content

Compost bins: start at once when standing at the bin; weeds go in together - #6626

Merged
UnhealthyKraken merged 3 commits into
RSPSApp:mainfrom
Bandit-HaxUnit:fix/6539-compost-bin-timing
Nov 23, 2026
Merged

UnhealthyKraken merged 3 commits into
RSPSApp:mainfrom
Bandit-HaxUnit:fix/6539-compost-bin-timing

Conversation

@Bandit-HaxUnit

@Bandit-HaxUnit Bandit-HaxUnit commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #6539

Problem

Every use or Take on a compost bin waited two ticks before the first step, whether or not the player was already standing at the bin. Every click restarted that wait, so clicking the bin again was slower than leaving the loop running. Clicking every tick never deposited anything at all. Weeds went in one at a time like any other ingredient.

Server (main) Live (rsprox captures)
Fill, already standing at the bin animation +2, item +3 animation on the click's tick, item +1, then every 2 ticks (local 1000451 t409, 1000448 t8592, 1000444 t22038, 1000324 t6782)
Take, already standing at the bin animation +2, bucket +3 animation +1, bucket +2, then every 4 ticks (local 1000451 t317, t385; 1000105 t441)
Fill or take after walking +2 after arriving +2 after arriving (unchanged)
Weeds one per 2 ticks all at once (up to the space left), 2 ticks after the animation (local 1000103 t712-716: 15; 1000324 t2035-2042: 10, t6786-6788: 1; Wiki, Weeds: "it will put all 15 weeds at once")
Click again during a running loop restarts the 2-tick wait not captured

Fix

  • server/plugins/skills/farming/Patches.Farming.js
    • A new onObjectRoute hook (noteBinClick) records the cycle of each click on a compost bin. Construction uses the same hook for its portals. startBinWork treats a use on that same cycle as "already standing at the bin". A fill then animates at once and deposits a tick later. A take scoops a tick later. A use after walking keeps the two-tick start.
    • Any click cancels the bin loop (player:world-input). A click on that same loop (same bin, action and item, same tile) whose next step is still pending picks it back up where it was. A click with another item on that bin starts at the running loop's next step. Re-clicking can no longer slow a fill or take down, and switching items can't beat the two-tick pace. A loop paused by a level-up pop-up is never picked back up: its pause would never clear.
    • fillBinStep: weeds go in together, as many as the bin has room for, two ticks after the animation, and the loop ends there.
  • docs/farming.md: the compost bin timings, with recording ids.
  • server/tests/farming-compost-inputs.test.cjs: 9 new tests (standing fill, walked start, weeds at once in both bin sizes and with one space left, walked weeds, standing take with its 4-tick cadence, clicking every tick during a fill and a take, a fresh start after a loop ends or with another item, switching items every tick, a click after a level-up pause).
  • farming-bin-bottomless-collection, farming-rotten-tomato-collection, farming-compost-mixing tests: ticks() now advances the world cycle as World.process does, and the assertions expect the standing-still Take (a tick sooner) and weeds going in together.

Testing

  • Farming tests, 96/96 pass: farming-compost-inputs (20), farming-bin-bottomless-collection, farming-compost-mixing, farming-rotten-tomato-collection, farming-bottomless-compost-parity, farming-bottomless-selection, farming-compost-bin-dump, farming-noted-compost, farming-capture-lines, farming-leprechaun-weeds, farming-cure-plant, farming-model. farming-geomancy-interface fails identically on upstream/main (pre-existing, IbansStaff CombatSpells errors in that file's setup).
  • Revert check: with upstream/main's Patches.Farming.js, every new compost-inputs test fails and the 11 existing ones pass. With the first commit's Patches.Farming.js, the item-switch and level-up tests fail.
  • In game (agent MCP, Falador bin 7836):
    • A walked orange use put the item in 4 ticks after the call (walk, then +2/+3, as before).
    • Weeds used from idle while standing at the bin filled it to 15 two ticks after the click, with the rest left in the inventory.
    • Take could not be reached in game: advance_time does not move a closed bin's rot timer (it uses wall-clock closedAt). The unit tests cover it.

Not covered

  • Ours: no capture clicks a bin while its loop is still running (every captured re-click came after the loop had stopped). A re-click on the same loop keeps the loop's pace instead of restarting it, so spam-clicking is never slower than leaving it; switching items waits for the running loop's next step, so it is never faster than the captured cadence either.
  • A use confirmed through the mixing dialogue still starts two ticks after the choice (no capture).
  • Compost bin rotting does not listen for agent:advance-time (follow-up for testing tools).
  • Ours: switching items every tick replays the animation each tick (never faster, nothing lost); no capture shows what live does there.

Self-reviewed with the review checklist at bbc564d (two rounds; first-round findings fixed in bf3967f).

Reference

  • rsprox captures: recording 1858, local 1000103, 1000105, 1000324, 1000343, 1000444, 1000448, 1000451 (rsprox_index.py facts|trace 'farming_compost_bin_*' --include-special).
  • Wiki: Weeds, Compost bin.

🤖 Generated with Claude Code

Bandit-HaxUnit and others added 3 commits November 23, 2026 13:11
…ether

A use or Take on a compost bin always waited two ticks before the first
step, and every click restarted that wait, so clicking the bin again
was slower than leaving the loop running (RSPSApp#6539). Live starts at once
when the player is already standing at the bin: the ingredient goes in
with the animation on the click's tick and lands a tick later, and
compost is scooped a tick after the click. A click on the loop already
running picks it back up instead of restarting it. Weeds all go in at
once, two ticks after the animation (rsprox captures, Wiki).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-ups for RSPSApp#6539. Another item on a bin whose loop still has
a step due now starts at that step, so alternating items never beats
the two-tick pace. A loop paused by a level-up pop-up is no longer
picked back up by a click (its pause would never clear). The bottomless,
rotten tomato and mixing tests advance the world cycle each tick, as the
server does, and expect the standing-still Take and all-at-once weeds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Bandit-HaxUnit
Bandit-HaxUnit marked this pull request as ready for review November 23, 2026 12:26
@UnhealthyKraken
UnhealthyKraken self-requested a review November 23, 2026 17:59
@UnhealthyKraken

Copy link
Copy Markdown
Collaborator

Reviewing this now (review loop, head bbc564d).

@UnhealthyKraken UnhealthyKraken left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed PR #6626 at bbc564d (main 75a513d, integration tree a11a32da451b02e1021371af67a35e6f7aecd7b1).

What it does

Compost bins no longer wait two ticks when the player is already standing at the bin. A fill animates on the click's tick and deposits a tick later; a Take scoops a tick later; a click after walking keeps the two-tick start. Weeds go in together (up to the room left), two ticks after the animation, and the loop ends there. A click on the loop that is already running keeps its pace instead of restarting it. It fixes #6539.

What was checked

  • Behaviour: the new onObjectRoute hook only stamps the cycle of a click on a compost patch id; startBinWork treats a use on that same cycle as "standing". Traced the item paths: a fill deletes one item per deposit step (weeds: min(inventory, capacity - count) in one deleteNumber), recounts bin.super/tomatoes/tier by the same amount, and re-checks bin state and inventory before every step. Take still deletes one Bucket and adds one compost at the output step, after canTakeBinProduct. A spam re-click (same bin, action, item, tile, next step still pending) re-installs the same loop object, so nothing is deposited or scooped twice. Switching items cancels the old loop before its deposit, so no item is taken without being deposited.
  • Parity: every recording citation checked against the transcripts.
    • Standing fill: rsprox_transcripts/227/910484.txt t409 (oploct on the bin with seq 832 and sound 2441 on the click tick, item gone t410, then every 2 ticks); 227/910481.txt t8592; 227/910477.txt t22038; 227/910357.txt t6782. All match.
    • Standing Take: 227/910484.txt t317 (oploc1; seq 832 t318, ultracompost t319, next t322/t323) and t385 (seq t386, bucket t387); 225/910138.txt t441 (bucket on bin; seq t442, bucket t443). All match.
    • Weeds: 225/910136.txt t712 click, arrival t713, seq 832 t715, 15 weeds gone t717; 227/910357.txt t2035 click, arrival t2038, seq t2040, 10 weeds gone t2042; 227/910357.txt t6786 (standing) seq on the click tick, one weed gone t6788. All match, and the walked cases confirm "+2 after arriving".
    • Wiki, Weeds: "when you use a weed on the compost bin, it will put all 15 weeds at once" is on the page as quoted. The Compost Bin page has no weed or timing text.
    • Where the PR goes beyond recordings, it says so (re-click mid-loop, item switching, the mixing dialogue start, a level-up pause). Not a defect.
  • Traced: Services.itemOnBin/binAction -> Patches.startBinWork (3 call sites: Take/bucket, fill, mix confirmation) -> workStep -> fillBinStep / Services.takeBinStep; walkToObject emits the route event and runs action.execute in the same cycle for a player already in reach, a later cycle after walking; player:world-input -> cancelWork; pauseWork / level-up pause.
  • Rules: no generated JSON, no plugin description/config change (world-config-docs not needed), no TypeScript change; docs/farming.md updated with the recording ids.
  • Related PRs: none found that touch this code.

Findings

No defects found.

Scope

ordinary

Verified

  • yarn build in server/ on the integration commit: ok.
  • farming-compost-inputs.test.cjs: 20/20.
  • farming-bin-bottomless-collection.test.cjs: 4/4.
  • farming-compost-mixing.test.cjs: 3/3.
  • farming-rotten-tomato-collection.test.cjs: 5/5.
  • Consumers, each on its own: farming-bottomless-compost-parity 5/5, farming-bottomless-selection 8/8, farming-compost-bin-dump 5/5, farming-noted-compost 5/5, farming-capture-lines 25/25, farming-leprechaun-weeds 5/5.
  • Revert check (Patches.Farming.js from main with the PR's tests): 9 of the 20 compost-inputs tests fail (all the new ones), the 11 existing pass; file restored afterwards.
  • docs: yarn install --frozen-lockfile and yarn build (Git Bash yarn 1.22.22): build complete.
  • main+head merge tree: clean
  • generated JSON: none edited

Not verified

  • No live game run; the standing-versus-walked split depends on the click and the route event sharing a World cycle. I read walkToObject/MovementTask and it holds for an in-reach click, and the PR's in-game note covers the weeds case, but I did not drive it myself.
  • Take-after-walking timing (+2 after arriving) has no recording cited in the PR; only the unchanged-code claim backs it.
  • Weeds in a 30-item bin going in all at once (up to 30): the Wiki says 15 and no recording shows a big bin, so the upper size is extrapolated.
  • Recording 1000343 and recording 1858 were not individually re-read; no tick in the PR depends on them.
  • farming-geomancy-interface (reported pre-existing failure) not run; it does not consume the changed code.

Verdict

Merge

@UnhealthyKraken
UnhealthyKraken merged commit e7ec324 into RSPSApp:main Nov 23, 2026
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.

[Bug]: No Manual Compost Bins

2 participants