# intermediate ii: weighted choices

## ✎  what are weighted choices for?

* by default, all choices listed in `{choose:}` have equal odds of being chosen.&#x20;

<p align="center"><code>{choose: jelly | ice cream | smoothie | cake | cookie}</code> </p>

<figure><img src="/files/jmk5S7DoQFHccjBsds0Z" alt="" width="563"><figcaption></figcaption></figure>

* to make certain choices more common, users can hypothetically repeat certain choices...

<p align="center"><code>{choose: jelly | jelly | cake | cake | cake | cookie | cookie | cookie | cookie | cookie | smoothie | smoothie | ice cream}</code> </p>

<p align="center">because of the # of times each of the choice is repeated, it'll cause a change in rarity.</p>

<figure><img src="/files/EnmmttQA3T3fiHvNt9Jp" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Y27aKr8pQso1I1M42Kqz" alt="" width="563"><figcaption></figcaption></figure>

* however, the above can get excessively verbose *extremely* fast for rarer options... so instead, it is better to use the weighted choose variable.
* the `{weightedchoose:}` variable allows you to assign a *weight* to a choice, allowing you to skew the odds for common, uncommon and rarer choices, **without repeating each choice over and over again**.

## ✎  how do i use a weighted choose?

* to assign a weighted choose, you would first need to decide how rare each option should be.&#x20;
* `{weightedchoose:}` allows you to select the weight of how much each item in the `{choose:}` will be. it will be assigned in order.

<figure><img src="/files/G7eX2KGNfP8Y4uhIwfSN" alt=""><figcaption></figcaption></figure>

* so "the" = 1%, "choices" = 9%, "always correspond" = 10%, "in chronological" = 50%, and "order" = 30% chance.
* let's take an example, where you want the following items to have the below rarity:

<table><thead><tr><th width="260">prize</th><th>percentage chance</th></tr></thead><tbody><tr><td>common</td><td>60%</td></tr><tr><td>rare</td><td>30%</td></tr><tr><td>super rare</td><td>8%</td></tr><tr><td>ultra rare</td><td>2%</td></tr></tbody></table>

`/autoresponder add trigger: response:{choose: common | rare | super rare | ultra rare}{weightedchoose: 60% | 30% | 8% | 2%} you got a [choice] prize, congratulations!`

## ✎ more traditional weights + decimals also OK!

* if you don't want to use percentages, you can also use weights, such as the follows. let's go back to the jelly / cake / cookie / smoothie / ice cream example we had at the beginning (:

<p align="center"> <code>{choose:jelly|cake|cookie|smoothie|ice cream} {weightedchoose:2|3|5|2|1} [choice]</code> </p>

* or even use decimals!

<p align="center"><code>{choose:frog|cat|dog|fish|bear|bird|elephant}{weightedchoose:0.12|0.04|0.18|0.09|0.023|0.19|0.15} [choice]</code></p>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mimu.bot/autoresponder/guide/intermediate-ii-weighted-choices.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
