Skip to content

fix(themess): rewrite script for batch correctness and burn recovery#431

Merged
chsami merged 2 commits intochsami:developmentfrom
runsonmypc:fix/themess-rewrite
May 10, 2026
Merged

fix(themess): rewrite script for batch correctness and burn recovery#431
chsami merged 2 commits intochsami:developmentfrom
runsonmypc:fix/themess-rewrite

Conversation

@runsonmypc
Copy link
Copy Markdown
Contributor

Summary

Rewrite of The Mess plugin (Hosidius Servery cooking minigame) for batch-atomic execution and graceful recovery from burns.

  • Make-All semantics: every cook/combine chain blocks until the consumed ingredient hits 0 — dispatcher cannot pick a competing guard mid-chain.
  • Strict batch sizing with hard-fail invariant: if any chain item exceeds BATCH_SIZE (14, or 13 for pizza accounting for 2 knife slots) the script shuts down loudly rather than overshoot.
  • Burn-leftover reuse: leftover bowls/shells from prior burns top up the next batch via predecessor-count sizing instead of triggering a small-batch loop.
  • Burnt food only dropped between phases (gated on `!isAnimating && !isProductionWidgetOpen`) so a stray drop can't break a Cook-All chain.
  • Cupboard chatbox input matches Rs2GrandExchange timing — small-qty values now register reliably (was silently dropping qty=2 and hanging the withdraw retry loop).
  • Pizza combine stall fix: `waitForCombineChain` tracks sum-of-counts instead of min, so knife+pineapple cutting (knife persists at 2) doesn't trip the stall guard prematurely.

Test plan

  • Meat pie: full 14-batch loop, leftover-shell start scenario, burn recovery across multiple rounds.
  • Stew: full 14-batch loop, 2-bowl leftover from burns folds into next round, small-qty potato withdraws no longer hang.
  • Pizza: not testable by author (no access). Reviewed against the same patterns as meat pie / stew; combine stall guard fixed for the knife-cutting case.

runsonmypc added 2 commits May 9, 2026 13:22
…s, and burn recovery

The Mess plugin was running 1-2 actions per dispatcher tick and re-issuing
combine/cook calls between Make-X items, capping every batch at a few
products and stalling repeatedly. This rewrite consolidates the per-dish
flow around a single principle: each phase blocks until its consumed
ingredient hits 0, so the dispatcher cannot pick a competing guard
mid-chain.

- cookOnOven and combineAll/combineDoughDialog now block on inventory
  delta (not animation, which combines don't have) until the consumed
  item is depleted, with stall guards.
- Per-dish guards reordered so cooking-to-zero precedes any combine that
  uses its output (no more "started combining the moment 2 cooked meats
  appeared").
- Withdrawal targets size to predecessor counts so burn-induced leftover
  shells/water/etc. carry into the next batch and the chain tops up
  rather than over-fetching.
- Cupboard withdraws use VarClientStr.INPUT_TEXT instead of typeString
  for the Enter Amount prompt, fixing digits leaking into game chat when
  the chatbox input hadn't taken focus.
- Cupboard interactions use exact-tile lookup (findObjectByLocation) to
  avoid mis-targeting the food cupboard when querying near the utensil
  cupboard one tile away.
- Burnt food dropped between phases (gated on !isAnimating and
  !isProductionWidgetOpen so the cook chain isn't interrupted).
- Hard-fail invariant: if any chain item exceeds BATCH_SIZE the script
  shuts down loudly rather than over-fetching.
- Bowl-return guard gated on count(PIE_SHELL) >= BATCH_SIZE so freshly
  withdrawn bowls aren't immediately returned during top-up.

Version bump 1.0.3 → 1.1.0.
- Stew gates takeRawMeat on count(BOWL_WATER) >= BATCH_SIZE so leftover
  bowls from prior burns drive the top-up formula instead of looping a
  tiny 2-stew batch.
- Reorder stew guards: fillBowls before BOWL_WATER consumers so a partial
  fill cannot under-fetch downstream raw meat.
- Mirror Rs2GrandExchange.setQuantity timing (sleep 600 + 400 around
  setChatboxAmount) in withdrawFromCupboard and takeRawMeat. Without
  these, the chatbox silently drops small-qty values, hanging withdrawals.
- fillBowls timeout 8s -> 15s; 14 bowls at game-tick speed is ~8.4s with
  no headroom.
- waitForCombineChain stall guard from min(c1,c2) to c1+c2: knife
  persists at 2 during pizza pineapple-cutting, pinning min and tripping
  the stall guard after ~3 cuts. Sum decreases on every action.
@chsami chsami merged commit d07eb1d into chsami:development May 10, 2026
1 check 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.

2 participants