# /spicepay — Guided payout

Calculate a fair split for a spice run. The wizard keeps things simple and transparent for the team.

## Start

    /spicepay [participants] [force_new]

- If `participants` is omitted, you set it in the first modal (1–25).
- Use `force_new: true` to discard an existing session and start clean.

## Setup modal

- Total spice yield (sand) — integer ≥ 0.
- Participants — include owners (Refiner/Carrier/Crawler). People only; vehicles/refinery are owned by people.

## Editing participants

For each slot:

- Name — free text (mention text is fine).
- Active % — 0–100. 0% = owner-only (didn’t actively join).
- Owner of (optional) — any of: `refiner`, `carrier`, `crawler`. Flexible input (e.g. “lsr”, “refinery”, “car”, “cr”).

Use Add / Edit participant, Previous/Next to navigate. The preview shows filled vs. empty slots and highlights “owner-only”.

## Payout type

- Sand — no refinery cut; 0 or 1 Refiner owner allowed.
- Melange — requires exactly one Refiner owner. First a refinery cut % is taken and paid to the Refiner, then the rest is split.

When switching to Melange, set the refinery yield (integer) in the modal.

## Weighting (the math, simplified)

- Each person gets a weight: Base × Active% + bonuses for owning Carrier/Crawler.
- We split the pot proportionally by weights (they’re normalized; only ratios matter).
- Melange only: take Refinery cut % first → Refiner. Any rounding leftovers go to Refiner (Melange) or top earner (Sand).

### Controls

- Toggle payout: Sand/Melange — switches mode (prompts for refinery yield on Melange).
- Adjust weighting factors — change:
  - Base × active % (default server setting)
  - Carrier bonus ( + )
  - Crawler bonus ( + )
  - Refinery cut % (Melange only)
- Weights help — short explanation inline.
- Presets — Owner-heavy / Participation-heavy / Fair (server defaults) / Even split.
- Save as my defaults — stores your weights for future runs (per user).
- Finish — shows a neat preview (table) and lets you Post to channel.

## Validation & limits

- Participants: 1–25.
- Active %: 0–100.
- Melange: exactly one Refiner owner required; Sand: 0 or 1 allowed.
- No duplicate names (duplicates are auto-disambiguated in preview).

## Posting

The post includes:

- Header (Sand or Melange) with the chosen emoji.
- Weighting summary (Base, bonuses, and refinery cut if Melange).
- A clean monospace table: Name · Active% · Owner of/Role · Amount.

Footnote: “0% = owner only”.