# intermediate i: ranges and making choices

## ✎ why use a range or make mimu choose?

* sometimes, you want varying amounts or varying responses to switch things up!
* this allows you to expand and teach mimu to make random responses or amounts.

{% hint style="info" %}
&#x20;variables used in here are also mentioned in the [variables list](/autoresponder/resources/variables-placeholders-and-functions.md).
{% endhint %}

## ✎ the range variable

### ♪ choosing from a range of numbers

let's take an example currency command we've made from [beginner ii: using simple functions](/autoresponder/guide/beginner-ii-using-simple-functions.md).

`/autoresponder add trigger:give me 10 reply:{modifybal:+10} {cooldown:60} okay, i've given you 10 {server_currency}, you have {user_balance} now!`

* as you can see, this example only gives you 10 currency. but what if we wanted mimu to give an amount between 10-100 instead?
* we can use the `{range:}` variable to do this! let's look at this:

`/autoresponder add trigger:give me more reply:{range:10-100} {modifybal:[range]} {cooldown:60} okay, i've given you [range] {server_currency}, you have {user_balance} now!`

![](/files/-MWUyQixznKyNT8bI0Ml)

* the `{range:}` variable takes an input of a minimum to maximum amount which returns a range of numbers.
* once mimu decides, it stores the number chosen from the range into `[range]`.
* that way, you can use `[range]` as a placeholder in the rest of your AR.

{% hint style="info" %}
it is **vital that you put the `{range:}` variable before using `[range]`**. this is because you need to have mimu choose between the range before you can refer to the chosen number from the range.
{% endhint %}

### ♪ using multiple ranges

* you can use multiple ranges, up to a total of **4 of them**.&#x20;
* you can do so by  `{range:} {range1:} {range2:} {range3:}`.&#x20;
* and just as you'd expect, the corresponding placeholders are `[range] [range1] [range2] [range3]`.

here's an example!

`/autoresponder add trigger:choose numbers reply:{range:1-10} {range1:10-20} {range2:20-30} {range3:30-40}`\
`a number from 1 to 10: [range]`\
`a number from 10 to 20: [range1]`\
`a number from 20 to 30: [range2]`\
`a number from 30 to 40: [range3]`

![](/files/-MWUyeZDj73iIKJ56Njc)

## ✎ the choose variable

### ♪ choosing from a list of choices

* using the `{choose:}` function, you can make mimu choose from a list of predefined variables.
* let's take an example. maybe you'd like mimu to choose between "pancakes", "cookies" or "yogurt".

`/autoresponder add trigger:.chooseforme reply:{choose:pancakes|cookies|yogurt} i choose [choice]!`

![](/files/-MWUypTPg3JeoQnchmZU)

* as you can see, the `{choose:}` variable takes an input of choices separated with the pipe | symbol
* once mimu decides, it stores the result in the variable `[choice]`.
* that way, you can use `[choice]` as a placeholder for the rest of the AR.&#x20;
* by manipulating the number of times the choice is mentioned in the variable, you can also vary the "rarity" of a response.

{% hint style="info" %}
similarly, remember to use `{choose:}` before `[choice]`! this is to make sure it chooses before it shows the choice. otherwise, you will get the `CHOICE_NOT_CHOSEN_YET` error.
{% endhint %}

### ♪ making several choices

* similar to ranges, you can have mimu make more choices, up to **4** of them.
* you can do so by  `{choose:} {choose1:} {choose2:} {choose3:}`.&#x20;
* and just as you'd expect, the corresponding placeholders are `[choice] [choice1] [choice2] [choice3]`.

## ✎ extended - doing weird stuff

{% hint style="info" %}
this part is just for people who want to go above and beyond in complicating things. feel free to skip if this isn't for you.
{% endhint %}

### ♪ put a range in a choice or a choice in a range

* you can put a range in a choice, or a choice in a range, like this:

`/autoresponder add trigger:why would you even do this reply:{range:1-5} {range1: 10-20} {range2:30-50} {range3:1000-10000} {choose:[range]|[range]|[range]|[range1]|[range1]|[range1]|[range2]|[range2]|[range3]} {modifybal: [choice]} you earned [choice] {server_currency}`

* although extremely complex, this allows you to make some ranges rarer than others. in this example, \[range] is more likely than \[range1] which is more likely than \[range2] and so on.
* similarly, remember to put your {range:} variables BEFORE using the corresponding \[range] in the {choose:} variable.


---

# 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-i-ranges-and-making-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.
